Make Unicode strings static const.

This commit is contained in:
Francois Gouget 2004-04-20 01:12:17 +00:00 committed by Alexandre Julliard
parent e2490a0986
commit 52c0832161
29 changed files with 86 additions and 83 deletions

View File

@ -1193,7 +1193,7 @@ LsaQueryInformationPolicy(
KEY_READ, &key)) == ERROR_SUCCESS) KEY_READ, &key)) == ERROR_SUCCESS)
{ {
DWORD size = 0; 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); ret = RegQueryValueExW(key, wg, NULL, NULL, NULL, &size);
if (ret == ERROR_MORE_DATA || ret == ERROR_SUCCESS) if (ret == ERROR_MORE_DATA || ret == ERROR_SUCCESS)

View File

@ -915,9 +915,9 @@ static INT COMBOEX_SetItemHeight (COMBOEX_INFO *infoPtr, INT index, UINT height)
static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs) static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs)
{ {
WCHAR COMBOBOX[] = { 'C', 'o', 'm', 'b', 'o', 'B', 'o', 'x', 0 }; static const WCHAR COMBOBOX[] = { 'C', 'o', 'm', 'b', 'o', 'B', 'o', 'x', 0 };
WCHAR EDIT[] = { 'E', 'D', 'I', 'T', 0 }; static const WCHAR EDIT[] = { 'E', 'D', 'I', 'T', 0 };
WCHAR NIL[] = { 0 }; static const WCHAR NIL[] = { 0 };
COMBOEX_INFO *infoPtr; COMBOEX_INFO *infoPtr;
LOGFONTW mylogfont; LOGFONTW mylogfont;
RECT wnrc1, clrc1, cmbwrc; RECT wnrc1, clrc1, cmbwrc;
@ -1281,7 +1281,7 @@ static BOOL COMBOEX_WM_DeleteItem (COMBOEX_INFO *infoPtr, DELETEITEMSTRUCT *dis)
static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis) static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis)
{ {
WCHAR nil[] = { 0 }; static const WCHAR nil[] = { 0 };
CBE_ITEMDATA *item = 0; CBE_ITEMDATA *item = 0;
SIZE txtsize; SIZE txtsize;
RECT rect; RECT rect;

View File

@ -523,7 +523,7 @@ VOID MRU_SaveChanged( LPWINEMRULIST mp )
HKEY newkey; HKEY newkey;
WCHAR realname[2]; WCHAR realname[2];
LPWINEMRUITEM witem; LPWINEMRUITEM witem;
WCHAR emptyW[] = {'\0'}; static const WCHAR emptyW[] = {'\0'};
/* or should we do the following instead of RegOpenKeyEx: /* or should we do the following instead of RegOpenKeyEx:
*/ */
@ -859,7 +859,7 @@ HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp)
WCHAR realname[2]; WCHAR realname[2];
LPWINEMRUITEM witem; LPWINEMRUITEM witem;
DWORD type; DWORD type;
WCHAR emptyW[] = {'\0'}; static const WCHAR emptyW[] = {'\0'};
/* get space to save indices that will turn into names /* get space to save indices that will turn into names
* but in order of most to least recently used * but in order of most to least recently used

View File

@ -155,7 +155,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, LPCREATESTRUCTA lpCreate)
IPADDRESS_INFO *infoPtr; IPADDRESS_INFO *infoPtr;
RECT rcClient, edit; RECT rcClient, edit;
int i, fieldsize; int i, fieldsize;
WCHAR EDIT[] = { 'E', 'd', 'i', 't', 0 }; static const WCHAR EDIT[] = { 'E', 'd', 'i', 't', 0 };
TRACE("\n"); TRACE("\n");
@ -291,7 +291,8 @@ static void IPADDRESS_ClearAddress (IPADDRESS_INFO *infoPtr)
static LRESULT IPADDRESS_SetAddress (IPADDRESS_INFO *infoPtr, DWORD ip_address) 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; int i;
TRACE("\n"); TRACE("\n");
@ -328,7 +329,8 @@ static void IPADDRESS_SetFocusToField (IPADDRESS_INFO *infoPtr, INT index)
static BOOL IPADDRESS_ConstrainField (IPADDRESS_INFO *infoPtr, int currentfield) static BOOL IPADDRESS_ConstrainField (IPADDRESS_INFO *infoPtr, int currentfield)
{ {
IPPART_INFO *part = &infoPtr->Part[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; int curValue, newValue;
TRACE("(currentfield=%d)\n", currentfield); TRACE("(currentfield=%d)\n", currentfield);

View File

@ -3552,7 +3552,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
{ {
UINT uFormat, uView = infoPtr->dwStyle & LVS_TYPEMASK; UINT uFormat, uView = infoPtr->dwStyle & LVS_TYPEMASK;
WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' }; 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; DWORD cdsubitemmode = CDRF_DODEFAULT;
RECT* lprcFocus, rcSelect, rcBox, rcState, rcIcon, rcLabel; RECT* lprcFocus, rcSelect, rcBox, rcState, rcIcon, rcLabel;
NMLVCUSTOMDRAW nmlvcd; NMLVCUSTOMDRAW nmlvcd;
@ -3575,7 +3575,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
if (!LISTVIEW_GetItemW(infoPtr, &lvItem)) return FALSE; if (!LISTVIEW_GetItemW(infoPtr, &lvItem)) return FALSE;
if (nSubItem > 0 && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) if (nSubItem > 0 && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
lvItem.state = LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED); 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)); TRACE(" lvItem=%s\n", debuglvitem_t(&lvItem, TRUE));
/* now check if we need to update the focus rectangle */ /* now check if we need to update the focus rectangle */

View File

@ -728,7 +728,8 @@ static void
TRACKBAR_UpdateToolTip (TRACKBAR_INFO *infoPtr) TRACKBAR_UpdateToolTip (TRACKBAR_INFO *infoPtr)
{ {
DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE); 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; TTTOOLINFOW ti;
POINT pt; POINT pt;
RECT rcClient; RECT rcClient;

View File

@ -3467,7 +3467,7 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPtr, HTREEITEM hItem)
HDC hdc; HDC hdc;
HFONT hOldFont=0; HFONT hOldFont=0;
TEXTMETRICW textMetric; 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); TRACE("%x %p\n", (unsigned)hwnd, hItem);
if (!TREEVIEW_ValidItem(infoPtr, editItem)) if (!TREEVIEW_ValidItem(infoPtr, editItem))

