view: 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:
Michael Stefaniuc 2018-07-09 20:59:14 +02:00 committed by Alexandre Julliard
parent 56c4c7c57e
commit e9e96bc39a
1 changed files with 6 additions and 6 deletions

View File

@ -214,12 +214,12 @@ static void UpdateWindowCaption(void)
WCHAR szView[MAX_PATH];
static const WCHAR hyphenW[] = { ' ','-',' ',0 };
LoadStringW(hInst, IDS_DESCRIPTION, szView, sizeof(szView)/sizeof(WCHAR));
LoadStringW(hInst, IDS_DESCRIPTION, szView, ARRAY_SIZE(szView));
if (szFileTitle[0] != '\0')
{
lstrcpyW(szCaption, szFileTitle);
LoadStringW(hInst, IDS_DESCRIPTION, szView, sizeof(szView)/sizeof(WCHAR));
LoadStringW(hInst, IDS_DESCRIPTION, szView, ARRAY_SIZE(szView));
lstrcatW(szCaption, hyphenW);
lstrcatW(szCaption, szView);
}
@ -260,10 +260,10 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM
case IDM_OPEN:
{
WCHAR filename[MAX_PATH];
if (FileOpen(hwnd, filename, sizeof(filename)/sizeof(WCHAR)))
if (FileOpen(hwnd, filename, ARRAY_SIZE(filename)))
{
szFileTitle[0] = 0;
GetFileTitleW(filename, szFileTitle, sizeof(szFileTitle)/sizeof(WCHAR));
GetFileTitleW(filename, szFileTitle, ARRAY_SIZE(szFileTitle));
DoOpenFile(filename);
UpdateWindowCaption();
}
@ -323,7 +323,7 @@ static BOOL InitApplication(HINSTANCE hInstance)
WNDCLASSEXW wc;
/* Load the application description strings */
LoadStringW(hInstance, IDS_DESCRIPTION, szTitle, sizeof(szTitle)/sizeof(WCHAR));
LoadStringW(hInstance, IDS_DESCRIPTION, szTitle, ARRAY_SIZE(szTitle));
/* Fill in window class structure with parameters that describe the
main window */
@ -390,7 +390,7 @@ static void HandleCommandLine(LPWSTR cmdline)
cmdline[lstrlenW(cmdline) - 1] = 0;
}
szFileTitle[0] = 0;
GetFileTitleW(cmdline, szFileTitle, sizeof(szFileTitle)/sizeof(WCHAR));
GetFileTitleW(cmdline, szFileTitle, ARRAY_SIZE(szFileTitle));
DoOpenFile(cmdline);
UpdateWindowCaption();
}