aboutsummaryrefslogtreecommitdiff
path: root/mapper.lv2/test
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2018-01-13 12:46:10 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2018-01-13 12:46:10 +0100
commitec1ce1f04a580e93185fe9d62f02561b4c9f004b (patch)
treea479d60c95c41d82056076c5ef15542c335c6494 /mapper.lv2/test
parente53db3b68e9975d2defe31aa95f58a6d7b8cd928 (diff)
parent4aaa1c5227edb68051e7cc9c82758516bc0496a8 (diff)
downloadsynthpod-ec1ce1f04a580e93185fe9d62f02561b4c9f004b.tar.xz
Merge commit '4aaa1c5227edb68051e7cc9c82758516bc0496a8'
Diffstat (limited to 'mapper.lv2/test')
-rw-r--r--mapper.lv2/test/Makefile9
-rw-r--r--mapper.lv2/test/mapper_test.c3
2 files changed, 9 insertions, 3 deletions
diff --git a/mapper.lv2/test/Makefile b/mapper.lv2/test/Makefile
index b8c56429..b722b73a 100644
--- a/mapper.lv2/test/Makefile
+++ b/mapper.lv2/test/Makefile
@@ -1,12 +1,14 @@
CC ?= clang
+C_FLAGS ?= -I../ -Wall -Wextra -Wpedantic $(shell pkg-config --cflags lv2)
+LD_FLAGS ?= -lpthread
all: mapper_assert mapper_speed
mapper_assert: mapper_test.c ../mapper.lv2/mapper.h
- $(CC) -std=gnu11 -g -o $@ $< -I../ $(shell pkg-config --cflags lv2) -lpthread
+ $(CC) -std=c11 -g -o $@ $< $(C_FLAGS) $(LD_FLAGS)
mapper_speed: mapper_test.c ../mapper.lv2/mapper.h
- $(CC) -std=gnu11 -O3 -o $@ $< -I../ $(shell pkg-config --cflags lv2) -lpthread
+ $(CC) -std=c11 -O3 -o $@ $< $(C_FLAGS) $(LD_FLAGS)
test_assert: mapper_assert
./$< 1 0
@@ -25,3 +27,6 @@ test_speed: mapper_speed
./$< 32 1
test: test_assert test_speed
+
+clean:
+ rm -f mapper_assert mapper_speed
diff --git a/mapper.lv2/test/mapper_test.c b/mapper.lv2/test/mapper_test.c
index e605b077..212a5dc4 100644
--- a/mapper.lv2/test/mapper_test.c
+++ b/mapper.lv2/test/mapper_test.c
@@ -41,7 +41,7 @@ struct _rtmem_slot_t {
struct _rtmem_t {
atomic_uint nalloc; // counts number of allocations
atomic_uint nfree; // counts number of frees
- rtmem_slot_t slots [0]; // contains slots as multiple of MAX_ITEMS
+ rtmem_slot_t slots []; // contains slots as multiple of MAX_ITEMS
};
// dummy non-rt memory structure
@@ -79,6 +79,7 @@ static char *
_rtmem_alloc(void *data, size_t size)
{
rtmem_t *rtmem = data;
+ (void)size;
// dummily just take the next slot according to allocation counter
const uint32_t nalloc = atomic_fetch_add_explicit(&rtmem->nalloc, 1, memory_order_relaxed);