Make Unicode strings 'static const'.

This commit is contained in:
Francois Gouget 2004-04-20 02:14:00 +00:00 committed by Alexandre Julliard
parent 52c0832161
commit 8fc374d8b4
9 changed files with 32 additions and 32 deletions

View File

@ -62,8 +62,7 @@ static int init_wksta_tests(void)
static void run_get_comp_name_tests(void)
{
WCHAR empty[] = {0};
LPWSTR ws = empty;
LPWSTR ws = NULL;
if (!pNetpGetComputerName)
return;

View File

@ -6663,7 +6663,7 @@ static HRESULT CLSIDFromUserType(LPCWSTR lpszUserType, CLSID *clsid)
HKEY hkey, hkeyclsid;
LPWSTR buffer = NULL;
BOOL found = FALSE;
const WCHAR szclsid[] = { 'C','L','S','I','D',0 };
static const WCHAR szclsid[] = { 'C','L','S','I','D',0 };
TRACE("Finding CLSID for %s\n", debugstr_w(lpszUserType));
@ -6770,7 +6770,7 @@ HRESULT WINAPI ReadFmtUserTypeStg (LPSTORAGE pstg, CLIPFORMAT* pcf, LPOLESTR* lp
{
HRESULT r;
IStream *stm = 0;
const WCHAR szCompObj[] = { 1, 'C','o','m','p','O','b','j', 0 };
static const WCHAR szCompObj[] = { 1, 'C','o','m','p','O','b','j', 0 };
unsigned char unknown1[12];
unsigned char unknown2[16];
DWORD count;

View File

@ -311,10 +311,10 @@ HRESULT WINAPI OleCreateFontIndirect(
if (!lpFontDesc) {
FONTDESC fd;
WCHAR fname[] = { 'S','y','s','t','e','m',0 };
static const WCHAR fname[] = { 'S','y','s','t','e','m',0 };
fd.cbSizeofstruct = sizeof(fd);
fd.lpstrName = fname;
fd.lpstrName = (WCHAR*)fname;
fd.cySize.s.Lo = 80000;
fd.cySize.s.Hi = 0;
fd.sWeight = 0;

View File

@ -358,7 +358,7 @@ static int ctl2_find_name(
*/
static int ctl2_encode_name(
ICreateTypeLib2Impl *This, /* [I] The typelib to operate against (used for LCID only). */
WCHAR *name, /* [I] The name string to encode. */
const WCHAR *name, /* [I] The name string to encode. */
char **result) /* [O] A pointer to a pointer to receive the encoded name. */
{
int length;
@ -402,7 +402,7 @@ static int ctl2_encode_name(
*/
static int ctl2_encode_string(
ICreateTypeLib2Impl *This, /* [I] The typelib to operate against (not used?). */
WCHAR *string, /* [I] The string to encode. */
const WCHAR *string, /* [I] The string to encode. */
char **result) /* [O] A pointer to a pointer to receive the encoded string. */
{
int length;
@ -581,7 +581,7 @@ static int ctl2_alloc_guid(
*/
static int ctl2_alloc_name(
ICreateTypeLib2Impl *This, /* [I] The type library to allocate in. */
WCHAR *name) /* [I] The name to store. */
const WCHAR *name) /* [I] The name to store. */
{
int length;
int offset;
@ -624,7 +624,7 @@ static int ctl2_alloc_name(
*/
static int ctl2_alloc_string(
ICreateTypeLib2Impl *This, /* [I] The type library to allocate in. */
WCHAR *string) /* [I] The string to store. */
const WCHAR *string) /* [I] The string to store. */
{
int length;
int offset;
@ -698,7 +698,7 @@ static int ctl2_alloc_importfile(
int guidoffset, /* [I] The offset to the GUID for the imported library. */
int major_version, /* [I] The major version number of the imported library. */
int minor_version, /* [I] The minor version number of the imported library. */
WCHAR *filename) /* [I] The filename of the imported library. */
const WCHAR *filename) /* [I] The filename of the imported library. */
{
int length;
int offset;
@ -1220,7 +1220,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeFlags(ICreateTypeInfo2 *iface, U
int guidoffset;
int fileoffset;
MSFT_ImpInfo impinfo;
WCHAR stdole2tlb[] = { 's','t','d','o','l','e','2','.','t','l','b',0 };
static const WCHAR stdole2tlb[] = { 's','t','d','o','l','e','2','.','t','l','b',0 };
foo.guid = IID_StdOle;
foo.hreftype = 2;

View File

@ -62,7 +62,7 @@ static struct ICOM_VTABLE(IFileSystemBindData) sbvt =
IFileSystemBindData_fnSetFindData,
};
static WCHAR wFileSystemBindData[] = {'F','i','l','e',' ','S','y','s','t','e','m',' ','B','i','n','d','D','a','t','a',0};
static const WCHAR wFileSystemBindData[] = {'F','i','l','e',' ','S','y','s','t','e','m',' ','B','i','n','d','D','a','t','a',0};
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV)
{
@ -93,7 +93,7 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC
bindOpts.grfMode = STGM_CREATE;
bindOpts.dwTickCountDeadline = 0;
IBindCtx_SetBindOptions(*ppV, &bindOpts);
IBindCtx_RegisterObjectParam(*ppV, wFileSystemBindData, (LPUNKNOWN)sb);
IBindCtx_RegisterObjectParam(*ppV, (LPOLESTR)wFileSystemBindData, (LPUNKNOWN)sb);
IFileSystemBindData_Release((IFileSystemBindData*)sb);
}
@ -113,7 +113,7 @@ HRESULT WINAPI FileSystemBindData_GetFindData(LPBC pbc, WIN32_FIND_DATAW *pfd)
if (!pfd)
return E_INVALIDARG;
ret = IBindCtx_GetObjectParam(pbc, wFileSystemBindData, &pUnk);
ret = IBindCtx_GetObjectParam(pbc, (LPOLESTR)wFileSystemBindData, &pUnk);
if (SUCCEEDED(ret))
{
ret = IUnknown_QueryInterface(pUnk, &IID_IFileSystemBindData, (LPVOID *)&pfsbd);
@ -135,7 +135,7 @@ HRESULT WINAPI FileSystemBindData_SetFindData(LPBC pbc, const WIN32_FIND_DATAW *
TRACE("%p, %p\n", pbc, pfd);
ret = IBindCtx_GetObjectParam(pbc, wFileSystemBindData, &pUnk);
ret = IBindCtx_GetObjectParam(pbc, (LPOLESTR)wFileSystemBindData, &pUnk);
if (SUCCEEDED(ret))
{
ret = IUnknown_QueryInterface(pUnk, &IID_IFileSystemBindData, (LPVOID *)&pfsbd);

View File

@ -2437,7 +2437,7 @@ typedef struct tagPOLICYDATA
#define SHELL_NO_POLICY 0xffffffff
/* default shell policy registry key */
static WCHAR strRegistryPolicyW[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o',
static const WCHAR strRegistryPolicyW[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o',
's','o','f','t','\\','W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n',
'\\','P','o','l','i','c','i','e','s',0};
@ -2461,7 +2461,7 @@ DWORD WINAPI SHGetRestriction(LPCWSTR lpSubKey, LPCWSTR lpSubName, LPCWSTR lpVal
HKEY hKey;
if (!lpSubKey)
lpSubKey = (LPCWSTR)strRegistryPolicyW;
lpSubKey = strRegistryPolicyW;
retval = RegOpenKeyW(HKEY_LOCAL_MACHINE, lpSubKey, &hKey);
if (retval != ERROR_SUCCESS)
@ -3887,7 +3887,7 @@ HRESULT WINAPI SHCoCreateInstanceAC(REFCLSID rclsid, LPUNKNOWN pUnkOuter,
*/
BOOL WINAPI SHSkipJunction(IBindCtx *pbc, const CLSID *pclsid)
{
static WCHAR szSkipBinding[] = { 'S','k','i','p',' ',
static const WCHAR szSkipBinding[] = { 'S','k','i','p',' ',
'B','i','n','d','i','n','g',' ','C','L','S','I','D','\0' };
BOOL bRet = FALSE;
@ -3895,7 +3895,7 @@ BOOL WINAPI SHSkipJunction(IBindCtx *pbc, const CLSID *pclsid)
{
IUnknown* lpUnk;
if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, szSkipBinding, &lpUnk)))
if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, (LPOLESTR)szSkipBinding, &lpUnk)))
{
CLSID clsid;

View File

@ -477,7 +477,7 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
if(SUCCEEDED(hres)) {
TRACE("Created dummy stream...\n");
hres = IBindCtx_GetObjectParam(pbc, BSCBHolder, (IUnknown**)&pbscb);
hres = IBindCtx_GetObjectParam(pbc, (LPOLESTR)BSCBHolder, (IUnknown**)&pbscb);
if(SUCCEEDED(hres)) {
TRACE("Got IBindStatusCallback...\n");
@ -1139,16 +1139,16 @@ HRESULT WINAPI RegisterBindStatusCallback(
if (pbc == NULL || pbsc == NULL)
return E_INVALIDARG;
if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, BSCBHolder, (IUnknown **)&prev)))
if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, (LPOLESTR)BSCBHolder, (IUnknown **)&prev)))
{
IBindCtx_RevokeObjectParam(pbc, BSCBHolder);
IBindCtx_RevokeObjectParam(pbc, (LPOLESTR)BSCBHolder);
if (ppbscPrevious)
*ppbscPrevious = prev;
else
IBindStatusCallback_Release(prev);
}
return IBindCtx_RegisterObjectParam(pbc, BSCBHolder, (IUnknown *)pbsc);
return IBindCtx_RegisterObjectParam(pbc, (LPOLESTR)BSCBHolder, (IUnknown *)pbsc);
}
/***********************************************************************
@ -1176,11 +1176,11 @@ HRESULT WINAPI RevokeBindStatusCallback(
if (pbc == NULL || pbsc == NULL)
return E_INVALIDARG;
if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, BSCBHolder, (IUnknown **)&callback)))
if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, (LPOLESTR)BSCBHolder, (IUnknown **)&callback)))
{
if (callback == pbsc)
{
IBindCtx_RevokeObjectParam(pbc, BSCBHolder);
IBindCtx_RevokeObjectParam(pbc, (LPOLESTR)BSCBHolder);
hr = S_OK;
}
IBindStatusCallback_Release(pbsc);

View File

@ -536,11 +536,12 @@ static BOOL HTTP_DealWithProxy( LPWININETAPPINFOW hIC,
{
WCHAR buf[MAXHOSTNAME];
WCHAR proxy[MAXHOSTNAME + 15]; /* 15 == "http://" + sizeof(port#) + ":/\0" */
WCHAR* url, szNul[] = { 0 };
WCHAR* url;
static const WCHAR szNul[] = { 0 };
URL_COMPONENTSW UrlComponents;
const WCHAR szHttp[] = { 'h','t','t','p',':','/','/',0 }, szSlash[] = { '/',0 } ;
const WCHAR szFormat1[] = { 'h','t','t','p',':','/','/','%','s',':','%','d',0 };
const WCHAR szFormat2[] = { 'h','t','t','p',':','/','/','%','s',':','%','d',0 };
static const WCHAR szHttp[] = { 'h','t','t','p',':','/','/',0 }, szSlash[] = { '/',0 } ;
static const WCHAR szFormat1[] = { 'h','t','t','p',':','/','/','%','s',':','%','d',0 };
static const WCHAR szFormat2[] = { 'h','t','t','p',':','/','/','%','s',':','%','d',0 };
int len;
memset( &UrlComponents, 0, sizeof UrlComponents );
@ -559,7 +560,7 @@ static BOOL HTTP_DealWithProxy( LPWININETAPPINFOW hIC,
return FALSE;
if( !lpwhr->lpszPath )
lpwhr->lpszPath = szNul;
lpwhr->lpszPath = (LPWSTR)szNul;
TRACE("server='%s' path='%s'\n",
debugstr_w(lpwhs->lpszServerName), debugstr_w(lpwhr->lpszPath));
/* for constant 15 see above */

View File

@ -79,7 +79,7 @@ static INT WSOCK32_EnterSingleProtocol( INT iProtocol,
LPDWORD lpSize, BOOL unicode)
{ DWORD dwLength = 0, dwOldSize = *lpSize;
INT iAnz = 1;
WCHAR *lpProtName = NULL;
const WCHAR* lpProtName = NULL;
*lpSize = sizeof( PROTOCOL_INFOA);
switch (iProtocol) {