From 87b46fe2844bb00f27269dc387edd889698bf065 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sat, 18 Feb 2017 18:55:08 +0100 Subject: [PATCH] Fix issue with tgen-marray --- tests/Makefile | 4 ++-- tests/{tgen-mvector.c => tgen-marray.c} | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) rename tests/{tgen-mvector.c => tgen-marray.c} (88%) diff --git a/tests/Makefile b/tests/Makefile index 7c5aa0c2..301448c7 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -53,10 +53,10 @@ bitset: $(CC) $(CFLAGS) $(CPPFLAGS) -g $(COVERAGE_CFLAGS) test-mbitset.c -lgmp -o $(EXE) && $(VALGRIND) $(EXE) gene-list: - $(CC) $(CFLAGS) $(CPPFLAGS)-O3 -DNDEBUG -S tgen-mlist.c && less tgen-mlist.s + $(CC) $(CFLAGS) $(CPPFLAGS) -O3 -DNDEBUG -S tgen-mlist.c && less tgen-mlist.s gene-array: - $(CC) $(CFLAGS) $(CPPFLAGS)-O3 -DNDEBUG -S tgen-marray.c && less tgen-marray.s + $(CC) $(CFLAGS) $(CPPFLAGS) -O3 -DNDEBUG -S tgen-marray.c && less tgen-marray.s clean: $(RM) $(EXE) *.s *~ *.o ./a.dat diff --git a/tests/tgen-mvector.c b/tests/tgen-marray.c similarity index 88% rename from tests/tgen-mvector.c rename to tests/tgen-marray.c index df8f2932..c6cd7a8f 100644 --- a/tests/tgen-mvector.c +++ b/tests/tgen-marray.c @@ -23,11 +23,14 @@ #include "m-array.h" -ARRAY_DEF(unsigned int, uint) +ARRAY_DEF(uint, unsigned int) + +unsigned int add_two(const array_uint_t tab, size_t i, size_t j); +void size_to_exactly(array_uint_t tab, size_t n); unsigned int add_two(const array_uint_t tab, size_t i, size_t j) { - return *array_uint_cref(tab, i) + *array_uint_cref(tab, j); + return *array_uint_cget(tab, i) + *array_uint_cget(tab, j); } void size_to_exactly(array_uint_t tab, size_t n)