Commit 93acf3a6 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

libs/wine: Use the ARRAY_SIZE() macro.

parent af399237
......@@ -144,7 +144,7 @@ static void parse_options( const char *str )
if (p > opt)
{
for (i = 0; i < sizeof(debug_classes)/sizeof(debug_classes[0]); i++)
for (i = 0; i < ARRAY_SIZE(debug_classes); i++)
{
int len = strlen(debug_classes[i]);
if (len != (p - opt)) continue;
......@@ -155,7 +155,7 @@ static void parse_options( const char *str )
break;
}
}
if (i == sizeof(debug_classes)/sizeof(debug_classes[0])) /* bad class name, skip it */
if (i == ARRAY_SIZE(debug_classes)) /* bad class name, skip it */
continue;
}
else
......@@ -268,7 +268,7 @@ static char *get_temp_buffer( size_t size )
char *ret;
int idx;
idx = interlocked_xchg_add( &pos, 1 ) % (sizeof(list)/sizeof(list[0]));
idx = interlocked_xchg_add( &pos, 1 ) % ARRAY_SIZE(list);
if ((ret = realloc( list[idx], size ))) list[idx] = ret;
return ret;
}
......@@ -411,7 +411,7 @@ static int default_dbg_vlog( enum __wine_debug_class cls, struct __wine_debug_ch
ret += wine_dbg_printf( "%04x:", GetCurrentProcessId() );
ret += wine_dbg_printf( "%04x:", GetCurrentThreadId() );
#endif
if (cls < sizeof(debug_classes)/sizeof(debug_classes[0]))
if (cls < ARRAY_SIZE(debug_classes))
ret += wine_dbg_printf( "%s:%s:%s ", debug_classes[cls], channel->name, func );
if (format)
ret += funcs.dbg_vprintf( format, args );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment