Nikolay Sivov : shell32: Make some strings static constants.

Alexandre Julliard julliard at winehq.org
Thu Jan 4 17:03:21 CST 2018


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Jan  4 15:02:48 2018 +0300

shell32: Make some strings static constants.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/shell32/control.c   | 10 +++++-----
 dlls/shell32/shfldr_fs.c |  2 +-
 dlls/shell32/shlfileop.c |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/shell32/control.c b/dlls/shell32/control.c
index b393154..748b2d2 100644
--- a/dlls/shell32/control.c
+++ b/dlls/shell32/control.c
@@ -194,8 +194,8 @@ CPlApplet*	Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
 
 static BOOL Control_CreateListView (CPanel *panel)
 {
+    static const WCHAR empty_string[] = {0};
     RECT ws, sb;
-    WCHAR empty_string[] = {0};
     WCHAR buf[MAX_STRING_LEN];
     LVCOLUMNW lvc;
 
@@ -431,8 +431,8 @@ static CPlItem* Control_GetCPlItem_From_ListView(CPanel *panel)
 
 static void Control_StartApplet(HWND hWnd, CPlItem *item)
 {
-    WCHAR verbOpen[] = {'c','p','l','o','p','e','n',0};
-    WCHAR format[] = {'@','%','d',0};
+    static const WCHAR verbOpen[] = {'c','p','l','o','p','e','n',0};
+    static const WCHAR format[] = {'@','%','d',0};
     WCHAR param[MAX_PATH];
 
     /* execute the applet if item is valid */
@@ -610,11 +610,11 @@ static LRESULT WINAPI	Control_WndProc(HWND hWnd, UINT wMsg,
 
 static void    Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst)
 {
+    static const WCHAR className[] = {'S','h','e','l','l','_','C','o','n','t','r','o',
+        'l','_','W','n','d','C','l','a','s','s',0};
     WNDCLASSEXW wc;
     MSG		msg;
     WCHAR appName[MAX_STRING_LEN];
-    const WCHAR className[] = {'S','h','e','l','l','_','C','o','n','t','r','o',
-        'l','_','W','n','d','C','l','a','s','s',0};
 
     LoadStringW(shell32_hInstance, IDS_CPANEL_TITLE, appName, sizeof(appName) / sizeof(appName[0]));
 
diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c
index 1fb4f1b..0e52fc1 100644
--- a/dlls/shell32/shfldr_fs.c
+++ b/dlls/shell32/shfldr_fs.c
@@ -1085,7 +1085,7 @@ ISFHelper_fnGetUniqueName (ISFHelper * iface, LPWSTR pwszName, UINT uLen)
     HRESULT hr;
     WCHAR wszText[MAX_PATH];
     WCHAR wszNewFolder[25];
-    const WCHAR wszFormat[] = {'%','s',' ','%','d',0 };
+    static const WCHAR wszFormat[] = {'%','s',' ','%','d',0 };
 
     TRACE ("(%p)(%p %u)\n", This, pwszName, uLen);
 
diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c
index 8d4160d..24f5e05 100644
--- a/dlls/shell32/shlfileop.c
+++ b/dlls/shell32/shlfileop.c
@@ -1309,8 +1309,8 @@ static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE
 {
     if (flFrom->dwNumFiles > 1)
     {
+        static const WCHAR format[] = {'%','d',0};
         WCHAR tmp[8];
-        const WCHAR format[] = {'%','d',0};
 
         wnsprintfW(tmp, sizeof(tmp)/sizeof(tmp[0]), format, flFrom->dwNumFiles);
         return SHELL_ConfirmDialogW(hWnd, (fTrash?ASK_TRASH_MULTIPLE_ITEM:ASK_DELETE_MULTIPLE_ITEM), tmp, NULL);




More information about the wine-cvs mailing list