From ebf0eb3138afec4a7763c65123fca1536d363709 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Tue, 20 Apr 2004 00:34:52 +0000 Subject: [PATCH] Make static Unicode strings const. --- controls/icontitle.c | 2 +- dlls/comctl32/propsheet.c | 2 +- dlls/msacm/format.c | 4 ++-- dlls/msacm/imaadp32/imaadp32.c | 4 ++-- dlls/msacm/internal.c | 10 +++++----- dlls/msacm/msadp32/msadp32.c | 4 ++-- dlls/msacm/msg711/msg711.c | 6 +++--- dlls/msacm/wineacm.h | 2 +- dlls/msacm/winemp3/mpegl3.c | 4 ++-- dlls/msvideo/msvideo_main.c | 2 +- dlls/oleaut32/tests/vartest.c | 8 ++++---- dlls/secur32/secur32.c | 2 +- dlls/shlwapi/path.c | 4 ++-- dlls/urlmon/umon.c | 2 +- dlls/uxtheme/msstyles.c | 8 ++++---- dlls/winmm/playsound.c | 12 ++++++------ dlls/wsock32/protocol.c | 10 +++++----- programs/wineconsole/dialog.c | 4 ++-- programs/wineconsole/user.c | 2 +- tools/wmc/mcl.c | 4 ++-- 20 files changed, 48 insertions(+), 48 deletions(-) diff --git a/controls/icontitle.c b/controls/icontitle.c index 9f89c4e29c6..b49cba2b78e 100644 --- a/controls/icontitle.c +++ b/controls/icontitle.c @@ -86,7 +86,7 @@ HWND ICONTITLE_Create( HWND owner ) */ static BOOL ICONTITLE_SetTitlePos( HWND hwnd, HWND owner ) { - static WCHAR emptyTitleText[] = {'<','.','.','.','>',0}; + static const WCHAR emptyTitleText[] = {'<','.','.','.','>',0}; WCHAR str[80]; HDC hDC; HFONT hPrevFont; diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c index 3ee7de384c5..20b4a910ce9 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c @@ -524,7 +524,7 @@ BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp, { WCHAR szTitle[256]; const WCHAR *pTitle; - static WCHAR pszNull[] = { '(','n','u','l','l',')',0 }; + static const WCHAR pszNull[] = { '(','n','u','l','l',')',0 }; int len; if ( !HIWORD( lppsp->pszTitle ) ) diff --git a/dlls/msacm/format.c b/dlls/msacm/format.c index b6825689140..acdf7cf95bc 100644 --- a/dlls/msacm/format.c +++ b/dlls/msacm/format.c @@ -317,8 +317,8 @@ MMRESULT WINAPI acmFormatDetailsA(HACMDRIVER had, PACMFORMATDETAILSA pafd, MMRESULT WINAPI acmFormatDetailsW(HACMDRIVER had, PACMFORMATDETAILSW pafd, DWORD fdwDetails) { MMRESULT mmr; - static WCHAR fmt1[] = {'%','d',' ','H','z',0}; - static WCHAR fmt2[] = {';',' ','%','d',' ','b','i','t','s',0}; + static const WCHAR fmt1[] = {'%','d',' ','H','z',0}; + static const WCHAR fmt2[] = {';',' ','%','d',' ','b','i','t','s',0}; ACMFORMATTAGDETAILSA aftd; TRACE("(%p, %p, %ld)\n", had, pafd, fdwDetails); diff --git a/dlls/msacm/imaadp32/imaadp32.c b/dlls/msacm/imaadp32/imaadp32.c index 61d3d00c2bc..a4a3535d137 100644 --- a/dlls/msacm/imaadp32/imaadp32.c +++ b/dlls/msacm/imaadp32/imaadp32.c @@ -499,8 +499,8 @@ static LRESULT ADPCM_DriverDetails(PACMDRIVERDETAILSW add) */ static LRESULT ADPCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) { - static WCHAR szPcm[]={'P','C','M',0}; - static WCHAR szImaAdPcm[]={'I','M','A',' ','A','d','P','C','M',0}; + static const WCHAR szPcm[]={'P','C','M',0}; + static const WCHAR szImaAdPcm[]={'I','M','A',' ','A','d','P','C','M',0}; switch (dwQuery) { diff --git a/dlls/msacm/internal.c b/dlls/msacm/internal.c index d54c7640214..ab801a1b9f1 100644 --- a/dlls/msacm/internal.c +++ b/dlls/msacm/internal.c @@ -236,7 +236,7 @@ static BOOL MSACM_WriteCache(PWINE_ACMDRIVERID padid) /*********************************************************************** * MSACM_RegisterDriver() */ -PWINE_ACMDRIVERID MSACM_RegisterDriver(LPWSTR pszDriverAlias, LPWSTR pszFileName, +PWINE_ACMDRIVERID MSACM_RegisterDriver(LPCWSTR pszDriverAlias, LPCWSTR pszFileName, HINSTANCE hinstModule) { PWINE_ACMDRIVERID padid; @@ -285,10 +285,10 @@ void MSACM_RegisterAllDrivers(void) { LPWSTR pszBuffer; DWORD dwBufferLength; - static WCHAR msacm32[] = {'m','s','a','c','m','3','2','.','d','l','l','\0'}; - static WCHAR msacmW[] = {'M','S','A','C','M','.'}; - static WCHAR drv32[] = {'d','r','i','v','e','r','s','3','2','\0'}; - static WCHAR sys[] = {'s','y','s','t','e','m','.','i','n','i','\0'}; + static const WCHAR msacm32[] = {'m','s','a','c','m','3','2','.','d','l','l','\0'}; + static const WCHAR msacmW[] = {'M','S','A','C','M','.'}; + static const WCHAR drv32[] = {'d','r','i','v','e','r','s','3','2','\0'}; + static const WCHAR sys[] = {'s','y','s','t','e','m','.','i','n','i','\0'}; /* FIXME * What if the user edits system.ini while the program is running? diff --git a/dlls/msacm/msadp32/msadp32.c b/dlls/msacm/msadp32/msadp32.c index dae681c9c90..bf17154537e 100644 --- a/dlls/msacm/msadp32/msadp32.c +++ b/dlls/msacm/msadp32/msadp32.c @@ -345,8 +345,8 @@ static LRESULT ADPCM_DriverDetails(PACMDRIVERDETAILSW add) */ static LRESULT ADPCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) { - static WCHAR szPcm[]={'P','C','M',0}; - static WCHAR szMsAdPcm[]={'M','S',' ','A','d','P','C','M',0}; + static const WCHAR szPcm[]={'P','C','M',0}; + static const WCHAR szMsAdPcm[]={'M','S',' ','A','d','P','C','M',0}; switch (dwQuery) { diff --git a/dlls/msacm/msg711/msg711.c b/dlls/msacm/msg711/msg711.c index 1f043691b99..d4d76233904 100644 --- a/dlls/msacm/msg711/msg711.c +++ b/dlls/msacm/msg711/msg711.c @@ -682,9 +682,9 @@ static LRESULT G711_DriverDetails(PACMDRIVERDETAILSW add) */ static LRESULT G711_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) { - static WCHAR szPcm[]={'P','C','M',0}; - static WCHAR szALaw[]={'A','-','L','a','w',0}; - static WCHAR szULaw[]={'U','-','L','a','w',0}; + static const WCHAR szPcm[]={'P','C','M',0}; + static const WCHAR szALaw[]={'A','-','L','a','w',0}; + static const WCHAR szULaw[]={'U','-','L','a','w',0}; switch (dwQuery) { diff --git a/dlls/msacm/wineacm.h b/dlls/msacm/wineacm.h index 702ab0105b5..4f781b41d43 100644 --- a/dlls/msacm/wineacm.h +++ b/dlls/msacm/wineacm.h @@ -337,7 +337,7 @@ typedef struct _WINE_ACMDRIVERID extern HANDLE MSACM_hHeap; extern PWINE_ACMDRIVERID MSACM_pFirstACMDriverID; extern PWINE_ACMDRIVERID MSACM_pLastACMDriverID; -extern PWINE_ACMDRIVERID MSACM_RegisterDriver(LPWSTR pszDriverAlias, LPWSTR pszFileName, +extern PWINE_ACMDRIVERID MSACM_RegisterDriver(LPCWSTR pszDriverAlias, LPCWSTR pszFileName, HINSTANCE hinstModule); extern void MSACM_RegisterAllDrivers(void); extern PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p); diff --git a/dlls/msacm/winemp3/mpegl3.c b/dlls/msacm/winemp3/mpegl3.c index 466eeba7cdc..c710a01db1a 100644 --- a/dlls/msacm/winemp3/mpegl3.c +++ b/dlls/msacm/winemp3/mpegl3.c @@ -200,8 +200,8 @@ static LRESULT MPEG3_DriverDetails(PACMDRIVERDETAILSW add) */ static LRESULT MPEG3_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) { - static WCHAR szPcm[]={'P','C','M',0}; - static WCHAR szMpeg3[]={'M','P','e','g','3',0}; + static const WCHAR szPcm[]={'P','C','M',0}; + static const WCHAR szMpeg3[]={'M','P','e','g','3',0}; switch (dwQuery) { diff --git a/dlls/msvideo/msvideo_main.c b/dlls/msvideo/msvideo_main.c index ac5857e8c46..35eac439b55 100644 --- a/dlls/msvideo/msvideo_main.c +++ b/dlls/msvideo/msvideo_main.c @@ -272,7 +272,7 @@ HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode) HDRVR hdrv; WINE_HIC* whic; BOOL bIs16; - static WCHAR drv32W[] = {'d','r','i','v','e','r','s','3','2','\0'}; + static const WCHAR drv32W[] = {'d','r','i','v','e','r','s','3','2','\0'}; reg_driver* driver; TRACE("(%s,%s,0x%08x)\n", wine_dbgstr_fcc(fccType), wine_dbgstr_fcc(fccHandler), wMode); diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index 135ca8d01bb..43cdfe89689 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -1316,10 +1316,10 @@ static void test_VariantTimeToDosDateTime(void) static void test_VarFormatNumber(void) { - static WCHAR szSrc1[] = { '1','\0' }; - static WCHAR szResult1[] = { '1','.','0','0','\0' }; - static WCHAR szSrc2[] = { '-','1','\0' }; - static WCHAR szResult2[] = { '(','1','.','0','0',')','\0' }; + static const WCHAR szSrc1[] = { '1','\0' }; + static const WCHAR szResult1[] = { '1','.','0','0','\0' }; + static const WCHAR szSrc2[] = { '-','1','\0' }; + static const WCHAR szResult2[] = { '(','1','.','0','0',')','\0' }; char buff[8]; HRESULT hres; VARIANT v; diff --git a/dlls/secur32/secur32.c b/dlls/secur32/secur32.c index 2b5145882b9..fcc494dc85b 100644 --- a/dlls/secur32/secur32.c +++ b/dlls/secur32/secur32.c @@ -546,7 +546,7 @@ static void _tryLoadProvider(PWSTR moduleName) WARN("failed to load %s\n", debugstr_w(moduleName)); } -static WCHAR securityProvidersKeyW[] = { +static const WCHAR securityProvidersKeyW[] = { 'S','Y','S','T','E','M','\\','C','u','r','r','e','n','t','C','o','n','t','r', 'o','l','S','e','t','\\','C','o','n','t','r','o','l','\\','S','e','c','u','r', 'i','t','y','P','r','o','v','i','d','e','r','s','\0' diff --git a/dlls/shlwapi/path.c b/dlls/shlwapi/path.c index 536e35fd762..f183af11a2b 100644 --- a/dlls/shlwapi/path.c +++ b/dlls/shlwapi/path.c @@ -1140,8 +1140,8 @@ BOOL WINAPI PathFileExistsDefExtA(LPSTR lpszPath,DWORD dwWhich) */ static BOOL WINAPI SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich) { - static WCHAR szSystem[] = { 'S','y','s','t','e','m','\0'}; - static WCHAR szPath[] = { 'P','A','T','H','\0'}; + static const WCHAR szSystem[] = { 'S','y','s','t','e','m','\0'}; + static const WCHAR szPath[] = { 'P','A','T','H','\0'}; DWORD dwLenPATH; LPCWSTR lpszCurr; WCHAR *lpszPATH; diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c index f5d6561d574..6d389304b7e 100644 --- a/dlls/urlmon/umon.c +++ b/dlls/urlmon/umon.c @@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon); /* native urlmon.dll uses this key, too */ -static WCHAR BSCBHolder[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 }; +static const WCHAR BSCBHolder[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 }; /*static BOOL registered_wndclass = FALSE;*/ diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c index 9f63afee313..ccf2a8ac727 100644 --- a/dlls/uxtheme/msstyles.c +++ b/dlls/uxtheme/msstyles.c @@ -960,10 +960,10 @@ HRESULT MSSTYLES_GetPropertyColor(PTHEME_PROPERTY tp, COLORREF *pColor) */ HRESULT MSSTYLES_GetPropertyFont(PTHEME_PROPERTY tp, HDC hdc, LOGFONTW *pFont) { - const WCHAR szBold[] = {'b','o','l','d','\0'}; - const WCHAR szItalic[] = {'i','t','a','l','i','c','\0'}; - const WCHAR szUnderline[] = {'u','n','d','e','r','l','i','n','e','\0'}; - const WCHAR szStrikeOut[] = {'s','t','r','i','k','e','o','u','t','\0'}; + static const WCHAR szBold[] = {'b','o','l','d','\0'}; + static const WCHAR szItalic[] = {'i','t','a','l','i','c','\0'}; + static const WCHAR szUnderline[] = {'u','n','d','e','r','l','i','n','e','\0'}; + static const WCHAR szStrikeOut[] = {'s','t','r','i','k','e','o','u','t','\0'}; int pointSize; WCHAR attr[32]; LPCWSTR lpCur = tp->lpValue; diff --git a/dlls/winmm/playsound.c b/dlls/winmm/playsound.c index e2e928b8dc8..39f5d4e006e 100644 --- a/dlls/winmm/playsound.c +++ b/dlls/winmm/playsound.c @@ -62,13 +62,13 @@ static HMMIO get_mmioFromProfile(UINT uFlags, LPCWSTR lpszName) HKEY hRegSnd, hRegApp, hScheme, hSnd; DWORD err, type, count; - static WCHAR wszSounds[] = {'S','o','u','n','d','s',0}; - static WCHAR wszDefault[] = {'D','e','f','a','u','l','t',0}; - static WCHAR wszKey[] = {'A','p','p','E','v','e','n','t','s','\\', + static const WCHAR wszSounds[] = {'S','o','u','n','d','s',0}; + static const WCHAR wszDefault[] = {'D','e','f','a','u','l','t',0}; + static const WCHAR wszKey[] = {'A','p','p','E','v','e','n','t','s','\\', 'S','c','h','e','m','e','s','\\', 'A','p','p','s',0}; - static WCHAR wszDotDefault[] = {'.','D','e','f','a','u','l','t',0}; - static WCHAR wszNull[] = {0}; + static const WCHAR wszDotDefault[] = {'.','D','e','f','a','u','l','t',0}; + static const WCHAR wszNull[] = {0}; TRACE("searching in SystemSound list for %s\n", debugstr_w(lpszName)); GetProfileStringW(wszSounds, (LPWSTR)lpszName, wszNull, str, sizeof(str)/sizeof(str[0])); @@ -257,7 +257,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg) /* if resource, grab it */ if ((wps->fdwSound & SND_RESOURCE) == SND_RESOURCE) { - static WCHAR wszWave[] = {'W','A','V','E',0}; + static const WCHAR wszWave[] = {'W','A','V','E',0}; HRSRC hRes; HGLOBAL hGlob; diff --git a/dlls/wsock32/protocol.c b/dlls/wsock32/protocol.c index 03b0b8a9136..864dab09f2b 100644 --- a/dlls/wsock32/protocol.c +++ b/dlls/wsock32/protocol.c @@ -53,11 +53,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(winsock); /* name of the protocols */ -static WCHAR NameIpx[] = {'I', 'P', 'X', '\0'}; -static WCHAR NameSpx[] = {'S', 'P', 'X', '\0'}; -static WCHAR NameSpxII[] = {'S', 'P', 'X', ' ', 'I', 'I', '\0'}; -static WCHAR NameTcp[] = {'T', 'C', 'P', '/', 'I', 'P', '\0'}; -static WCHAR NameUdp[] = {'U', 'D', 'P', '/', 'I', 'P', '\0'}; +static const WCHAR NameIpx[] = {'I', 'P', 'X', '\0'}; +static const WCHAR NameSpx[] = {'S', 'P', 'X', '\0'}; +static const WCHAR NameSpxII[] = {'S', 'P', 'X', ' ', 'I', 'I', '\0'}; +static const WCHAR NameTcp[] = {'T', 'C', 'P', '/', 'I', 'P', '\0'}; +static const WCHAR NameUdp[] = {'U', 'D', 'P', '/', 'I', 'P', '\0'}; /***************************************************************************** * WSOCK32_EnterSingleProtocol [internal] diff --git a/programs/wineconsole/dialog.c b/programs/wineconsole/dialog.c index 6ca66963ce7..ef60b869a57 100644 --- a/programs/wineconsole/dialog.c +++ b/programs/wineconsole/dialog.c @@ -608,8 +608,8 @@ static BOOL WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR SendDlgItemMessage(hDlg, IDC_CNF_CLOSE_EXIT, BM_SETCHECK, (di->config.exit_on_die) ? BST_CHECKED : BST_UNCHECKED, 0L); { - static WCHAR s1[] = {'W','i','n','3','2',0}; - static WCHAR s2[] = {'E','m','a','c','s',0}; + static const WCHAR s1[] = {'W','i','n','3','2',0}; + static const WCHAR s2[] = {'E','m','a','c','s',0}; SendDlgItemMessage(hDlg, IDC_CNF_EDITION_MODE, CB_ADDSTRING, 0, (LPARAM)s1); diff --git a/programs/wineconsole/user.c b/programs/wineconsole/user.c index 222fe558383..2ef463ee0c9 100644 --- a/programs/wineconsole/user.c +++ b/programs/wineconsole/user.c @@ -1355,7 +1355,7 @@ static int WCUSER_MainLoop(struct inner_data* data) */ enum init_return WCUSER_InitBackend(struct inner_data* data) { - static WCHAR wClassName[] = {'W','i','n','e','C','o','n','s','o','l','e','C','l','a','s','s',0}; + static const WCHAR wClassName[] = {'W','i','n','e','C','o','n','s','o','l','e','C','l','a','s','s',0}; WNDCLASS wndclass; diff --git a/tools/wmc/mcl.c b/tools/wmc/mcl.c index 5dbf989073a..e1120ba6285 100644 --- a/tools/wmc/mcl.c +++ b/tools/wmc/mcl.c @@ -588,8 +588,8 @@ void get_tokentable(token_t **tab, int *len) */ int yylex(void) { - static WCHAR ustr_dot1[] = { '.', '\n', 0 }; - static WCHAR ustr_dot2[] = { '.', '\r', '\n', 0 }; + static const WCHAR ustr_dot1[] = { '.', '\n', 0 }; + static const WCHAR ustr_dot2[] = { '.', '\r', '\n', 0 }; static int isinit = 0; int ch;