Michael Stefaniuc : start: Use the ARRAY_SIZE() macro.

Alexandre Julliard julliard at winehq.org
Fri Jul 13 15:01:47 CDT 2018


Module: wine
Branch: master
Commit: 414fe80aebe3850fd016da5cb883f4bfeab1c543
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=414fe80aebe3850fd016da5cb883f4bfeab1c543

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Fri Jul 13 19:01:30 2018 +0200

start: Use the ARRAY_SIZE() macro.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/explorer/startmenu.c | 2 +-
 programs/start/start.c        | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/programs/explorer/startmenu.c b/programs/explorer/startmenu.c
index 0d79aca..f5f50bb 100644
--- a/programs/explorer/startmenu.c
+++ b/programs/explorer/startmenu.c
@@ -475,7 +475,7 @@ void do_startmenu(HWND hwnd)
     if (SUCCEEDED(SHGetSpecialFolderLocation(NULL, CSIDL_CONTROLS, &pidl)))
         add_shell_item(&root_menu, pidl);
 
-    LoadStringW(NULL, IDS_RUN, run_label, sizeof(run_label)/sizeof(run_label[0]));
+    LoadStringW(NULL, IDS_RUN, run_label, ARRAY_SIZE(run_label));
 
     mii.cbSize = sizeof(mii);
     mii.fMask = MIIM_STRING|MIIM_ID;
diff --git a/programs/start/start.c b/programs/start/start.c
index 4010bef..32372ec 100644
--- a/programs/start/start.c
+++ b/programs/start/start.c
@@ -100,8 +100,7 @@ static void fatal_string_error(int which, DWORD error_code, const WCHAR *filenam
 {
 	WCHAR msg[2048];
 
-	if (!LoadStringW(GetModuleHandleW(NULL), which,
-					msg, sizeof(msg)/sizeof(WCHAR)))
+	if (!LoadStringW(GetModuleHandleW(NULL), which, msg, ARRAY_SIZE(msg)))
 		WINE_ERR("LoadString failed, error %d\n", GetLastError());
 
 	fatal_error(msg, error_code, filename);
@@ -111,8 +110,7 @@ static void fatal_string(int which)
 {
 	WCHAR msg[2048];
 
-	if (!LoadStringW(GetModuleHandleW(NULL), which,
-					msg, sizeof(msg)/sizeof(WCHAR)))
+	if (!LoadStringW(GetModuleHandleW(NULL), which, msg, ARRAY_SIZE(msg)))
 		WINE_ERR("LoadString failed, error %d\n", GetLastError());
 
 	output(msg);




More information about the wine-cvs mailing list