notepad: Use the ARRAY_SIZE() macro if we already have it.

This commit is contained in:
Michael Stefaniuc 2009-05-27 23:49:13 +02:00 committed by Alexandre Julliard
parent cdc5b0c29b
commit 129889b287
2 changed files with 5 additions and 5 deletions

View File

@ -257,7 +257,7 @@ void DoOpenFile(LPCWSTR szFileName)
SetFocus(Globals.hEdit);
/* If the file starts with .LOG, add a time/date at the end and set cursor after */
if (GetWindowTextW(Globals.hEdit, log, sizeof(log)/sizeof(log[0])) && !lstrcmpW(log, dotlog))
if (GetWindowTextW(Globals.hEdit, log, ARRAY_SIZE(log)) && !lstrcmpW(log, dotlog))
{
static const WCHAR lfW[] = { '\r','\n',0 };
SendMessageW(Globals.hEdit, EM_SETSEL, GetWindowTextLengthW(Globals.hEdit), -1);

View File

@ -203,10 +203,10 @@ static VOID NOTEPAD_LoadSettingFromRegistry(void)
Globals.lfFont.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
lstrcpyW(Globals.lfFont.lfFaceName, systemW);
LoadStringW(Globals.hInstance, STRING_PAGESETUP_HEADERVALUE, Globals.szHeader,
sizeof(Globals.szHeader) / sizeof(Globals.szHeader[0]));
LoadStringW(Globals.hInstance, STRING_PAGESETUP_FOOTERVALUE, Globals.szFooter,
sizeof(Globals.szFooter) / sizeof(Globals.szFooter[0]));
LoadStringW(Globals.hInstance, STRING_PAGESETUP_HEADERVALUE,
Globals.szHeader, ARRAY_SIZE(Globals.szHeader));
LoadStringW(Globals.hInstance, STRING_PAGESETUP_FOOTERVALUE,
Globals.szFooter, ARRAY_SIZE(Globals.szFooter));
if(RegOpenKeyW(HKEY_CURRENT_USER, notepad_reg_key, &hkey) == ERROR_SUCCESS)
{