Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
e011370f
Commit
e011370f
authored
Aug 21, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxdiag: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
77ad8a47
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
information.c
programs/dxdiag/information.c
+3
-3
main.c
programs/dxdiag/main.c
+5
-5
output.c
programs/dxdiag/output.c
+4
-4
No files found.
programs/dxdiag/information.c
View file @
e011370f
...
...
@@ -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
;
...
...
programs/dxdiag/main.c
View file @
e011370f
...
...
@@ -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
))
...
...
programs/dxdiag/output.c
View file @
e011370f
...
...
@@ -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
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment