Fixed warnings with gcc option "-Wwrite-strings".

This commit is contained in:
Daniel Marmier 2003-10-06 21:03:32 +00:00 committed by Alexandre Julliard
parent 3ce7ed5c15
commit 0348649853
16 changed files with 44 additions and 35 deletions

View File

@ -393,20 +393,24 @@ HRESULT d3ddevice_enumerate(LPD3DENUMDEVICESCALLBACK cb, LPVOID context, DWORD v
if (version > 1) {
/* It seems that enumerating the reference IID on Direct3D 1 games (AvP / Motoracer2) breaks them */
char interface_name[] = "WINE Reference Direct3DX using OpenGL";
TRACE(" enumerating OpenGL D3DDevice interface using reference IID (IID %s).\n", debugstr_guid(&IID_IDirect3DRefDevice));
d1 = dref;
d2 = dref;
ret_value = cb((LPIID) &IID_IDirect3DRefDevice, "WINE Reference Direct3DX using OpenGL", device_name, &d1, &d2, context);
ret_value = cb((LPIID) &IID_IDirect3DRefDevice, interface_name, device_name, &d1, &d2, context);
if (ret_value != D3DENUMRET_OK)
return ret_value;
}
{
char interface_name[] = "WINE Direct3DX using OpenGL";
TRACE(" enumerating OpenGL D3DDevice interface (IID %s).\n", debugstr_guid(&IID_D3DDEVICE_OpenGL));
d1 = dref;
d2 = dref;
ret_value = cb((LPIID) &IID_D3DDEVICE_OpenGL, interface_name, device_name, &d1, &d2, context);
if (ret_value != D3DENUMRET_OK)
return ret_value;
}
TRACE(" enumerating OpenGL D3DDevice interface (IID %s).\n", debugstr_guid(&IID_D3DDEVICE_OpenGL));
d1 = dref;
d2 = dref;
ret_value = cb((LPIID) &IID_D3DDEVICE_OpenGL, "WINE Direct3DX using OpenGL", device_name, &d1, &d2, context);
if (ret_value != D3DENUMRET_OK)
return ret_value;
return D3DENUMRET_OK;
}
@ -414,12 +418,14 @@ HRESULT d3ddevice_enumerate(LPD3DENUMDEVICESCALLBACK cb, LPVOID context, DWORD v
HRESULT d3ddevice_enumerate7(LPD3DENUMDEVICESCALLBACK7 cb, LPVOID context)
{
D3DDEVICEDESC7 ddesc;
char interface_name[] = "WINE Direct3D7 using OpenGL";
char device_name[] = "Wine D3D7 device";
fill_opengl_caps_7(&ddesc);
TRACE(" enumerating OpenGL D3DDevice7 interface.\n");
return cb("WINE Direct3D7 using OpenGL", "Wine D3D7 device", &ddesc, context);
return cb(interface_name, device_name, &ddesc, context);
}
ULONG WINAPI

View File

@ -270,7 +270,7 @@ void DDRAW_dump_pixelformat(const DDPIXELFORMAT *pf) {
);
}
if (pf->dwFlags & DDPF_RGB) {
char *cmd;
const char *cmd;
DPRINTF(", RGB bits: %ld, ", pf->u1.dwRGBBitCount);
switch (pf->u1.dwRGBBitCount) {
case 4: cmd = "%1lx"; break;

View File

@ -85,7 +85,7 @@ static void *gl_handle = NULL;
static BOOL DDRAW_bind_to_opengl( void )
{
char *glname = SONAME_LIBGL;
const char *glname = SONAME_LIBGL;
BOOL ret_value;
gl_handle = wine_dlopen(glname, RTLD_NOW, NULL, 0);

View File

@ -157,7 +157,7 @@ static void test_RtlIsNameLegalDOS8Dot3(void)
{
struct test
{
char *path;
const char *path;
BOOLEAN result;
BOOLEAN spaces;
};
@ -199,7 +199,9 @@ static void test_RtlIsNameLegalDOS8Dot3(void)
ustr.Buffer = buffer;
for (test = tests; test->path; test++)
{
oem.Buffer = test->path;
char path[100];
strcpy(path, test->path);
oem.Buffer = path;
oem.Length = strlen(test->path);
oem.MaximumLength = oem.Length + 1;
pRtlOemStringToUnicodeString( &ustr, &oem, FALSE );

View File

@ -41,7 +41,7 @@ static NTSTATUS (WINAPI *pRtlAppendAsciizToString)(STRING *, LPCSTR);
static NTSTATUS (WINAPI *pRtlAppendStringToString)(STRING *, const STRING *);
static NTSTATUS (WINAPI *pRtlAppendUnicodeStringToString)(UNICODE_STRING *, const UNICODE_STRING *);
static NTSTATUS (WINAPI *pRtlAppendUnicodeToString)(UNICODE_STRING *, LPCWSTR);
static NTSTATUS (WINAPI *pRtlCharToInteger)(char *, ULONG, int *);
static NTSTATUS (WINAPI *pRtlCharToInteger)(PCSZ, ULONG, int *);
static VOID (WINAPI *pRtlCopyString)(STRING *, const STRING *);
static BOOLEAN (WINAPI *pRtlCreateUnicodeString)(PUNICODE_STRING, LPCWSTR);
static BOOLEAN (WINAPI *pRtlCreateUnicodeStringFromAsciiz)(PUNICODE_STRING, LPCSTR);
@ -1211,7 +1211,7 @@ static void test_RtlFindCharInUnicodeString(void)
typedef struct {
int base;
char *str;
const char *str;
int value;
NTSTATUS result;
} str2int_t;

View File

@ -506,7 +506,7 @@ HRESULT WINAPI __CLSIDFromStringA(
LPCSTR idstr, /* [in] string representation of guid */
CLSID *id) /* [out] GUID converted from string */
{
BYTE *s = (BYTE *) idstr;
const BYTE *s = (BYTE *) idstr;
int i;
BYTE table[256];

View File

@ -117,7 +117,7 @@ static char* WtoA( OLECHAR* p )
return buffer;
}
static OLECHAR* AtoW( char* p )
static OLECHAR* AtoW( const char* p )
{
OLECHAR *buffer;
DWORD len = MultiByteToWideChar( CP_ACP, 0, p, -1, NULL, 0 );
@ -381,7 +381,7 @@ static const char *strfromr8[] = {
/* These are the strings we use for the XxxFromStr tests.
* The arrays that follow define the expected results for each type.
*/
static char* _pTestStrA[] = {
static const char* _pTestStrA[] = {
"-2",
"-1",
"-0.51",

View File

@ -927,7 +927,7 @@ void dump_IDLDESC(IDLDESC *idl) {
MESSAGE("\t\twIdlflags: %d\n",idl->wIDLFlags);
}
static char * typekind_desc[] =
static const char * typekind_desc[] =
{
"TKIND_ENUM",
"TKIND_RECORD",
@ -1924,7 +1924,7 @@ ITypeInfoImpl * MSFT_DoTypeInfo(
}
else
{ /* FIXME: This is a really bad hack to add IDispatch */
char* szStdOle = "stdole2.tlb\0";
const char* szStdOle = "stdole2.tlb\0";
int nStdOleLen = strlen(szStdOle);
TLBRefType **ppRef = &ptiRet->reflist;

View File

@ -143,10 +143,10 @@ static const double DAYS_IN_ONE_YEAR = 365.0;
#define TOK_AMPM 0x2e
typedef struct tagFORMATTOKEN {
char *str;
BYTE tokenSize;
BYTE tokenId;
int varTypeRequired;
const char *str;
BYTE tokenSize;
BYTE tokenId;
int varTypeRequired;
} FORMATTOKEN;
typedef struct tagFORMATHDR {

View File

@ -149,7 +149,7 @@ static void test_change_message( int action, int optional )
* lpsRegName - registry entry name
* lpsTestValue - value to test
*/
static void _test_reg_key( LPSTR subKey1, LPSTR subKey2, LPSTR valName, LPSTR testValue )
static void _test_reg_key( LPCSTR subKey1, LPCSTR subKey2, LPCSTR valName, LPCSTR testValue )
{
CHAR value[MAX_PATH];
DWORD valueLen;
@ -256,7 +256,7 @@ static void test_SPI_SETBEEP( void ) /* 2 */
ok(rc!=0,"***warning*** failed to restore the original value: rc=%d err=%ld\n",rc,GetLastError());
}
static char *setmouse_valuenames[3] = {
static const char *setmouse_valuenames[3] = {
SPI_SETMOUSE_VALNAME1,
SPI_SETMOUSE_VALNAME2,
SPI_SETMOUSE_VALNAME3

View File

@ -39,7 +39,7 @@ unsigned (*pFnLoadMMDrvFunc16)(LPCSTR,LPWINE_DRIVER, LPWINE_MM_DRIVER) /*
/* each known type of driver has an instance of this structure */
typedef struct tagWINE_LLTYPE {
/* those attributes depend on the specification of the type */
LPSTR typestr; /* name (for debugging) */
LPCSTR typestr; /* name (for debugging) */
BOOL bSupportMapper; /* if type is allowed to support mapper */
MMDRV_MAPFUNC Map16To32A; /* those are function pointers to handle */
MMDRV_UNMAPFUNC UnMap16To32A; /* the parameter conversion (16 vs 32 bit) */

View File

@ -291,7 +291,7 @@ static UINT MCI_GetCommandTable(UINT uDevType)
{
UINT uTbl;
char buf[32];
LPSTR str = NULL;
LPCSTR str = NULL;
/* first look up existing for existing devType */
for (uTbl = 0; uTbl < MAX_MCICMDTABLE; uTbl++) {

View File

@ -155,7 +155,7 @@ BOOL DIALOG_DisableOwner( HWND hOwner )
BOOL DIALOG_GetCharSize( HDC hDC, HFONT hFont, SIZE * pSize )
{
HFONT hFontPrev = 0;
char *alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
const char *alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
SIZE sz;
TEXTMETRICA tm;
@ -1553,6 +1553,7 @@ static INT DIALOG_DlgDirList( HWND hDlg, LPSTR spec, INT idLBox,
{
HWND hwnd;
LPSTR orig_spec = spec;
char any[] = "*.*";
#define SENDMSG(msg,wparam,lparam) \
((attrib & DDL_POSTMSGS) ? PostMessageA( hwnd, msg, wparam, lparam ) \
@ -1562,7 +1563,7 @@ static INT DIALOG_DlgDirList( HWND hDlg, LPSTR spec, INT idLBox,
hDlg, spec ? spec : "NULL", idLBox, idStatic, attrib );
/* If the path exists and is a directory, chdir to it */
if (!spec || !spec[0] || SetCurrentDirectoryA( spec )) spec = "*.*";
if (!spec || !spec[0] || SetCurrentDirectoryA( spec )) spec = any;
else
{
char *p, *p2;

View File

@ -2045,7 +2045,7 @@ const SPY_NOTIFY *SPY_Bsearch_Notify( const SPY_NOTIFY *first, const SPY_NOTIFY
/***********************************************************************
* SPY_DumpMem
*/
void SPY_DumpMem (LPSTR header, UINT *q, INT len)
void SPY_DumpMem (LPCSTR header, UINT *q, INT len)
{
int i;

View File

@ -373,7 +373,7 @@ void SYSPARAMS_NotifyChange( UINT uiAction, UINT fWinIni )
/***********************************************************************
* Loads system parameter from user profile.
*/
BOOL SYSPARAMS_Load( LPSTR lpRegKey, LPSTR lpValName, LPSTR lpBuf, DWORD count )
static BOOL SYSPARAMS_Load( LPCSTR lpRegKey, LPCSTR lpValName, LPSTR lpBuf, DWORD count )
{
BOOL ret = FALSE;
DWORD type;
@ -391,8 +391,8 @@ BOOL SYSPARAMS_Load( LPSTR lpRegKey, LPSTR lpValName, LPSTR lpBuf, DWORD count )
/***********************************************************************
* Saves system parameter to user profile.
*/
BOOL SYSPARAMS_Save( LPSTR lpRegKey, LPSTR lpValName, LPSTR lpValue,
UINT fWinIni )
static BOOL SYSPARAMS_Save( LPCSTR lpRegKey, LPCSTR lpValName, LPCSTR lpValue,
UINT fWinIni )
{
HKEY hKey;
HKEY hBaseKey;

View File

@ -79,7 +79,7 @@ static LPCSTR atomInternalPos;
*/
BOOL WINPOS_CreateInternalPosAtom()
{
LPSTR str = "SysIP";
LPCSTR str = "SysIP";
atomInternalPos = (LPCSTR)(DWORD)GlobalAddAtomA(str);
return (atomInternalPos) ? TRUE : FALSE;
}