Make Unicode strings static const.
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c index f0d6053..1804788 100644 --- a/dlls/advapi32/security.c +++ b/dlls/advapi32/security.c
@@ -1193,7 +1193,7 @@ KEY_READ, &key)) == ERROR_SUCCESS) { DWORD size = 0; - WCHAR wg[] = { 'W','o','r','k','g','r','o','u','p',0 }; + static const WCHAR wg[] = { 'W','o','r','k','g','r','o','u','p',0 }; ret = RegQueryValueExW(key, wg, NULL, NULL, NULL, &size); if (ret == ERROR_MORE_DATA || ret == ERROR_SUCCESS)
diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index 3b1a0b5..7f55192 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c
@@ -915,9 +915,9 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs) { - WCHAR COMBOBOX[] = { 'C', 'o', 'm', 'b', 'o', 'B', 'o', 'x', 0 }; - WCHAR EDIT[] = { 'E', 'D', 'I', 'T', 0 }; - WCHAR NIL[] = { 0 }; + static const WCHAR COMBOBOX[] = { 'C', 'o', 'm', 'b', 'o', 'B', 'o', 'x', 0 }; + static const WCHAR EDIT[] = { 'E', 'D', 'I', 'T', 0 }; + static const WCHAR NIL[] = { 0 }; COMBOEX_INFO *infoPtr; LOGFONTW mylogfont; RECT wnrc1, clrc1, cmbwrc; @@ -1281,7 +1281,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis) { - WCHAR nil[] = { 0 }; + static const WCHAR nil[] = { 0 }; CBE_ITEMDATA *item = 0; SIZE txtsize; RECT rect;
diff --git a/dlls/comctl32/comctl32undoc.c b/dlls/comctl32/comctl32undoc.c index fabc4d5..8944c19 100644 --- a/dlls/comctl32/comctl32undoc.c +++ b/dlls/comctl32/comctl32undoc.c
@@ -523,7 +523,7 @@ HKEY newkey; WCHAR realname[2]; LPWINEMRUITEM witem; - WCHAR emptyW[] = {'\0'}; + static const WCHAR emptyW[] = {'\0'}; /* or should we do the following instead of RegOpenKeyEx: */ @@ -859,7 +859,7 @@ WCHAR realname[2]; LPWINEMRUITEM witem; DWORD type; - WCHAR emptyW[] = {'\0'}; + static const WCHAR emptyW[] = {'\0'}; /* get space to save indices that will turn into names * but in order of most to least recently used
diff --git a/dlls/comctl32/ipaddress.c b/dlls/comctl32/ipaddress.c index 61b463d..d1d52ce 100644 --- a/dlls/comctl32/ipaddress.c +++ b/dlls/comctl32/ipaddress.c
@@ -155,7 +155,7 @@ IPADDRESS_INFO *infoPtr; RECT rcClient, edit; int i, fieldsize; - WCHAR EDIT[] = { 'E', 'd', 'i', 't', 0 }; + static const WCHAR EDIT[] = { 'E', 'd', 'i', 't', 0 }; TRACE("\n"); @@ -291,7 +291,8 @@ static LRESULT IPADDRESS_SetAddress (IPADDRESS_INFO *infoPtr, DWORD ip_address) { - WCHAR buf[20], fmt[] = { '%', 'd', 0 }; + WCHAR buf[20]; + static const WCHAR fmt[] = { '%', 'd', 0 }; int i; TRACE("\n"); @@ -328,7 +329,8 @@ static BOOL IPADDRESS_ConstrainField (IPADDRESS_INFO *infoPtr, int currentfield) { IPPART_INFO *part = &infoPtr->Part[currentfield]; - WCHAR field[10], fmt[] = { '%', 'd', 0 }; + WCHAR field[10]; + static const WCHAR fmt[] = { '%', 'd', 0 }; int curValue, newValue; TRACE("(currentfield=%d)\n", currentfield);
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index e40b3dc..6a0d29d 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c
@@ -3552,7 +3552,7 @@ { UINT uFormat, uView = infoPtr->dwStyle & LVS_TYPEMASK; WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' }; - WCHAR szCallback[] = { '(', 'c', 'a', 'l', 'l', 'b', 'a', 'c', 'k', ')', 0 }; + static const WCHAR szCallback[] = { '(', 'c', 'a', 'l', 'l', 'b', 'a', 'c', 'k', ')', 0 }; DWORD cdsubitemmode = CDRF_DODEFAULT; RECT* lprcFocus, rcSelect, rcBox, rcState, rcIcon, rcLabel; NMLVCUSTOMDRAW nmlvcd; @@ -3575,7 +3575,7 @@ if (!LISTVIEW_GetItemW(infoPtr, &lvItem)) return FALSE; if (nSubItem > 0 && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) lvItem.state = LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED); - if (lvItem.pszText == LPSTR_TEXTCALLBACKW) lvItem.pszText = szCallback; + if (lvItem.pszText == LPSTR_TEXTCALLBACKW) lvItem.pszText = (LPWSTR)szCallback; TRACE(" lvItem=%s\n", debuglvitem_t(&lvItem, TRUE)); /* now check if we need to update the focus rectangle */
diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index 79c5c37..0192464 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c
@@ -728,7 +728,8 @@ TRACKBAR_UpdateToolTip (TRACKBAR_INFO *infoPtr) { DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE); - WCHAR buf[80], fmt[] = { '%', 'l', 'd', 0 }; + WCHAR buf[80]; + static const WCHAR fmt[] = { '%', 'l', 'd', 0 }; TTTOOLINFOW ti; POINT pt; RECT rcClient;
diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 9d6880d..00d0c54 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c
@@ -3467,7 +3467,7 @@ HDC hdc; HFONT hOldFont=0; TEXTMETRICW textMetric; - WCHAR EditW[] = {'E','d','i','t',0}; + static const WCHAR EditW[] = {'E','d','i','t',0}; TRACE("%x %p\n", (unsigned)hwnd, hItem); if (!TREEVIEW_ValidItem(infoPtr, editItem))
diff --git a/dlls/commdlg/filedlg.c b/dlls/commdlg/filedlg.c index f4de903..cc8350d 100644 --- a/dlls/commdlg/filedlg.c +++ b/dlls/commdlg/filedlg.c
@@ -1016,8 +1016,8 @@ int win98plus = 0; int handledPath = FALSE; OSVERSIONINFOA osVi; - const WCHAR szwSlash[] = { '\\', 0 }; - const WCHAR szwStar[] = { '*',0 }; + static const WCHAR szwSlash[] = { '\\', 0 }; + static const WCHAR szwStar[] = { '*',0 }; TBBUTTON tbb[] = { @@ -1539,7 +1539,7 @@ WCHAR lpstrNotFound[100]; WCHAR lpstrMsg[100]; WCHAR tmp[400]; - WCHAR nl[] = {'\n',0}; + static const WCHAR nl[] = {'\n',0}; LoadStringW(COMDLG32_hInstance, IDS_FILENOTFOUND, lpstrNotFound, 100); LoadStringW(COMDLG32_hInstance, IDS_VERIFYFILE, lpstrMsg, 100); @@ -1717,7 +1717,7 @@ { LPWSTR lpszTemp, lpszTemp1; LPITEMIDLIST pidl = NULL; - WCHAR szwInvalid[] = { '/',':','<','>','|', 0}; + static const WCHAR szwInvalid[] = { '/',':','<','>','|', 0}; /* check for invalid chars */ if((strpbrkW(lpstrPathAndFile+3, szwInvalid) != NULL) && !(fodInfos->ofnInfos->Flags & OFN_NOVALIDATE)) @@ -1747,7 +1747,7 @@ if(*lpszTemp==0) { - WCHAR wszWild[] = { '*', '?', 0 }; + static const WCHAR wszWild[] = { '*', '?', 0 }; /* if the last element is a wildcard do a search */ if(strpbrkW(lpszTemp1, wszWild) != NULL) { @@ -1886,7 +1886,7 @@ /* only add "." in case a default extension does exist */ if (*fodInfos->defext != '\0') { - const WCHAR szwDot[] = {'.',0}; + static const WCHAR szwDot[] = {'.',0}; int PathLength = strlenW(lpstrPathAndFile); strcatW(lpstrPathAndFile, szwDot); @@ -3188,7 +3188,7 @@ if ( FAILED( IShellBrowser_BrowseObject( fodInfos->Shell.FOIShellBrowser, pidlSelection, SBSP_RELATIVE ) ) ) { - WCHAR notexist[] = {'P','a','t','h',' ','d','o','e','s', + static const WCHAR notexist[] = {'P','a','t','h',' ','d','o','e','s', ' ','n','o','t',' ','e','x','i','s','t',0}; MessageBoxW( hwnd, notexist, fodInfos->title, MB_OK | MB_ICONEXCLAMATION ); }
diff --git a/dlls/dxerr8/dxerr8.c b/dlls/dxerr8/dxerr8.c index d97d611..a5ededc 100644 --- a/dlls/dxerr8/dxerr8.c +++ b/dlls/dxerr8/dxerr8.c
@@ -133,22 +133,22 @@ TRACE("(%p,%ld,0x%08lx,%p,%d)\n", strFile, dwLine, hr, strMsg, bPopMsgBox); if (bPopMsgBox) { - WCHAR format[] = { 'F','i','l','e',':',' ','%','s','\\','n','L','i','n', + static const WCHAR format[] = { 'F','i','l','e',':',' ','%','s','\\','n','L','i','n', 'e',':',' ','%','l','d','\\','n','E','r','r','o','r',' ','C','o', 'd','e',':',' ','%','s',' ','(','0','x','%','0','8','l','x',')', '\\','n','C','a','l','l','i','n','g',':',' ','%','s',0 }; - WCHAR caption[] = { 'U','n','e','x','p','e','c','t','e','d',' ','e','r', - 'r','o','r',' ','e','n','c','o','u','n','t','e','r','e','d',0 }; + static const WCHAR caption[] = { 'U','n','e','x','p','e','c','t','e','d',' ','e','r', + 'r','o','r',' ','e','n','c','o','u','n','t','e','r','e','d',0 }; /* FIXME: should use wsnprintf */ - wsprintfW(msg, format, strFile, dwLine, + wsprintfW(msg, format, strFile, dwLine, DXGetErrorString8W(hr), hr, strMsg); MessageBoxW(0, msg, caption, MB_OK|MB_ICONERROR); } else { - WCHAR format[] = { '%','s','(','%','l','d',')',':',' ','%','s',' ','(', + static const WCHAR format[] = { '%','s','(','%','l','d',')',':',' ','%','s',' ','(', 'h','r','=','%','s',' ','(','0','x','%','0','8','l','x',')',')',' ', 0 }; /* FIXME: should use wsnprintf */ - wsprintfW(msg, format, strFile, dwLine, strMsg, + wsprintfW(msg, format, strFile, dwLine, strMsg, DXGetErrorString8W(hr), hr); OutputDebugStringW(msg); }
diff --git a/dlls/dxerr9/dxerr9.c b/dlls/dxerr9/dxerr9.c index 6bfee44..08c2a3f 100644 --- a/dlls/dxerr9/dxerr9.c +++ b/dlls/dxerr9/dxerr9.c
@@ -133,22 +133,22 @@ TRACE("(%p,%ld,0x%08lx,%p,%d)\n", strFile, dwLine, hr, strMsg, bPopMsgBox); if (bPopMsgBox) { - WCHAR format[] = { 'F','i','l','e',':',' ','%','s','\\','n','L','i','n', + static const WCHAR format[] = { 'F','i','l','e',':',' ','%','s','\\','n','L','i','n', 'e',':',' ','%','l','d','\\','n','E','r','r','o','r',' ','C','o', 'd','e',':',' ','%','s',' ','(','0','x','%','0','8','l','x',')', '\\','n','C','a','l','l','i','n','g',':',' ','%','s',0 }; - WCHAR caption[] = { 'U','n','e','x','p','e','c','t','e','d',' ','e','r', - 'r','o','r',' ','e','n','c','o','u','n','t','e','r','e','d',0 }; + static const WCHAR caption[] = { 'U','n','e','x','p','e','c','t','e','d',' ','e','r', + 'r','o','r',' ','e','n','c','o','u','n','t','e','r','e','d',0 }; /* FIXME: should use wsnprintf */ - wsprintfW(msg, format, strFile, dwLine, + wsprintfW(msg, format, strFile, dwLine, DXGetErrorString9W(hr), hr, strMsg); MessageBoxW(0, msg, caption, MB_OK|MB_ICONERROR); } else { - WCHAR format[] = { '%','s','(','%','l','d',')',':',' ','%','s',' ','(', + static const WCHAR format[] = { '%','s','(','%','l','d',')',':',' ','%','s',' ','(', 'h','r','=','%','s',' ','(','0','x','%','0','8','l','x',')',')',' ', 0 }; /* FIXME: should use wsnprintf */ - wsprintfW(msg, format, strFile, dwLine, strMsg, + wsprintfW(msg, format, strFile, dwLine, strMsg, DXGetErrorString9W(hr), hr); OutputDebugStringW(msg); }
diff --git a/dlls/gdi/freetype.c b/dlls/gdi/freetype.c index 79e3633..b51a95a 100644 --- a/dlls/gdi/freetype.c +++ b/dlls/gdi/freetype.c
@@ -2270,7 +2270,7 @@ TT_Postscript *pPost; FT_Fixed x_scale, y_scale; WCHAR *family_nameW, *style_nameW; - WCHAR spaceW[] = {' ', '\0'}; + static const WCHAR spaceW[] = {' ', '\0'}; char *cp; INT ascent, descent;
diff --git a/dlls/kernel/tests/file.c b/dlls/kernel/tests/file.c index 7ec229c..c933ad6 100644 --- a/dlls/kernel/tests/file.c +++ b/dlls/kernel/tests/file.c
@@ -596,7 +596,7 @@ HANDLE hFile; WCHAR temp_path[MAX_PATH]; WCHAR filename[MAX_PATH]; - WCHAR emptyW[]={'\0'}; + static const WCHAR emptyW[]={'\0'}; static const WCHAR prefix[] = {'p','f','x',0}; DWORD ret; @@ -668,7 +668,7 @@ static void test_DeleteFileW( void ) { BOOL ret; - WCHAR emptyW[]={'\0'}; + static const WCHAR emptyW[]={'\0'}; ret = DeleteFileW(NULL); if (ret==0 && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED)
diff --git a/dlls/kernel/tests/format_msg.c b/dlls/kernel/tests/format_msg.c index d19e3f4..e6f317c 100644 --- a/dlls/kernel/tests/format_msg.c +++ b/dlls/kernel/tests/format_msg.c
@@ -42,7 +42,7 @@ { CHAR out[0x100] = {0}; DWORD r; - WCHAR szwTest[] = { 't','e','s','t',0}; + static const WCHAR szwTest[] = { 't','e','s','t',0}; /* the basics */ r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "test", 0,
diff --git a/dlls/ntdll/tests/rtlstr.c b/dlls/ntdll/tests/rtlstr.c index 41a12c8..eab3c72 100644 --- a/dlls/ntdll/tests/rtlstr.c +++ b/dlls/ntdll/tests/rtlstr.c
@@ -191,7 +191,7 @@ static void test_RtlInitUnicodeStringEx(void) { - WCHAR teststring[] = {'S','o','m','e',' ','W','i','l','d',' ','S','t','r','i','n','g',0}; + static const WCHAR teststring[] = {'S','o','m','e',' ','W','i','l','d',' ','S','t','r','i','n','g',0}; WCHAR *teststring2; UNICODE_STRING uni; NTSTATUS result;
diff --git a/dlls/ole32/antimoniker.c b/dlls/ole32/antimoniker.c index fd039dd..f323ef4 100644 --- a/dlls/ole32/antimoniker.c +++ b/dlls/ole32/antimoniker.c
@@ -539,7 +539,7 @@ IMoniker* pmkToLeft, LPOLESTR *ppszDisplayName) { - WCHAR back[]={'\\','.','.',0}; + static const WCHAR back[]={'\\','.','.',0}; TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,ppszDisplayName);
diff --git a/dlls/ole32/filemoniker.c b/dlls/ole32/filemoniker.c index 986ce9b..0beaca2 100644 --- a/dlls/ole32/filemoniker.c +++ b/dlls/ole32/filemoniker.c
@@ -473,8 +473,8 @@ int nb=0,i; int sizeStr=lstrlenW(lpszPathName); LPOLESTR *tabStr=0; - WCHAR twoPoint[]={'.','.',0}; - WCHAR bkSlash[]={'\\',0}; + static const WCHAR twoPoint[]={'.','.',0}; + static const WCHAR bkSlash[]={'\\',0}; BYTE addBkSlash; TRACE("(%p,%p)\n",This,lpszPathName); @@ -751,8 +751,8 @@ { HRESULT res; LPOLESTR str1=0,str2=0,*strDec1=0,*strDec2=0,newStr=0; - WCHAR twoPoint[]={'.','.',0}; - WCHAR bkSlash[]={'\\',0}; + static const WCHAR twoPoint[]={'.','.',0}; + static const WCHAR bkSlash[]={'\\',0}; IBindCtx *bind=0; int i=0,j=0,lastIdx1=0,lastIdx2=0; DWORD mkSys; @@ -1098,7 +1098,7 @@ ******************************************************************************/ int WINAPI FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable) { - WCHAR bSlash[] = {'\\',0}; + static const WCHAR bSlash[] = {'\\',0}; WCHAR word[MAX_PATH]; int i=0,j,tabIndex=0; LPOLESTR *strgtable ; @@ -1157,7 +1157,7 @@ HRESULT res; LPOLESTR str1=0,str2=0,*tabStr1=0,*tabStr2=0,relPath=0; DWORD len1=0,len2=0,sameIdx=0,j=0; - WCHAR back[] ={'.','.','\\',0}; + static const WCHAR back[] ={'.','.','\\',0}; TRACE("(%p,%p,%p)\n",iface,pmOther,ppmkRelPath);
diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 4347e96..4348a4d 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c
@@ -5445,7 +5445,7 @@ if (pwcsName == 0) { WCHAR tempPath[MAX_PATH]; - WCHAR prefix[] = { 'S', 'T', 'O', 0 }; + static const WCHAR prefix[] = { 'S', 'T', 'O', 0 }; if (!(grfMode & STGM_SHARE_EXCLUSIVE)) return STG_E_INVALIDFLAG; @@ -6424,7 +6424,7 @@ IStorage *pTempStorage; DWORD dwNumOfBytesWritten; WCHAR wstrTempDir[MAX_PATH], wstrTempFile[MAX_PATH]; - WCHAR wstrPrefix[] = {'s', 'i', 's', 0}; + static const WCHAR wstrPrefix[] = {'s', 'i', 's', 0}; /* Create a temp File */ GetTempPathW(MAX_PATH, wstrTempDir); @@ -6474,7 +6474,7 @@ DWORD nDataLength = 0; IStorage *pTempStorage; WCHAR wstrTempDir[MAX_PATH], wstrTempFile[MAX_PATH]; - WCHAR wstrPrefix[] = {'s', 'i', 's', 0}; + static const WCHAR wstrPrefix[] = {'s', 'i', 's', 0}; *pData = NULL; @@ -6527,7 +6527,7 @@ { HRESULT hRes; IStream *pStream; - WCHAR wstrStreamName[] = {1,'O', 'l', 'e', 0}; + static const WCHAR wstrStreamName[] = {1,'O', 'l', 'e', 0}; BYTE pOleStreamHeader [] = { 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, @@ -6616,7 +6616,7 @@ { IStream *pstm; HRESULT r = S_OK; - WCHAR szwStreamName[] = {1, 'C', 'o', 'm', 'p', 'O', 'b', 'j', 0}; + static const WCHAR szwStreamName[] = {1, 'C', 'o', 'm', 'p', 'O', 'b', 'j', 0}; static const BYTE unknown1[12] = { 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, @@ -6855,7 +6855,7 @@ IStream *pStream; HRESULT hStorageRes, hRes = S_OK; OLECONVERT_ISTORAGE_COMPOBJ IStorageCompObj; - WCHAR wstrStreamName[] = {1,'C', 'o', 'm', 'p', 'O', 'b', 'j', 0}; + static const WCHAR wstrStreamName[] = {1,'C', 'o', 'm', 'p', 'O', 'b', 'j', 0}; WCHAR bufferW[OLESTREAM_MAX_STR_LEN]; BYTE pCompObjUnknown1[] = {0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF}; @@ -6956,7 +6956,7 @@ { HRESULT hRes; IStream *pStream; - WCHAR wstrStreamName[] = {2, 'O', 'l', 'e', 'P', 'r', 'e', 's', '0', '0', '0', 0}; + static const WCHAR wstrStreamName[] = {2, 'O', 'l', 'e', 'P', 'r', 'e', 's', '0', '0', '0', 0}; BYTE pOlePresStreamHeader [] = { 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, @@ -7040,7 +7040,7 @@ { HRESULT hRes; IStream *pStream; - WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0}; + static const WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0}; /* Create the Ole10Native Stream */ hRes = IStorage_CreateStream(pStorage, wstrStreamName, @@ -7081,7 +7081,7 @@ IStream *pStream; LARGE_INTEGER iSeekPos; OLECONVERT_ISTORAGE_COMPOBJ CompObj; - WCHAR wstrStreamName[] = {1,'C', 'o', 'm', 'p', 'O', 'b', 'j', 0}; + static const WCHAR wstrStreamName[] = {1,'C', 'o', 'm', 'p', 'O', 'b', 'j', 0}; /* Open the CompObj Stream */ hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL, @@ -7150,7 +7150,7 @@ HRESULT hRes; IStream *pStream; - WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0}; + static const WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0}; /* Initialize Default data for OLESTREAM */ pOleStreamData[0].dwOleID = OLESTREAM_ID; @@ -7203,7 +7203,7 @@ HRESULT hRes; IStream *pStream; OLECONVERT_ISTORAGE_OLEPRES olePress; - WCHAR wstrStreamName[] = {2, 'O', 'l', 'e', 'P', 'r', 'e', 's', '0', '0', '0', 0}; + static const WCHAR wstrStreamName[] = {2, 'O', 'l', 'e', 'P', 'r', 'e', 's', '0', '0', '0', 0}; /* Initialize Default data for OLESTREAM */ pOleStreamData[0].dwOleID = OLESTREAM_ID; @@ -7384,7 +7384,7 @@ HRESULT hRes = S_OK; IStream *pStream; OLECONVERT_OLESTREAM_DATA pOleStreamData[2]; - WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0}; + static const WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0}; memset(pOleStreamData, 0, sizeof(pOleStreamData));
diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c index 5a933cd..a377dad 100644 --- a/dlls/oleaut32/olefont.c +++ b/dlls/oleaut32/olefont.c
@@ -1214,7 +1214,7 @@ LCID lcid, ITypeInfo** ppTInfo) { - WCHAR stdole32tlb[] = {'s','t','d','o','l','e','3','2','.','t','l','b',0}; + static const WCHAR stdole32tlb[] = {'s','t','d','o','l','e','3','2','.','t','l','b',0}; ITypeLib *tl; HRESULT hres;
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 62852cb..2d831cf 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c
@@ -308,7 +308,7 @@ return TYPE_E_CANTLOADLIBRARY; } else { WCHAR tstpath[260]; - WCHAR stdole32tlb[] = { 's','t','d','o','l','e','3','2','.','t','l','b',0 }; + static const WCHAR stdole32tlb[] = { 's','t','d','o','l','e','3','2','.','t','l','b',0 }; int i; lstrcpyW(tstpath,szFile);
diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index d3fe65b..58dcb6b 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c
@@ -193,7 +193,7 @@ HKEY hkeyMediaType = NULL; HRESULT hr = S_OK; BOOL bFound = FALSE; - WCHAR wszMediaType[] = {'M','e','d','i','a',' ','T','y','p','e',0}; + static const WCHAR wszMediaType[] = {'M','e','d','i','a',' ','T','y','p','e',0}; CopyMemory(majorType, &GUID_NULL, sizeof(*majorType)); CopyMemory(minorType, &GUID_NULL, sizeof(*minorType));
diff --git a/dlls/setupapi/diskspace.c b/dlls/setupapi/diskspace.c index 965df5c..f47137b 100644 --- a/dlls/setupapi/diskspace.c +++ b/dlls/setupapi/diskspace.c
@@ -120,7 +120,7 @@ int i; LPDISKSPACELIST list = (LPDISKSPACELIST)DiskSpace; BOOL rc = FALSE; - WCHAR bkslsh[]= {'\\',0}; + static const WCHAR bkslsh[]= {'\\',0}; MultiByteToWideChar(CP_ACP,0,DriveSpec,-1,driveW,20);
diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c index 4bf9c72..fb332fa 100644 --- a/dlls/shell32/shell32_main.c +++ b/dlls/shell32/shell32_main.c
@@ -356,8 +356,8 @@ /* get the type name */ if (SUCCEEDED(hr) && (flags & SHGFI_TYPENAME)) { - WCHAR szFile[] = { 'F','i','l','e',0 }; - WCHAR szDashFile[] = { '-','f','i','l','e',0 }; + static const WCHAR szFile[] = { 'F','i','l','e',0 }; + static const WCHAR szDashFile[] = { '-','f','i','l','e',0 }; if (!(flags & SHGFI_USEFILEATTRIBUTES)) { char ftype[80]; @@ -428,7 +428,7 @@ psfi->iIcon = 2; else { - WCHAR p1W[] = {'%','1',0}; + static const WCHAR p1W[] = {'%','1',0}; psfi->iIcon = 0; szExt = (LPWSTR) PathFindExtensionW(sTemp); if ( szExt && HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE)
diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c index 2195666..6cebf00 100644 --- a/dlls/shell32/shlfileop.c +++ b/dlls/shell32/shlfileop.c
@@ -53,9 +53,9 @@ #define FO_MASK 0xF CHAR aWildcardFile[] = {'*','.','*',0}; -WCHAR wWildcardFile[] = {'*','.','*',0}; -WCHAR wWildcardChars[] = {'*','?',0}; -WCHAR wBackslash[] = {'\\',0}; +static const WCHAR wWildcardFile[] = {'*','.','*',0}; +static const WCHAR wWildcardChars[] = {'*','?',0}; +static const WCHAR wBackslash[] = {'\\',0}; static DWORD SHNotifyCreateDirectoryA(LPCSTR path, LPSECURITY_ATTRIBUTES sec); static DWORD SHNotifyCreateDirectoryW(LPCWSTR path, LPSECURITY_ATTRIBUTES sec);
diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index f18409b..9760ead 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c
@@ -1076,7 +1076,7 @@ { DWORD dwRet = ERROR_SUCCESS, dwDummy; HKEY hSubKey; - WCHAR szEmpty[] = { '\0' }; + static const WCHAR szEmpty[] = { '\0' }; TRACE("(hkey=%p,%s,%s,%ld,%p,%ld)\n", hKey, debugstr_w(lpszSubKey), debugstr_w(lpszValue), dwType, pvData, cbData);
diff --git a/dlls/shlwapi/string.c b/dlls/shlwapi/string.c index c970a47..37f6715 100644 --- a/dlls/shlwapi/string.c +++ b/dlls/shlwapi/string.c
@@ -2530,7 +2530,7 @@ INT WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr, LPINT lpiLen) { - WCHAR emptyW[] = { '\0' }; + static const WCHAR emptyW[] = { '\0' }; int len , reqLen; LPSTR mem;
diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index 35e04e5..a86c56b 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c
@@ -687,8 +687,8 @@ DWORD myflags, sizeloc = 0; DWORD len, res1, res2, process_case = 0; LPWSTR work, preliminary, mbase, mrelative; - WCHAR myfilestr[] = {'f','i','l','e',':','/','/','/','\0'}; - WCHAR single_slash[] = {'/','\0'}; + static const WCHAR myfilestr[] = {'f','i','l','e',':','/','/','/','\0'}; + static const WCHAR single_slash[] = {'/','\0'}; HRESULT ret; TRACE("(base %s, Relative %s, Combine size %ld, flags %08lx)\n",
diff --git a/dlls/user/tests/class.c b/dlls/user/tests/class.c index 156a12c..2516b7c 100644 --- a/dlls/user/tests/class.c +++ b/dlls/user/tests/class.c
@@ -45,8 +45,8 @@ static void ClassTest(HINSTANCE hInstance, BOOL global) { WNDCLASSW cls, wc; - WCHAR className[] = {'T','e','s','t','C','l','a','s','s',0}; - WCHAR winName[] = {'W','i','n','C','l','a','s','s','T','e','s','t',0}; + static const WCHAR className[] = {'T','e','s','t','C','l','a','s','s',0}; + static const WCHAR winName[] = {'W','i','n','C','l','a','s','s','T','e','s','t',0}; ATOM test_atom; HWND hTestWnd; DWORD i;
diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c index ccf2a8a..5313803 100644 --- a/dlls/uxtheme/msstyles.c +++ b/dlls/uxtheme/msstyles.c
@@ -78,13 +78,13 @@ HMODULE hTheme; HRSRC hrsc; HRESULT hr = S_OK; - WCHAR szPackThemVersionResource[] = { + static const WCHAR szPackThemVersionResource[] = { 'P','A','C','K','T','H','E','M','_','V','E','R','S','I','O','N', '\0' }; - WCHAR szColorNamesResource[] = { + static const WCHAR szColorNamesResource[] = { 'C','O','L','O','R','N','A','M','E','S','\0' }; - WCHAR szSizeNamesResource[] = { + static const WCHAR szSizeNamesResource[] = { 'S','I','Z','E','N','A','M','E','S','\0' }; @@ -250,7 +250,7 @@ */ PUXINI_FILE MSSTYLES_GetActiveThemeIni(PTHEME_FILE tf) { - WCHAR szFileResNamesResource[] = { + static const WCHAR szFileResNamesResource[] = { 'F','I','L','E','R','E','S','N','A','M','E','S','\0' }; DWORD dwColorCount = 0; @@ -661,8 +661,8 @@ */ void MSSTYLES_ParseThemeIni(PTHEME_FILE tf) { - WCHAR szSysMetrics[] = {'S','y','s','M','e','t','r','i','c','s','\0'}; - WCHAR szGlobals[] = {'g','l','o','b','a','l','s','\0'}; + static const WCHAR szSysMetrics[] = {'S','y','s','M','e','t','r','i','c','s','\0'}; + static const WCHAR szGlobals[] = {'g','l','o','b','a','l','s','\0'}; PTHEME_CLASS cls; PTHEME_CLASS globals; PTHEME_PARTSTATE ps;
diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c index a68d0be..ee7511e 100644 --- a/dlls/uxtheme/system.c +++ b/dlls/uxtheme/system.c
@@ -602,10 +602,10 @@ { WCHAR szDir[MAX_PATH]; WCHAR szPath[MAX_PATH]; - WCHAR szStar[] = {'*','.','*','\0'}; - WCHAR szFormat[] = {'%','s','%','s','\\','%','s','.','m','s','s','t','y','l','e','s','\0'}; - WCHAR szDisplayName[] = {'d','i','s','p','l','a','y','n','a','m','e','\0'}; - WCHAR szTooltip[] = {'t','o','o','l','t','i','p','\0'}; + static const WCHAR szStar[] = {'*','.','*','\0'}; + static const WCHAR szFormat[] = {'%','s','%','s','\\','%','s','.','m','s','s','t','y','l','e','s','\0'}; + static const WCHAR szDisplayName[] = {'d','i','s','p','l','a','y','n','a','m','e','\0'}; + static const WCHAR szTooltip[] = {'t','o','o','l','t','i','p','\0'}; WCHAR szName[60]; WCHAR szTip[60]; HANDLE hFind;