View File

@ -1016,8 +1016,8 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
int win98plus = 0; int win98plus = 0;
int handledPath = FALSE; int handledPath = FALSE;
OSVERSIONINFOA osVi; OSVERSIONINFOA osVi;
const WCHAR szwSlash[] = { '\\', 0 }; static const WCHAR szwSlash[] = { '\\', 0 };
const WCHAR szwStar[] = { '*',0 }; static const WCHAR szwStar[] = { '*',0 };
TBBUTTON tbb[] = TBBUTTON tbb[] =
{ {
@ -1539,7 +1539,7 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPWSTR lpstrFileList, UINT nFileCo
WCHAR lpstrNotFound[100]; WCHAR lpstrNotFound[100];
WCHAR lpstrMsg[100]; WCHAR lpstrMsg[100];
WCHAR tmp[400]; WCHAR tmp[400];
WCHAR nl[] = {'\n',0}; static const WCHAR nl[] = {'\n',0};
LoadStringW(COMDLG32_hInstance, IDS_FILENOTFOUND, lpstrNotFound, 100); LoadStringW(COMDLG32_hInstance, IDS_FILENOTFOUND, lpstrNotFound, 100);
LoadStringW(COMDLG32_hInstance, IDS_VERIFYFILE, lpstrMsg, 100); LoadStringW(COMDLG32_hInstance, IDS_VERIFYFILE, lpstrMsg, 100);
@ -1717,7 +1717,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
{ {
LPWSTR lpszTemp, lpszTemp1; LPWSTR lpszTemp, lpszTemp1;
LPITEMIDLIST pidl = NULL; LPITEMIDLIST pidl = NULL;
WCHAR szwInvalid[] = { '/',':','<','>','|', 0}; static const WCHAR szwInvalid[] = { '/',':','<','>','|', 0};
/* check for invalid chars */ /* check for invalid chars */
if((strpbrkW(lpstrPathAndFile+3, szwInvalid) != NULL) && !(fodInfos->ofnInfos->Flags & OFN_NOVALIDATE)) if((strpbrkW(lpstrPathAndFile+3, szwInvalid) != NULL) && !(fodInfos->ofnInfos->Flags & OFN_NOVALIDATE))
@ -1747,7 +1747,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
if(*lpszTemp==0) if(*lpszTemp==0)
{ {
WCHAR wszWild[] = { '*', '?', 0 }; static const WCHAR wszWild[] = { '*', '?', 0 };
/* if the last element is a wildcard do a search */ /* if the last element is a wildcard do a search */
if(strpbrkW(lpszTemp1, wszWild) != NULL) if(strpbrkW(lpszTemp1, wszWild) != NULL)
{ {
@ -1886,7 +1886,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
/* only add "." in case a default extension does exist */ /* only add "." in case a default extension does exist */
if (*fodInfos->defext != '\0') if (*fodInfos->defext != '\0')
{ {
const WCHAR szwDot[] = {'.',0}; static const WCHAR szwDot[] = {'.',0};
int PathLength = strlenW(lpstrPathAndFile); int PathLength = strlenW(lpstrPathAndFile);
strcatW(lpstrPathAndFile, szwDot); strcatW(lpstrPathAndFile, szwDot);
@ -3188,7 +3188,7 @@ static BOOL BrowseSelectedFolder(HWND hwnd)
if ( FAILED( IShellBrowser_BrowseObject( fodInfos->Shell.FOIShellBrowser, if ( FAILED( IShellBrowser_BrowseObject( fodInfos->Shell.FOIShellBrowser,
pidlSelection, SBSP_RELATIVE ) ) ) 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}; ' ','n','o','t',' ','e','x','i','s','t',0};
MessageBoxW( hwnd, notexist, fodInfos->title, MB_OK | MB_ICONEXCLAMATION ); MessageBoxW( hwnd, notexist, fodInfos->title, MB_OK | MB_ICONEXCLAMATION );
} }

View File

@ -133,18 +133,18 @@ HRESULT WINAPI DXTraceW(const char* strFile, DWORD dwLine, HRESULT hr, const WCH
TRACE("(%p,%ld,0x%08lx,%p,%d)\n", strFile, dwLine, hr, strMsg, bPopMsgBox); TRACE("(%p,%ld,0x%08lx,%p,%d)\n", strFile, dwLine, hr, strMsg, bPopMsgBox);
if (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', 'e',':',' ','%','l','d','\\','n','E','r','r','o','r',' ','C','o',
'd','e',':',' ','%','s',' ','(','0','x','%','0','8','l','x',')', 'd','e',':',' ','%','s',' ','(','0','x','%','0','8','l','x',')',
'\\','n','C','a','l','l','i','n','g',':',' ','%','s',0 }; '\\','n','C','a','l','l','i','n','g',':',' ','%','s',0 };
WCHAR caption[] = { 'U','n','e','x','p','e','c','t','e','d',' ','e','r', 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 }; 'r','o','r',' ','e','n','c','o','u','n','t','e','r','e','d',0 };
/* FIXME: should use wsnprintf */ /* FIXME: should use wsnprintf */
wsprintfW(msg, format, strFile, dwLine, wsprintfW(msg, format, strFile, dwLine,
DXGetErrorString8W(hr), hr, strMsg); DXGetErrorString8W(hr), hr, strMsg);
MessageBoxW(0, msg, caption, MB_OK|MB_ICONERROR); MessageBoxW(0, msg, caption, MB_OK|MB_ICONERROR);
} else { } else {
WCHAR format[] = { '%','s','(','%','l','d',')',':',' ','%','s',' ','(', static const WCHAR format[] = { '%','s','(','%','l','d',')',':',' ','%','s',' ','(',
'h','r','=','%','s',' ','(','0','x','%','0','8','l','x',')',')',' ', 'h','r','=','%','s',' ','(','0','x','%','0','8','l','x',')',')',' ',
0 }; 0 };
/* FIXME: should use wsnprintf */ /* FIXME: should use wsnprintf */

View File

@ -133,18 +133,18 @@ HRESULT WINAPI DXTraceW(const char* strFile, DWORD dwLine, HRESULT hr, const WCH
TRACE("(%p,%ld,0x%08lx,%p,%d)\n", strFile, dwLine, hr, strMsg, bPopMsgBox); TRACE("(%p,%ld,0x%08lx,%p,%d)\n", strFile, dwLine, hr, strMsg, bPopMsgBox);
if (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', 'e',':',' ','%','l','d','\\','n','E','r','r','o','r',' ','C','o',
'd','e',':',' ','%','s',' ','(','0','x','%','0','8','l','x',')', 'd','e',':',' ','%','s',' ','(','0','x','%','0','8','l','x',')',
'\\','n','C','a','l','l','i','n','g',':',' ','%','s',0 }; '\\','n','C','a','l','l','i','n','g',':',' ','%','s',0 };
WCHAR caption[] = { 'U','n','e','x','p','e','c','t','e','d',' ','e','r', 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 }; 'r','o','r',' ','e','n','c','o','u','n','t','e','r','e','d',0 };
/* FIXME: should use wsnprintf */ /* FIXME: should use wsnprintf */
wsprintfW(msg, format, strFile, dwLine, wsprintfW(msg, format, strFile, dwLine,
DXGetErrorString9W(hr), hr, strMsg); DXGetErrorString9W(hr), hr, strMsg);
MessageBoxW(0, msg, caption, MB_OK|MB_ICONERROR); MessageBoxW(0, msg, caption, MB_OK|MB_ICONERROR);
} else { } else {
WCHAR format[] = { '%','s','(','%','l','d',')',':',' ','%','s',' ','(', static const WCHAR format[] = { '%','s','(','%','l','d',')',':',' ','%','s',' ','(',
'h','r','=','%','s',' ','(','0','x','%','0','8','l','x',')',')',' ', 'h','r','=','%','s',' ','(','0','x','%','0','8','l','x',')',')',' ',
0 }; 0 };
/* FIXME: should use wsnprintf */ /* FIXME: should use wsnprintf */

View File

@ -2270,7 +2270,7 @@ UINT WineEngGetOutlineTextMetrics(GdiFont font, UINT cbSize,
TT_Postscript *pPost; TT_Postscript *pPost;
FT_Fixed x_scale, y_scale; FT_Fixed x_scale, y_scale;
WCHAR *family_nameW, *style_nameW; WCHAR *family_nameW, *style_nameW;
WCHAR spaceW[] = {' ', '\0'}; static const WCHAR spaceW[] = {' ', '\0'};
char *cp; char *cp;
INT ascent, descent; INT ascent, descent;

View File

@ -596,7 +596,7 @@ static void test_CreateFileW(void)
HANDLE hFile; HANDLE hFile;
WCHAR temp_path[MAX_PATH]; WCHAR temp_path[MAX_PATH];
WCHAR filename[MAX_PATH]; WCHAR filename[MAX_PATH];
WCHAR emptyW[]={'\0'}; static const WCHAR emptyW[]={'\0'};
static const WCHAR prefix[] = {'p','f','x',0}; static const WCHAR prefix[] = {'p','f','x',0};
DWORD ret; DWORD ret;
@ -668,7 +668,7 @@ static void test_DeleteFileA( void )
static void test_DeleteFileW( void ) static void test_DeleteFileW( void )
{ {
BOOL ret; BOOL ret;
WCHAR emptyW[]={'\0'}; static const WCHAR emptyW[]={'\0'};
ret = DeleteFileW(NULL); ret = DeleteFileW(NULL);
if (ret==0 && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED) if (ret==0 && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED)

View File

@ -42,7 +42,7 @@ void test_message_from_string(void)
{ {
CHAR out[0x100] = {0}; CHAR out[0x100] = {0};
DWORD r; DWORD r;
WCHAR szwTest[] = { 't','e','s','t',0}; static const WCHAR szwTest[] = { 't','e','s','t',0};
/* the basics */ /* the basics */
r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "test", 0, r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "test", 0,

View File

@ -191,7 +191,7 @@ static void test_RtlInitUnicodeString(void)
static void test_RtlInitUnicodeStringEx(void) 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; WCHAR *teststring2;
UNICODE_STRING uni; UNICODE_STRING uni;
NTSTATUS result; NTSTATUS result;

View File

@ -539,7 +539,7 @@ HRESULT WINAPI AntiMonikerImpl_GetDisplayName(IMoniker* iface,
IMoniker* pmkToLeft, IMoniker* pmkToLeft,
LPOLESTR *ppszDisplayName) LPOLESTR *ppszDisplayName)
{ {
WCHAR back[]={'\\','.','.',0}; static const WCHAR back[]={'\\','.','.',0};
TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,ppszDisplayName); TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,ppszDisplayName);

View File

@ -473,8 +473,8 @@ HRESULT WINAPI FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR lpszPa
int nb=0,i; int nb=0,i;
int sizeStr=lstrlenW(lpszPathName); int sizeStr=lstrlenW(lpszPathName);
LPOLESTR *tabStr=0; LPOLESTR *tabStr=0;
WCHAR twoPoint[]={'.','.',0}; static const WCHAR twoPoint[]={'.','.',0};
WCHAR bkSlash[]={'\\',0}; static const WCHAR bkSlash[]={'\\',0};
BYTE addBkSlash; BYTE addBkSlash;
TRACE("(%p,%p)\n",This,lpszPathName); TRACE("(%p,%p)\n",This,lpszPathName);
@ -751,8 +751,8 @@ HRESULT WINAPI FileMonikerImpl_ComposeWith(IMoniker* iface,
{ {
HRESULT res; HRESULT res;
LPOLESTR str1=0,str2=0,*strDec1=0,*strDec2=0,newStr=0; LPOLESTR str1=0,str2=0,*strDec1=0,*strDec2=0,newStr=0;
WCHAR twoPoint[]={'.','.',0}; static const WCHAR twoPoint[]={'.','.',0};
WCHAR bkSlash[]={'\\',0}; static const WCHAR bkSlash[]={'\\',0};
IBindCtx *bind=0; IBindCtx *bind=0;
int i=0,j=0,lastIdx1=0,lastIdx2=0; int i=0,j=0,lastIdx1=0,lastIdx2=0;
DWORD mkSys; DWORD mkSys;
@ -1098,7 +1098,7 @@ HRESULT WINAPI FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOth
******************************************************************************/ ******************************************************************************/
int WINAPI FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable) int WINAPI FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable)
{ {
WCHAR bSlash[] = {'\\',0}; static const WCHAR bSlash[] = {'\\',0};
WCHAR word[MAX_PATH]; WCHAR word[MAX_PATH];
int i=0,j,tabIndex=0; int i=0,j,tabIndex=0;
LPOLESTR *strgtable ; LPOLESTR *strgtable ;
@ -1157,7 +1157,7 @@ HRESULT WINAPI FileMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther,
HRESULT res; HRESULT res;
LPOLESTR str1=0,str2=0,*tabStr1=0,*tabStr2=0,relPath=0; LPOLESTR str1=0,str2=0,*tabStr1=0,*tabStr2=0,relPath=0;
DWORD len1=0,len2=0,sameIdx=0,j=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); TRACE("(%p,%p,%p)\n",iface,pmOther,ppmkRelPath);

View File

@ -5445,7 +5445,7 @@ HRESULT WINAPI StgCreateDocfile(
if (pwcsName == 0) if (pwcsName == 0)
{ {
WCHAR tempPath[MAX_PATH]; WCHAR tempPath[MAX_PATH];
WCHAR prefix[] = { 'S', 'T', 'O', 0 }; static const WCHAR prefix[] = { 'S', 'T', 'O', 0 };
if (!(grfMode & STGM_SHARE_EXCLUSIVE)) if (!(grfMode & STGM_SHARE_EXCLUSIVE))
return STG_E_INVALIDFLAG; return STG_E_INVALIDFLAG;
@ -6424,7 +6424,7 @@ void OLECONVERT_GetOLE20FromOLE10(LPSTORAGE pDestStorage, BYTE *pBuffer, DWORD n
IStorage *pTempStorage; IStorage *pTempStorage;
DWORD dwNumOfBytesWritten; DWORD dwNumOfBytesWritten;
WCHAR wstrTempDir[MAX_PATH], wstrTempFile[MAX_PATH]; 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 */ /* Create a temp File */
GetTempPathW(MAX_PATH, wstrTempDir); GetTempPathW(MAX_PATH, wstrTempDir);
@ -6474,7 +6474,7 @@ DWORD OLECONVERT_WriteOLE20ToBuffer(LPSTORAGE pStorage, BYTE **pData)
DWORD nDataLength = 0; DWORD nDataLength = 0;
IStorage *pTempStorage; IStorage *pTempStorage;
WCHAR wstrTempDir[MAX_PATH], wstrTempFile[MAX_PATH]; WCHAR wstrTempDir[MAX_PATH], wstrTempFile[MAX_PATH];
WCHAR wstrPrefix[] = {'s', 'i', 's', 0}; static const WCHAR wstrPrefix[] = {'s', 'i', 's', 0};
*pData = NULL; *pData = NULL;
@ -6527,7 +6527,7 @@ void OLECONVERT_CreateOleStream(LPSTORAGE pStorage)
{ {
HRESULT hRes; HRESULT hRes;
IStream *pStream; IStream *pStream;
WCHAR wstrStreamName[] = {1,'O', 'l', 'e', 0}; static const WCHAR wstrStreamName[] = {1,'O', 'l', 'e', 0};
BYTE pOleStreamHeader [] = BYTE pOleStreamHeader [] =
{ {
0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
@ -6616,7 +6616,7 @@ static HRESULT STORAGE_WriteCompObj( LPSTORAGE pstg, CLSID *clsid,
{ {
IStream *pstm; IStream *pstm;
HRESULT r = S_OK; 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] = static const BYTE unknown1[12] =
{ 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, { 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
@ -6855,7 +6855,7 @@ HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName
IStream *pStream; IStream *pStream;
HRESULT hStorageRes, hRes = S_OK; HRESULT hStorageRes, hRes = S_OK;
OLECONVERT_ISTORAGE_COMPOBJ IStorageCompObj; 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]; WCHAR bufferW[OLESTREAM_MAX_STR_LEN];
BYTE pCompObjUnknown1[] = {0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF}; BYTE pCompObjUnknown1[] = {0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF};
@ -6956,7 +6956,7 @@ void OLECONVERT_CreateOlePresStream(LPSTORAGE pStorage, DWORD dwExtentX, DWORD d
{ {
HRESULT hRes; HRESULT hRes;
IStream *pStream; 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 [] = BYTE pOlePresStreamHeader [] =
{ {
0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00,
@ -7040,7 +7040,7 @@ void OLECONVERT_CreateOle10NativeStream(LPSTORAGE pStorage, BYTE *pData, DWORD d
{ {
HRESULT hRes; HRESULT hRes;
IStream *pStream; 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 */ /* Create the Ole10Native Stream */
hRes = IStorage_CreateStream(pStorage, wstrStreamName, hRes = IStorage_CreateStream(pStorage, wstrStreamName,
@ -7081,7 +7081,7 @@ HRESULT OLECONVERT_GetOLE10ProgID(LPSTORAGE pStorage, char *strProgID, DWORD *dw
IStream *pStream; IStream *pStream;
LARGE_INTEGER iSeekPos; LARGE_INTEGER iSeekPos;
OLECONVERT_ISTORAGE_COMPOBJ CompObj; 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 */ /* Open the CompObj Stream */
hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL, hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL,
@ -7150,7 +7150,7 @@ void OLECONVERT_GetOle10PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *
HRESULT hRes; HRESULT hRes;
IStream *pStream; 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 */ /* Initialize Default data for OLESTREAM */
pOleStreamData[0].dwOleID = OLESTREAM_ID; pOleStreamData[0].dwOleID = OLESTREAM_ID;
@ -7203,7 +7203,7 @@ void OLECONVERT_GetOle20PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *
HRESULT hRes; HRESULT hRes;
IStream *pStream; IStream *pStream;
OLECONVERT_ISTORAGE_OLEPRES olePress; 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 */ /* Initialize Default data for OLESTREAM */
pOleStreamData[0].dwOleID = OLESTREAM_ID; pOleStreamData[0].dwOleID = OLESTREAM_ID;
@ -7384,7 +7384,7 @@ HRESULT WINAPI OleConvertIStorageToOLESTREAM (
HRESULT hRes = S_OK; HRESULT hRes = S_OK;
IStream *pStream; IStream *pStream;
OLECONVERT_OLESTREAM_DATA pOleStreamData[2]; 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)); memset(pOleStreamData, 0, sizeof(pOleStreamData));

View File

@ -1214,7 +1214,7 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo(
LCID lcid, LCID lcid,
ITypeInfo** ppTInfo) 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; ITypeLib *tl;
HRESULT hres; HRESULT hres;

View File

@ -308,7 +308,7 @@ HRESULT WINAPI LoadTypeLibEx(
return TYPE_E_CANTLOADLIBRARY; return TYPE_E_CANTLOADLIBRARY;
} else { } else {
WCHAR tstpath[260]; 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; int i;
lstrcpyW(tstpath,szFile); lstrcpyW(tstpath,szFile);

View File

@ -193,7 +193,7 @@ static HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName,
HKEY hkeyMediaType = NULL; HKEY hkeyMediaType = NULL;
HRESULT hr = S_OK; HRESULT hr = S_OK;
BOOL bFound = FALSE; 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(majorType, &GUID_NULL, sizeof(*majorType));
CopyMemory(minorType, &GUID_NULL, sizeof(*minorType)); CopyMemory(minorType, &GUID_NULL, sizeof(*minorType));

View File

@ -120,7 +120,7 @@ BOOL WINAPI SetupQuerySpaceRequiredOnDriveA(HDSKSPC DiskSpace,
int i; int i;
LPDISKSPACELIST list = (LPDISKSPACELIST)DiskSpace; LPDISKSPACELIST list = (LPDISKSPACELIST)DiskSpace;
BOOL rc = FALSE; BOOL rc = FALSE;
WCHAR bkslsh[]= {'\\',0}; static const WCHAR bkslsh[]= {'\\',0};
MultiByteToWideChar(CP_ACP,0,DriveSpec,-1,driveW,20); MultiByteToWideChar(CP_ACP,0,DriveSpec,-1,driveW,20);

View File

@ -356,8 +356,8 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
/* get the type name */ /* get the type name */
if (SUCCEEDED(hr) && (flags & SHGFI_TYPENAME)) if (SUCCEEDED(hr) && (flags & SHGFI_TYPENAME))
{ {
WCHAR szFile[] = { 'F','i','l','e',0 }; static const WCHAR szFile[] = { 'F','i','l','e',0 };
WCHAR szDashFile[] = { '-','f','i','l','e',0 }; static const WCHAR szDashFile[] = { '-','f','i','l','e',0 };
if (!(flags & SHGFI_USEFILEATTRIBUTES)) if (!(flags & SHGFI_USEFILEATTRIBUTES))
{ {
char ftype[80]; char ftype[80];
@ -428,7 +428,7 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
psfi->iIcon = 2; psfi->iIcon = 2;
else else
{ {
WCHAR p1W[] = {'%','1',0}; static const WCHAR p1W[] = {'%','1',0};
psfi->iIcon = 0; psfi->iIcon = 0;
szExt = (LPWSTR) PathFindExtensionW(sTemp); szExt = (LPWSTR) PathFindExtensionW(sTemp);
if ( szExt && HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) if ( szExt && HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE)

View File

@ -53,9 +53,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
#define FO_MASK 0xF #define FO_MASK 0xF
CHAR aWildcardFile[] = {'*','.','*',0}; CHAR aWildcardFile[] = {'*','.','*',0};
WCHAR wWildcardFile[] = {'*','.','*',0}; static const WCHAR wWildcardFile[] = {'*','.','*',0};
WCHAR wWildcardChars[] = {'*','?',0}; static const WCHAR wWildcardChars[] = {'*','?',0};
WCHAR wBackslash[] = {'\\',0}; static const WCHAR wBackslash[] = {'\\',0};
static DWORD SHNotifyCreateDirectoryA(LPCSTR path, LPSECURITY_ATTRIBUTES sec); static DWORD SHNotifyCreateDirectoryA(LPCSTR path, LPSECURITY_ATTRIBUTES sec);
static DWORD SHNotifyCreateDirectoryW(LPCWSTR path, LPSECURITY_ATTRIBUTES sec); static DWORD SHNotifyCreateDirectoryW(LPCWSTR path, LPSECURITY_ATTRIBUTES sec);

View File

@ -1076,7 +1076,7 @@ DWORD WINAPI SHSetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue,
{ {
DWORD dwRet = ERROR_SUCCESS, dwDummy; DWORD dwRet = ERROR_SUCCESS, dwDummy;
HKEY hSubKey; HKEY hSubKey;
WCHAR szEmpty[] = { '\0' }; static const WCHAR szEmpty[] = { '\0' };
TRACE("(hkey=%p,%s,%s,%ld,%p,%ld)\n", hKey, debugstr_w(lpszSubKey), TRACE("(hkey=%p,%s,%s,%ld,%p,%ld)\n", hKey, debugstr_w(lpszSubKey),
debugstr_w(lpszValue), dwType, pvData, cbData); debugstr_w(lpszValue), dwType, pvData, cbData);

View File

@ -2530,7 +2530,7 @@ DWORD WINAPI SHAnsiToUnicode(LPCSTR lpSrcStr, LPWSTR lpDstStr, int iLen)
INT WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr, INT WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr,
LPINT lpiLen) LPINT lpiLen)
{ {
WCHAR emptyW[] = { '\0' }; static const WCHAR emptyW[] = { '\0' };
int len , reqLen; int len , reqLen;
LPSTR mem; LPSTR mem;

View File

@ -687,8 +687,8 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
DWORD myflags, sizeloc = 0; DWORD myflags, sizeloc = 0;
DWORD len, res1, res2, process_case = 0; DWORD len, res1, res2, process_case = 0;
LPWSTR work, preliminary, mbase, mrelative; LPWSTR work, preliminary, mbase, mrelative;
WCHAR myfilestr[] = {'f','i','l','e',':','/','/','/','\0'}; static const WCHAR myfilestr[] = {'f','i','l','e',':','/','/','/','\0'};
WCHAR single_slash[] = {'/','\0'}; static const WCHAR single_slash[] = {'/','\0'};
HRESULT ret; HRESULT ret;
TRACE("(base %s, Relative %s, Combine size %ld, flags %08lx)\n", TRACE("(base %s, Relative %s, Combine size %ld, flags %08lx)\n",

View File

@ -45,8 +45,8 @@ static LRESULT WINAPI ClassTest_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPA
static void ClassTest(HINSTANCE hInstance, BOOL global) static void ClassTest(HINSTANCE hInstance, BOOL global)
{ {
WNDCLASSW cls, wc; WNDCLASSW cls, wc;
WCHAR className[] = {'T','e','s','t','C','l','a','s','s',0}; static const 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 winName[] = {'W','i','n','C','l','a','s','s','T','e','s','t',0};
ATOM test_atom; ATOM test_atom;
HWND hTestWnd; HWND hTestWnd;
DWORD i; DWORD i;

View File

@ -78,13 +78,13 @@ HRESULT MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWST
HMODULE hTheme; HMODULE hTheme;
HRSRC hrsc; HRSRC hrsc;
HRESULT hr = S_OK; 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' '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' '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' 'S','I','Z','E','N','A','M','E','S','\0'
}; };
@ -250,7 +250,7 @@ PUXINI_FILE MSSTYLES_GetThemeIni(PTHEME_FILE tf)
*/ */
PUXINI_FILE MSSTYLES_GetActiveThemeIni(PTHEME_FILE tf) 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' 'F','I','L','E','R','E','S','N','A','M','E','S','\0'
}; };
DWORD dwColorCount = 0; DWORD dwColorCount = 0;
@ -661,8 +661,8 @@ PTHEME_PROPERTY MSSTYLES_AddMetric(PTHEME_FILE tf, int iPropertyPrimitive, int i
*/ */
void MSSTYLES_ParseThemeIni(PTHEME_FILE tf) void MSSTYLES_ParseThemeIni(PTHEME_FILE tf)
{ {
WCHAR szSysMetrics[] = {'S','y','s','M','e','t','r','i','c','s','\0'}; static const 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 szGlobals[] = {'g','l','o','b','a','l','s','\0'};
PTHEME_CLASS cls; PTHEME_CLASS cls;
PTHEME_CLASS globals; PTHEME_CLASS globals;
PTHEME_PARTSTATE ps; PTHEME_PARTSTATE ps;

View File

@ -602,10 +602,10 @@ HRESULT WINAPI EnumThemes(LPCWSTR pszThemePath, EnumThemeProc callback,
{ {
WCHAR szDir[MAX_PATH]; WCHAR szDir[MAX_PATH];
WCHAR szPath[MAX_PATH]; WCHAR szPath[MAX_PATH];
WCHAR szStar[] = {'*','.','*','\0'}; static const WCHAR szStar[] = {'*','.','*','\0'};
WCHAR szFormat[] = {'%','s','%','s','\\','%','s','.','m','s','s','t','y','l','e','s','\0'}; static const 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'}; static const 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 szTooltip[] = {'t','o','o','l','t','i','p','\0'};
WCHAR szName[60]; WCHAR szName[60];
WCHAR szTip[60]; WCHAR szTip[60];
HANDLE hFind; HANDLE hFind;