Commit e9e96bc3 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

view: Use the ARRAY_SIZE() macro.

parent 56c4c7c5
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment