Commit 4c288720 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dxerr8: Use the ARRAY_SIZE() macro.

parent 10662838
......@@ -51,7 +51,7 @@ const char * WINAPI DXGetErrorString8A(HRESULT hr)
{
unsigned int i, j, k = 0;
for (i = sizeof(info)/sizeof(info[0]); i != 0; i /= 2) {
for (i = ARRAY_SIZE(info); i != 0; i /= 2) {
j = k + (i / 2);
if (hr == info[j].hr)
return info[j].resultA;
......@@ -69,7 +69,7 @@ const WCHAR * WINAPI DXGetErrorString8W(HRESULT hr)
static const WCHAR unknown[] = { 'U', 'n', 'k', 'n', 'o', 'w', 'n', 0 };
unsigned int i, j, k = 0;
for (i = sizeof(info)/sizeof(info[0]); i != 0; i /= 2) {
for (i = ARRAY_SIZE(info); i != 0; i /= 2) {
j = k + (i / 2);
if (hr == info[j].hr)
return info[j].resultW;
......@@ -86,7 +86,7 @@ const char * WINAPI DXGetErrorDescription8A(HRESULT hr)
{
unsigned int i, j, k = 0;
for (i = sizeof(info)/sizeof(info[0]); i != 0; i /= 2) {
for (i = ARRAY_SIZE(info); i != 0; i /= 2) {
j = k + (i / 2);
if (hr == info[j].hr)
return info[j].descriptionA;
......@@ -104,7 +104,7 @@ const WCHAR * WINAPI DXGetErrorDescription8W(HRESULT hr)
static const WCHAR na[] = { 'n', '/', 'a', 0 };
unsigned int i, j, k = 0;
for (i = sizeof(info)/sizeof(info[0]); i != 0; i /= 2) {
for (i = ARRAY_SIZE(info); i != 0; i /= 2) {
j = k + (i / 2);
if (hr == info[j].hr)
return info[j].descriptionW;
......
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