sane.ds: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7d550de263
commit
4e18649c48
|
@ -174,7 +174,7 @@ static TW_UINT16 TWAIN_GetSupportedCaps(pTW_CAPABILITY pCapability)
|
|||
TW_UINT32 i;
|
||||
a = GlobalLock (pCapability->hContainer);
|
||||
a->ItemType = TWTY_UINT16;
|
||||
a->NumItems = sizeof(supported_caps) / sizeof(supported_caps[0]);
|
||||
a->NumItems = ARRAY_SIZE(supported_caps);
|
||||
u = (UINT16 *) a->ItemList;
|
||||
for (i = 0; i < a->NumItems; i++)
|
||||
u[i] = supported_caps[i];
|
||||
|
@ -203,7 +203,7 @@ static TW_UINT16 SANE_ICAPXferMech (pTW_CAPABILITY pCapability, TW_UINT16 action
|
|||
break;
|
||||
|
||||
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);
|
||||
break;
|
||||
|
||||
|
@ -482,7 +482,7 @@ static TW_UINT16 SANE_ICAPBitDepth(pTW_CAPABILITY pCapability, TW_UINT16 action)
|
|||
break;
|
||||
|
||||
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);
|
||||
break;
|
||||
|
||||
|
@ -536,7 +536,7 @@ static TW_UINT16 SANE_ICAPCompression (pTW_CAPABILITY pCapability, TW_UINT16 act
|
|||
break;
|
||||
|
||||
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);
|
||||
FIXME("Partial stub: We don't attempt to support compression\n");
|
||||
break;
|
||||
|
@ -731,7 +731,7 @@ static TW_UINT16 SANE_ICAPPixelFlavor (pTW_CAPABILITY pCapability, TW_UINT16 act
|
|||
break;
|
||||
|
||||
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);
|
||||
break;
|
||||
|
||||
|
@ -935,9 +935,9 @@ static TW_UINT16 SANE_ICAPSupportedSizes (pTW_CAPABILITY pCapability, TW_UINT16
|
|||
break;
|
||||
|
||||
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;
|
||||
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);
|
||||
WARN("Partial Stub: our supported size selection is a bit thin.\n");
|
||||
break;
|
||||
|
|
|
@ -639,7 +639,7 @@ static void UpdateRelevantEdit(HWND hwnd, const SANE_Option_Descriptor *opt,
|
|||
else return;
|
||||
|
||||
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);
|
||||
if (edit_w) SetWindowTextW(edit_w,buffer);
|
||||
|
|
Loading…
Reference in New Issue