From e9d844f2ffbfee364415d0f6cf87715bc16c1068 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Mon, 22 Oct 2018 22:39:02 +0200 Subject: [PATCH] winedump: Use the ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc Signed-off-by: Alexandre Julliard --- tools/winedump/lib.c | 4 ++-- tools/winedump/pe.c | 2 +- tools/winedump/tlb.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/winedump/lib.c b/tools/winedump/lib.c index f593515d683..5a7c33aa8b8 100644 --- a/tools/winedump/lib.c +++ b/tools/winedump/lib.c @@ -68,8 +68,8 @@ static void dump_import_object(const IMPORT_OBJECT_HEADER *ioh) name = (const char *)ioh + sizeof(*ioh); printf(" DLL name : %s\n", name + strlen(name) + 1); printf(" Symbol name : %s\n", name); - printf(" Type : %s\n", (ioh->Type < sizeof(obj_type)/sizeof(obj_type[0])) ? obj_type[ioh->Type] : "unknown"); - printf(" Name type : %s\n", (ioh->NameType < sizeof(name_type)/sizeof(name_type[0])) ? name_type[ioh->NameType] : "unknown"); + printf(" Type : %s\n", (ioh->Type < ARRAY_SIZE(obj_type)) ? obj_type[ioh->Type] : "unknown"); + printf(" Name type : %s\n", (ioh->NameType < ARRAY_SIZE(name_type)) ? name_type[ioh->NameType] : "unknown"); printf(" %-13s: %u\n", (ioh->NameType == IMPORT_OBJECT_ORDINAL) ? "Ordinal" : "Hint", ioh->u.Ordinal); printf("\n"); } diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index 7bbb576104b..ca41bb7439e 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -1654,7 +1654,7 @@ static const char *get_resource_type( unsigned int id ) "RT_MANIFEST" }; - if ((size_t)id < sizeof(types)/sizeof(types[0])) return types[id]; + if ((size_t)id < ARRAY_SIZE(types)) return types[id]; return NULL; } diff --git a/tools/winedump/tlb.c b/tools/winedump/tlb.c index bed53933be6..c55c6a9f23b 100644 --- a/tools/winedump/tlb.c +++ b/tools/winedump/tlb.c @@ -1000,7 +1000,7 @@ static void dump_msft_segdir(void) print_begin_block("SegDir"); - for(i=0; i < sizeof(segdir)/sizeof(segdir[0]); i++) + for(i=0; i < ARRAY_SIZE(segdir); i++) dump_msft_seg(segdir+i); print_end_block(); @@ -1010,7 +1010,7 @@ static BOOL dump_offset(void) { int i; - for(i=0; i < sizeof(segdir)/sizeof(segdir[0]); i++) + for(i=0; i < ARRAY_SIZE(segdir); i++) if(segdir[i].offset == offset) return segdir[i].func(segdir+i);