mirror of
https://github.com/wine-mirror/wine
synced 2024-07-08 20:06:18 +00:00
net: 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
7487e5f4e8
commit
beb464358e
|
@ -61,8 +61,7 @@ static int output_vprintf(const WCHAR* fmt, __ms_va_list va_args)
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
SetLastError(NO_ERROR);
|
SetLastError(NO_ERROR);
|
||||||
len = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, fmt, 0, 0, str,
|
len = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, fmt, 0, 0, str, ARRAY_SIZE(str), &va_args);
|
||||||
sizeof(str)/sizeof(*str), &va_args);
|
|
||||||
if (len == 0 && GetLastError() != NO_ERROR)
|
if (len == 0 && GetLastError() != NO_ERROR)
|
||||||
WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_w(fmt));
|
WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_w(fmt));
|
||||||
else
|
else
|
||||||
|
@ -85,7 +84,7 @@ static int WINAPIV output_string(int msg, ...)
|
||||||
WCHAR fmt[8192];
|
WCHAR fmt[8192];
|
||||||
__ms_va_list arguments;
|
__ms_va_list arguments;
|
||||||
|
|
||||||
LoadStringW(GetModuleHandleW(NULL), msg, fmt, sizeof(fmt)/sizeof(fmt[0]));
|
LoadStringW(GetModuleHandleW(NULL), msg, fmt, ARRAY_SIZE(fmt));
|
||||||
__ms_va_start(arguments, msg);
|
__ms_va_start(arguments, msg);
|
||||||
output_vprintf(fmt, arguments);
|
output_vprintf(fmt, arguments);
|
||||||
__ms_va_end(arguments);
|
__ms_va_end(arguments);
|
||||||
|
@ -119,7 +118,7 @@ static BOOL net_use(int argc, const WCHAR* argv[])
|
||||||
HMODULE hmod = GetModuleHandleW(NULL);
|
HMODULE hmod = GetModuleHandleW(NULL);
|
||||||
|
|
||||||
/* Load the status strings */
|
/* Load the status strings */
|
||||||
for (i = 0; i < sizeof(status)/sizeof(*status); i++)
|
for (i = 0; i < ARRAY_SIZE(status); i++)
|
||||||
{
|
{
|
||||||
status[i] = HeapAlloc(GetProcessHeap(), 0, 1024 * sizeof(**status));
|
status[i] = HeapAlloc(GetProcessHeap(), 0, 1024 * sizeof(**status));
|
||||||
LoadStringW(hmod, STRING_OK+i, status[i], 1024);
|
LoadStringW(hmod, STRING_OK+i, status[i], 1024);
|
||||||
|
@ -147,7 +146,7 @@ static BOOL net_use(int argc, const WCHAR* argv[])
|
||||||
} while (rc == ERROR_MORE_DATA);
|
} while (rc == ERROR_MORE_DATA);
|
||||||
|
|
||||||
/* Release the status strings */
|
/* Release the status strings */
|
||||||
for (i = 0; i < sizeof(status)/sizeof(*status); i++)
|
for (i = 0; i < ARRAY_SIZE(status); i++)
|
||||||
HeapFree(GetProcessHeap(), 0, status[i]);
|
HeapFree(GetProcessHeap(), 0, status[i]);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -256,7 +255,7 @@ static BOOL net_service(int operation, const WCHAR* service_name)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_size = sizeof(service_display_name)/sizeof(*service_display_name);
|
buffer_size = ARRAY_SIZE(service_display_name);
|
||||||
GetServiceDisplayNameW(SCManager, service_name, service_display_name, &buffer_size);
|
GetServiceDisplayNameW(SCManager, service_name, service_display_name, &buffer_size);
|
||||||
if (!service_display_name[0]) lstrcpyW(service_display_name, service_name);
|
if (!service_display_name[0]) lstrcpyW(service_display_name, service_name);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user