Hugh McMaster : regedit: Use the ARRAY_SIZE macro.

Alexandre Julliard julliard at winehq.org
Mon May 21 17:15:10 CDT 2018


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

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Mon May 21 13:34:56 2018 +0000

regedit: Use the ARRAY_SIZE macro.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/regedit/childwnd.c | 2 +-
 programs/regedit/listview.c | 2 +-
 programs/regedit/regedit.c  | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c
index ceeeb1d..56ef59d 100644
--- a/programs/regedit/childwnd.c
+++ b/programs/regedit/childwnd.c
@@ -138,7 +138,7 @@ static LPWSTR GetPathRoot(HWND hwndTV, HTREEITEM hItem, BOOL bFull) {
     if (hRootKey)
         parts[1] = GetRootKeyName(hRootKey);
     if (bFull) {
-        DWORD dwSize = sizeof(text)/sizeof(WCHAR);
+        DWORD dwSize = ARRAY_SIZE(text);
         GetComputerNameW(text, &dwSize);
         parts[0] = text;
     }
diff --git a/programs/regedit/listview.c b/programs/regedit/listview.c
index 4f3593f..e8bfb52 100644
--- a/programs/regedit/listview.c
+++ b/programs/regedit/listview.c
@@ -241,7 +241,7 @@ static BOOL CreateListColumns(HWND hWndListView)
         lvC.iSubItem = index;
         lvC.cx = default_column_widths[index];
         lvC.fmt = column_alignment[index];
-        LoadStringW(hInst, IDS_LIST_COLUMN_FIRST + index, szText, sizeof(szText)/sizeof(WCHAR));
+        LoadStringW(hInst, IDS_LIST_COLUMN_FIRST + index, szText, ARRAY_SIZE(szText));
         if (ListView_InsertColumnW(hWndListView, index, &lvC) == -1) return FALSE;
     }
     return TRUE;
diff --git a/programs/regedit/regedit.c b/programs/regedit/regedit.c
index 7e5887c..7469a90 100644
--- a/programs/regedit/regedit.c
+++ b/programs/regedit/regedit.c
@@ -74,7 +74,7 @@ void WINAPIV output_message(unsigned int id, ...)
     WCHAR fmt[1536];
     __ms_va_list va_args;
 
-    if (!LoadStringW(GetModuleHandleW(NULL), id, fmt, sizeof(fmt)/sizeof(*fmt)))
+    if (!LoadStringW(GetModuleHandleW(NULL), id, fmt, ARRAY_SIZE(fmt)))
     {
         WINE_FIXME("LoadString failed with %d\n", GetLastError());
         return;
@@ -89,7 +89,7 @@ void WINAPIV error_exit(unsigned int id, ...)
     WCHAR fmt[1536];
     __ms_va_list va_args;
 
-    if (!LoadStringW(GetModuleHandleW(NULL), id, fmt, sizeof(fmt)/sizeof(*fmt)))
+    if (!LoadStringW(GetModuleHandleW(NULL), id, fmt, ARRAY_SIZE(fmt)))
     {
         WINE_FIXME("LoadString failed with %u\n", GetLastError());
         return;




More information about the wine-cvs mailing list