X-Git-Url: http://git.pond.sub.org/?p=empserver;a=blobdiff_plain;f=src%2Flib%2Fcommon%2Ffiletable.c;h=bb123c3c369083492e559f3a6b7cc84165e40020;hp=fd9fd39e423449bde15d47c78079e36222444c2c;hb=d1b844c6eb1ed7a25652d1fccb0de96e6aa2d5d3;hpb=c506cd7ed29b10739725275972c68f04c3aa87d8 diff --git a/src/lib/common/filetable.c b/src/lib/common/filetable.c index fd9fd39e4..bb123c3c3 100644 --- a/src/lib/common/filetable.c +++ b/src/lib/common/filetable.c @@ -27,7 +27,7 @@ * filetable.c: Empire game data file descriptions. * * Known contributors to this file: - * Markus Armbruster, 2005-2016 + * Markus Armbruster, 2005-2020 */ #include @@ -70,9 +70,6 @@ static void nchr_oninit(void *); static char dummy_cache; -/* Number of elements in ARRAY. */ -#define SZ(array) (sizeof(array) / sizeof((array)[0])) - /* Initializers for members flags... */ /* Unmapped cache */ #define UNMAPPED_CACHE(type, nent, flags) \ @@ -84,7 +81,7 @@ static char dummy_cache; */ #define ARRAY_CACHE(array, flags) \ sizeof(*(array)), -1, (flags), (char *)(array), \ - SZ((array)), 0, 0, 0, -1 + ARRAY_SIZE((array)), 0, 0, 0, -1 /* * Mapped cache, array with unknown size. * Member csize gets a bogus value, needs to be fixed up. @@ -98,7 +95,7 @@ static char dummy_cache; */ #define ARRAY_TABLE(array, nent, flags) \ sizeof(*(array)), (nent), (flags), (char *)(array), \ - SZ((array)), 0, (nent), (nent), -1 + ARRAY_SIZE((array)), 0, (nent), (nent), -1 /* Common configuration table flags */ #define EFF_CFG (EFF_PRIVATE | EFF_MEM | EFF_STATIC | EFF_SENTINEL)