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

sane.ds: Use the ARRAY_SIZE() macro.

parent 7d550de2
...@@ -174,7 +174,7 @@ static TW_UINT16 TWAIN_GetSupportedCaps(pTW_CAPABILITY pCapability) ...@@ -174,7 +174,7 @@ static TW_UINT16 TWAIN_GetSupportedCaps(pTW_CAPABILITY pCapability)
TW_UINT32 i; TW_UINT32 i;
a = GlobalLock (pCapability->hContainer); a = GlobalLock (pCapability->hContainer);
a->ItemType = TWTY_UINT16; a->ItemType = TWTY_UINT16;
a->NumItems = sizeof(supported_caps) / sizeof(supported_caps[0]); a->NumItems = ARRAY_SIZE(supported_caps);
u = (UINT16 *) a->ItemList; u = (UINT16 *) a->ItemList;
for (i = 0; i < a->NumItems; i++) for (i = 0; i < a->NumItems; i++)
u[i] = supported_caps[i]; u[i] = supported_caps[i];
...@@ -203,7 +203,7 @@ static TW_UINT16 SANE_ICAPXferMech (pTW_CAPABILITY pCapability, TW_UINT16 action ...@@ -203,7 +203,7 @@ static TW_UINT16 SANE_ICAPXferMech (pTW_CAPABILITY pCapability, TW_UINT16 action
break; break;
case MSG_GET: case MSG_GET:
twCC = msg_get_enum(pCapability, possible_values, sizeof(possible_values) / sizeof(possible_values[0]), twCC = msg_get_enum(pCapability, possible_values, ARRAY_SIZE(possible_values),
TWTY_UINT16, activeDS.capXferMech, TWSX_NATIVE); TWTY_UINT16, activeDS.capXferMech, TWSX_NATIVE);
break; break;
...@@ -482,7 +482,7 @@ static TW_UINT16 SANE_ICAPBitDepth(pTW_CAPABILITY pCapability, TW_UINT16 action) ...@@ -482,7 +482,7 @@ static TW_UINT16 SANE_ICAPBitDepth(pTW_CAPABILITY pCapability, TW_UINT16 action)
break; break;
case MSG_GET: case MSG_GET:
twCC = msg_get_enum(pCapability, possible_values, sizeof(possible_values) / sizeof(possible_values[0]), twCC = msg_get_enum(pCapability, possible_values, ARRAY_SIZE(possible_values),
TWTY_UINT16, activeDS.sane_param.depth, activeDS.sane_param.depth); TWTY_UINT16, activeDS.sane_param.depth, activeDS.sane_param.depth);
break; break;
...@@ -536,7 +536,7 @@ static TW_UINT16 SANE_ICAPCompression (pTW_CAPABILITY pCapability, TW_UINT16 act ...@@ -536,7 +536,7 @@ static TW_UINT16 SANE_ICAPCompression (pTW_CAPABILITY pCapability, TW_UINT16 act
break; break;
case MSG_GET: case MSG_GET:
twCC = msg_get_enum(pCapability, possible_values, sizeof(possible_values) / sizeof(possible_values[0]), twCC = msg_get_enum(pCapability, possible_values, ARRAY_SIZE(possible_values),
TWTY_UINT16, TWCP_NONE, TWCP_NONE); TWTY_UINT16, TWCP_NONE, TWCP_NONE);
FIXME("Partial stub: We don't attempt to support compression\n"); FIXME("Partial stub: We don't attempt to support compression\n");
break; break;
...@@ -731,7 +731,7 @@ static TW_UINT16 SANE_ICAPPixelFlavor (pTW_CAPABILITY pCapability, TW_UINT16 act ...@@ -731,7 +731,7 @@ static TW_UINT16 SANE_ICAPPixelFlavor (pTW_CAPABILITY pCapability, TW_UINT16 act
break; break;
case MSG_GET: case MSG_GET:
twCC = msg_get_enum(pCapability, possible_values, sizeof(possible_values) / sizeof(possible_values[0]), twCC = msg_get_enum(pCapability, possible_values, ARRAY_SIZE(possible_values),
TWTY_UINT16, flavor, flavor); TWTY_UINT16, flavor, flavor);
break; break;
...@@ -935,9 +935,9 @@ static TW_UINT16 SANE_ICAPSupportedSizes (pTW_CAPABILITY pCapability, TW_UINT16 ...@@ -935,9 +935,9 @@ static TW_UINT16 SANE_ICAPSupportedSizes (pTW_CAPABILITY pCapability, TW_UINT16
break; break;
case MSG_GET: case MSG_GET:
for (i = 0; i < sizeof(supported_sizes) / sizeof(supported_sizes[0]); i++) for (i = 0; i < ARRAY_SIZE(supported_sizes); i++)
possible_values[i] = supported_sizes[i].size; possible_values[i] = supported_sizes[i].size;
twCC = msg_get_enum(pCapability, possible_values, sizeof(possible_values) / sizeof(possible_values[0]), twCC = msg_get_enum(pCapability, possible_values, ARRAY_SIZE(possible_values),
TWTY_UINT16, current_size, default_size); TWTY_UINT16, current_size, default_size);
WARN("Partial Stub: our supported size selection is a bit thin.\n"); WARN("Partial Stub: our supported size selection is a bit thin.\n");
break; break;
......
...@@ -639,7 +639,7 @@ static void UpdateRelevantEdit(HWND hwnd, const SANE_Option_Descriptor *opt, ...@@ -639,7 +639,7 @@ static void UpdateRelevantEdit(HWND hwnd, const SANE_Option_Descriptor *opt,
else return; else return;
buffer[len++] = ' '; buffer[len++] = ' ';
LoadStringW( SANE_instance, opt->unit, buffer + len, sizeof(buffer)/sizeof(WCHAR) - len ); LoadStringW( SANE_instance, opt->unit, buffer + len, ARRAY_SIZE( buffer ) - len );
edit_w = GetDlgItem(hwnd,index+ID_BASE+ID_EDIT_BASE); edit_w = GetDlgItem(hwnd,index+ID_BASE+ID_EDIT_BASE);
if (edit_w) SetWindowTextW(edit_w,buffer); if (edit_w) SetWindowTextW(edit_w,buffer);
......
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