From f4b596a283f7054f58c9ca65154964a50edf3365 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Thu, 29 Dec 2016 13:10:15 +1000 Subject: [PATCH] * drop bitmap_t typedef --- src/bitmap.h | 2 -- tests/bitmap.c | 29 ++++++++++++++--------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/bitmap.h b/src/bitmap.h index 36995f9..85c32b8 100644 --- a/src/bitmap.h +++ b/src/bitmap.h @@ -8,8 +8,6 @@ #define CHAR_USED '@' #define CHAR_NONE '-' -typedef unsigned char bitmap_t[BITMAP_SIZE]; - int bitmap_compare(const unsigned char *a, const unsigned char *b); diff --git a/tests/bitmap.c b/tests/bitmap.c index 9000744..82edd5f 100644 --- a/tests/bitmap.c +++ b/tests/bitmap.c @@ -2,32 +2,31 @@ #include "../src/bitmap.h" int -main() -{ - bitmap_t a, b; +main() { + unsigned char a[BITMAP_SIZE], b[BITMAP_SIZE]; - memset (a, 0x00, sizeof(bitmap_t)); - memset (b, 0x00, sizeof(bitmap_t)); + memset (a, 0x00, sizeof(a)); + memset (b, 0x00, sizeof(b)); assert(bitmap_compare(a, b) == 0); - memset (a, 0xFE, sizeof(bitmap_t)); - memset (b, 0xFF, sizeof(bitmap_t)); + memset (a, 0xFE, sizeof(a)); + memset (b, 0xFF, sizeof(b)); assert(bitmap_compare(a, b) == 32); - memset (a, 0x00, sizeof(bitmap_t)); - memset (b, 0x55, sizeof(bitmap_t)); + memset (a, 0x00, sizeof(a)); + memset (b, 0x55, sizeof(b)); assert(bitmap_compare(a, b) == 128); - memset (a, 0x00, sizeof(bitmap_t)); - memset (b, 0xAA, sizeof(bitmap_t)); + memset (a, 0x00, sizeof(a)); + memset (b, 0xAA, sizeof(b)); assert(bitmap_compare(a, b) == 128); - memset (a, 0xAA, sizeof(bitmap_t)); - memset (b, 0x55, sizeof(bitmap_t)); + memset (a, 0xAA, sizeof(a)); + memset (b, 0x55, sizeof(b)); assert(bitmap_compare(a, b) == 256); - memset (a, 0x00, sizeof(bitmap_t)); - memset (b, 0xFF, sizeof(bitmap_t)); + memset (a, 0x00, sizeof(a)); + memset (b, 0xFF, sizeof(b)); assert(bitmap_compare(a, b) == 256); return 0;