forked from Mirrors/wine-wine
user32: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>oldstable
parent
7ddbec0ecc
commit
b2fc591748
|
@ -57,7 +57,7 @@ static HMODULE load_desktop_driver( HWND hwnd )
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
DWORD size;
|
DWORD size;
|
||||||
WCHAR path[MAX_PATH];
|
WCHAR path[MAX_PATH];
|
||||||
WCHAR key[(sizeof(key_pathW) + sizeof(displayW)) / sizeof(WCHAR) + 40];
|
WCHAR key[ARRAY_SIZE(key_pathW) + ARRAY_SIZE(displayW) + 40];
|
||||||
UINT guid_atom = HandleToULong( GetPropW( hwnd, display_device_guid_propW ));
|
UINT guid_atom = HandleToULong( GetPropW( hwnd, display_device_guid_propW ));
|
||||||
|
|
||||||
USER_CheckNotLock();
|
USER_CheckNotLock();
|
||||||
|
|
|
@ -90,7 +90,7 @@ static BOOL ICONTITLE_SetTitlePos( HWND hwnd, HWND owner )
|
||||||
INT cx, cy;
|
INT cx, cy;
|
||||||
POINT pt;
|
POINT pt;
|
||||||
|
|
||||||
int length = GetWindowTextW( owner, str, sizeof(str)/sizeof(WCHAR) );
|
int length = GetWindowTextW( owner, str, ARRAY_SIZE( str ));
|
||||||
|
|
||||||
while (length && str[length - 1] == ' ') /* remove trailing spaces */
|
while (length && str[length - 1] == ' ') /* remove trailing spaces */
|
||||||
str[--length] = 0;
|
str[--length] = 0;
|
||||||
|
@ -178,7 +178,7 @@ static BOOL ICONTITLE_Paint( HWND hwnd, HWND owner, HDC hDC, BOOL bActive )
|
||||||
{
|
{
|
||||||
WCHAR buffer[80];
|
WCHAR buffer[80];
|
||||||
|
|
||||||
INT length = GetWindowTextW( owner, buffer, sizeof(buffer)/sizeof(buffer[0]) );
|
INT length = GetWindowTextW( owner, buffer, ARRAY_SIZE( buffer ));
|
||||||
SetTextColor( hDC, textColor );
|
SetTextColor( hDC, textColor );
|
||||||
SetBkMode( hDC, TRANSPARENT );
|
SetBkMode( hDC, TRANSPARENT );
|
||||||
|
|
||||||
|
|
|
@ -335,7 +335,7 @@ DWORD WINAPI CharLowerBuffA( LPSTR str, DWORD len )
|
||||||
if (!str) return 0; /* YES */
|
if (!str) return 0; /* YES */
|
||||||
|
|
||||||
lenW = MultiByteToWideChar(CP_ACP, 0, str, len, NULL, 0);
|
lenW = MultiByteToWideChar(CP_ACP, 0, str, len, NULL, 0);
|
||||||
if (lenW > sizeof(buffer)/sizeof(WCHAR))
|
if (lenW > ARRAY_SIZE(buffer))
|
||||||
{
|
{
|
||||||
strW = HeapAlloc(GetProcessHeap(), 0, lenW * sizeof(WCHAR));
|
strW = HeapAlloc(GetProcessHeap(), 0, lenW * sizeof(WCHAR));
|
||||||
if (!strW) return 0;
|
if (!strW) return 0;
|
||||||
|
@ -370,7 +370,7 @@ DWORD WINAPI CharUpperBuffA( LPSTR str, DWORD len )
|
||||||
if (!str) return 0; /* YES */
|
if (!str) return 0; /* YES */
|
||||||
|
|
||||||
lenW = MultiByteToWideChar(CP_ACP, 0, str, len, NULL, 0);
|
lenW = MultiByteToWideChar(CP_ACP, 0, str, len, NULL, 0);
|
||||||
if (lenW > sizeof(buffer)/sizeof(WCHAR))
|
if (lenW > ARRAY_SIZE(buffer))
|
||||||
{
|
{
|
||||||
strW = HeapAlloc(GetProcessHeap(), 0, lenW * sizeof(WCHAR));
|
strW = HeapAlloc(GetProcessHeap(), 0, lenW * sizeof(WCHAR));
|
||||||
if (!strW) return 0;
|
if (!strW) return 0;
|
||||||
|
|
|
@ -169,7 +169,7 @@ static const WCHAR *get_default_desktop(void)
|
||||||
static const WCHAR app_defaultsW[] = {'S','o','f','t','w','a','r','e','\\',
|
static const WCHAR app_defaultsW[] = {'S','o','f','t','w','a','r','e','\\',
|
||||||
'W','i','n','e','\\',
|
'W','i','n','e','\\',
|
||||||
'A','p','p','D','e','f','a','u','l','t','s',0};
|
'A','p','p','D','e','f','a','u','l','t','s',0};
|
||||||
static WCHAR buffer[MAX_PATH + sizeof(explorerW)/sizeof(WCHAR)];
|
static WCHAR buffer[MAX_PATH + ARRAY_SIZE(explorerW)];
|
||||||
WCHAR *p, *appname = buffer;
|
WCHAR *p, *appname = buffer;
|
||||||
const WCHAR *ret = defaultW;
|
const WCHAR *ret = defaultW;
|
||||||
DWORD len;
|
DWORD len;
|
||||||
|
@ -433,7 +433,7 @@ BOOL WINAPI ExitWindowsEx( UINT flags, DWORD reason )
|
||||||
STARTUPINFOW si;
|
STARTUPINFOW si;
|
||||||
void *redir;
|
void *redir;
|
||||||
|
|
||||||
GetSystemDirectoryW( app, MAX_PATH - sizeof(winebootW)/sizeof(WCHAR) );
|
GetSystemDirectoryW( app, MAX_PATH - ARRAY_SIZE( winebootW ));
|
||||||
strcatW( app, winebootW );
|
strcatW( app, winebootW );
|
||||||
strcpyW( cmdline, app );
|
strcpyW( cmdline, app );
|
||||||
|
|
||||||
|
|
|
@ -2049,8 +2049,8 @@ HWND WINAPI GetDesktopWindow(void)
|
||||||
STARTUPINFOW si;
|
STARTUPINFOW si;
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
WCHAR windir[MAX_PATH];
|
WCHAR windir[MAX_PATH];
|
||||||
WCHAR app[MAX_PATH + sizeof(explorer)/sizeof(WCHAR)];
|
WCHAR app[MAX_PATH + ARRAY_SIZE( explorer )];
|
||||||
WCHAR cmdline[MAX_PATH + (sizeof(explorer) + sizeof(args))/sizeof(WCHAR)];
|
WCHAR cmdline[MAX_PATH + ARRAY_SIZE( explorer ) + ARRAY_SIZE( args )];
|
||||||
WCHAR desktop[MAX_PATH];
|
WCHAR desktop[MAX_PATH];
|
||||||
void *redir;
|
void *redir;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue