From f002aec139f1cc8b36232806d7de195156fe53aa Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Tue, 10 Jul 2018 08:31:50 +0100 Subject: [PATCH] riched20: Avoid an ARRAY_SIZE-like macro. Signed-off-by: Michael Stefaniuc Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/riched20/reader.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dlls/riched20/reader.c b/dlls/riched20/reader.c index 03101090b3e..339ca049491 100644 --- a/dlls/riched20/reader.c +++ b/dlls/riched20/reader.c @@ -2175,14 +2175,13 @@ static RTFKey rtfKey[] = { 0, -1, NULL, 0 } }; -#define RTF_KEY_COUNT (sizeof(rtfKey) / sizeof(RTFKey)) typedef struct tagRTFHashTableEntry { int count; RTFKey **value; } RTFHashTableEntry; -static RTFHashTableEntry rtfHashTable[RTF_KEY_COUNT * 2]; +static RTFHashTableEntry rtfHashTable[ARRAY_SIZE(rtfKey) * 2]; /* @@ -2199,7 +2198,7 @@ void LookupInit(void) int index; rp->rtfKHash = Hash (rp->rtfKStr); - index = rp->rtfKHash % (RTF_KEY_COUNT * 2); + index = rp->rtfKHash % (ARRAY_SIZE(rtfKey) * 2); if (!rtfHashTable[index].count) rtfHashTable[index].value = heap_alloc(sizeof(RTFKey *)); else @@ -2212,7 +2211,7 @@ void LookupCleanup(void) { unsigned int i; - for (i=0; icount; i++) { rp = entry->value[i];