Signed-off-by: Michael Stefaniuc mstefani@winehq.org --- dlls/sane.ds/capability.c | 14 +++++++------- dlls/sane.ds/ui.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/sane.ds/capability.c b/dlls/sane.ds/capability.c index 094bb93452..9157cae596 100644 --- a/dlls/sane.ds/capability.c +++ b/dlls/sane.ds/capability.c @@ -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; diff --git a/dlls/sane.ds/ui.c b/dlls/sane.ds/ui.c index fe1988a88a..23c38f31dc 100644 --- a/dlls/sane.ds/ui.c +++ b/dlls/sane.ds/ui.c @@ -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);