winedump: Use the ARRAY_SIZE() macro.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Michael Stefaniuc 2018-10-22 22:39:02 +02:00 committed by Alexandre Julliard
parent 7ef66068f2
commit e9d844f2ff
3 changed files with 5 additions and 5 deletions

View File

@ -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");
}

View File

@ -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;
}

View File

@ -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);