Signed-off-by: Michael Stefaniuc mstefani@winehq.org --- programs/dxdiag/information.c | 6 +++--- programs/dxdiag/main.c | 10 +++++----- programs/dxdiag/output.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/programs/dxdiag/information.c b/programs/dxdiag/information.c index 5cc862be63..ec2b2b5b0e 100644 --- a/programs/dxdiag/information.c +++ b/programs/dxdiag/information.c @@ -156,7 +156,7 @@ static BOOL fill_system_information(IDxDiagContainer *container, struct dxdiag_i
fill_system_property_list(dxdiag_info, property_list);
- for (i = 0; i < sizeof(property_list)/sizeof(property_list[0]); i++) + for (i = 0; i < ARRAY_SIZE(property_list); i++) { if (!property_to_string(container, property_list[i].property_name, property_list[i].output)) { @@ -193,7 +193,7 @@ void free_dxdiag_information(struct dxdiag_information *system_info) if (!system_info) return;
- for (i = 0; i < sizeof(filler_list)/sizeof(filler_list[0]); i++) + for (i = 0; i < ARRAY_SIZE(filler_list); i++) filler_list[i].free_function(system_info);
HeapFree(GetProcessHeap(), 0, system_info); @@ -230,7 +230,7 @@ struct dxdiag_information *collect_dxdiag_information(BOOL whql_check) if (!ret) goto error;
- for (i = 0; i < sizeof(filler_list)/sizeof(filler_list[0]); i++) + for (i = 0; i < ARRAY_SIZE(filler_list); i++) { IDxDiagContainer *child; BOOL success; diff --git a/programs/dxdiag/main.c b/programs/dxdiag/main.c index d7d430b570..b073674ca1 100644 --- a/programs/dxdiag/main.c +++ b/programs/dxdiag/main.c @@ -43,8 +43,8 @@ static void usage(void) WCHAR title[MAX_STRING_LEN]; WCHAR usage[MAX_STRING_LEN];
- LoadStringW(hInstance, STRING_DXDIAG_TOOL, title, sizeof(title)/sizeof(WCHAR)); - LoadStringW(hInstance, STRING_USAGE, usage, sizeof(usage)/sizeof(WCHAR)); + LoadStringW(hInstance, STRING_DXDIAG_TOOL, title, ARRAY_SIZE(title)); + LoadStringW(hInstance, STRING_USAGE, usage, ARRAY_SIZE(usage));
MessageBoxW(NULL, usage, title, MB_OK | MB_ICONWARNING);
@@ -126,7 +126,7 @@ static BOOL process_command_line(const WCHAR *cmdline, struct command_line_info { info->output_type = OUTPUT_TEXT; return process_file_name(cmdline, OUTPUT_TEXT, info->outfile, - sizeof(info->outfile)/sizeof(WCHAR)); + ARRAY_SIZE(info->outfile)); }
cmdline++; @@ -137,12 +137,12 @@ static BOOL process_command_line(const WCHAR *cmdline, struct command_line_info case 't': info->output_type = OUTPUT_TEXT; return process_file_name(cmdline + 1, OUTPUT_TEXT, info->outfile, - sizeof(info->outfile)/sizeof(WCHAR)); + ARRAY_SIZE(info->outfile)); case 'X': case 'x': info->output_type = OUTPUT_XML; return process_file_name(cmdline + 1, OUTPUT_XML, info->outfile, - sizeof(info->outfile)/sizeof(WCHAR)); + ARRAY_SIZE(info->outfile)); case 'W': case 'w': if (strncmpiW(cmdline, whql_colonW, 5)) diff --git a/programs/dxdiag/output.c b/programs/dxdiag/output.c index c18c75d183..b1e0f188ee 100644 --- a/programs/dxdiag/output.c +++ b/programs/dxdiag/output.c @@ -179,7 +179,7 @@ static BOOL output_text_information(struct dxdiag_information *dxdiag_info, cons return FALSE; }
- for (i = 0; i < sizeof(output_table)/sizeof(output_table[0]); i++) + for (i = 0; i < ARRAY_SIZE(output_table); i++) { const struct text_information_field *fields = output_table[i].fields; unsigned int j; @@ -313,7 +313,7 @@ static BOOL output_xml_information(struct dxdiag_information *dxdiag_info, const if (FAILED(hr)) goto error;
- for (i = 0; i < sizeof(output_table)/sizeof(output_table[0]); i++) + for (i = 0; i < ARRAY_SIZE(output_table); i++) { IXMLDOMElement *info_element = xml_create_element(xmldoc, output_table[i].tag_name); const struct xml_information_field *fields = output_table[i].fields; @@ -394,14 +394,14 @@ static struct output_backend
const WCHAR *get_output_extension(enum output_type type) { - assert(type > OUTPUT_NONE && type <= sizeof(output_backends)/sizeof(output_backends[0])); + assert(type > OUTPUT_NONE && type <= ARRAY_SIZE(output_backends));
return output_backends[type - 1].filename_ext; }
BOOL output_dxdiag_information(struct dxdiag_information *dxdiag_info, const WCHAR *filename, enum output_type type) { - assert(type > OUTPUT_NONE && type <= sizeof(output_backends)/sizeof(output_backends[0])); + assert(type > OUTPUT_NONE && type <= ARRAY_SIZE(output_backends));
return output_backends[type - 1].output_handler(dxdiag_info, filename); }