From fcfe59c1f2219408ac2a9cd84b386816ff252221 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 11 Jun 2022 16:37:09 +0200 Subject: Fix warnings, replace some static inline with inline + extern inline, and fix glibc support --- memsetelem.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'memsetelem.c') diff --git a/memsetelem.c b/memsetelem.c index 6bcf021..32c3f74 100644 --- a/memsetelem.c +++ b/memsetelem.c @@ -17,22 +17,22 @@ main(void) size_t i; memset(p, 0, sizeof(p_)); - assert(libsimple_memsetelem(p, &(uint64_t){~0}, 0, 0) == p); - assert(libsimple_memsetelem(p, &(uint64_t){~0}, 0, 10) == p); - assert(libsimple_memsetelem(p, &(uint64_t){~0}, 1, 0) == p); - assert(libsimple_memsetelem(p, &(uint64_t){~0}, 2, 0) == p); - assert(libsimple_memsetelem(p, &(uint64_t){~0}, 4, 0) == p); - assert(libsimple_memsetelem(p, &(uint64_t){~0}, 8, 0) == p); - assert(libsimple_memsetelem(p, &(uint64_t){~0}, 16, 0) == p); - assert(libsimple_memsetelem(p, &(uint64_t){~0}, 3, 0) == p); + assert(libsimple_memsetelem(p, &(uint64_t){~(uint64_t)0}, 0, 0) == p); + assert(libsimple_memsetelem(p, &(uint64_t){~(uint64_t)0}, 0, 10) == p); + assert(libsimple_memsetelem(p, &(uint64_t){~(uint64_t)0}, 1, 0) == p); + assert(libsimple_memsetelem(p, &(uint64_t){~(uint64_t)0}, 2, 0) == p); + assert(libsimple_memsetelem(p, &(uint64_t){~(uint64_t)0}, 4, 0) == p); + assert(libsimple_memsetelem(p, &(uint64_t){~(uint64_t)0}, 8, 0) == p); + assert(libsimple_memsetelem(p, &(uint64_t){~(uint64_t)0}, 16, 0) == p); + assert(libsimple_memsetelem(p, &(uint64_t){~(uint64_t)0}, 3, 0) == p); assert(libsimple_memsetelem(p, &(uint8_t){0x09}, 1, 3000) == p); assert(libsimple_memsetelem(p, &(uint16_t){0x0807}, 2, 1000) == p); assert(libsimple_memsetelem(p, &(uint32_t){0x10203040UL}, 4, 300) == p); assert(libsimple_memsetelem(p, &(uint64_t){0x0102030450607080ULL}, 8, 100) == p); - assert(libsimple_memsetelem(p, (char []){0xA0, 0xB0, 0xC0}, 3, 16) == p); + assert(libsimple_memsetelem(p, (char []){(char)0xA0, (char)0xB0, (char)0xC0}, 3, 16) == p); for (i = 0; i < 48; i++) - assert(p[i] == ((char []){0xA0, 0xB0, 0xC0})[i % 3]); + assert(p[i] == ((char []){(char)0xA0, (char)0xB0, (char)0xC0})[i % 3]); for (; i < 800; i += 8) assert(*(uint64_t *)&p[i] == 0x0102030450607080ULL); for (; i < 1200; i += 4) -- cgit v1.2.3-70-g09d2