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

This commit is contained in:
Daniel Marmier 2003-10-07 22:54:17 +00:00 committed by Alexandre Julliard
parent 1f5d1beb0d
commit 7e0ddbc60f
13 changed files with 23 additions and 22 deletions

View File

@ -30,7 +30,7 @@
typedef struct dm_func /* driver manager functions */
{
int ordinal;
char *name;
const char *name;
void *d_func;
SQLRETURN (*func)();
} DM_FUNC;

View File

@ -202,7 +202,7 @@ HRESULT WINAPI QUARTZ_DllCanUnloadNow()
static struct {
const GUID riid;
char *name;
const char *name;
} InterfaceDesc[] =
{
#define OUR_GUID_ENTRY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \

View File

@ -52,7 +52,7 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
};
static CRITICAL_SECTION conn_cache_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
LPSTR RPCRT4_strndupA(LPSTR src, INT slen)
LPSTR RPCRT4_strndupA(LPCSTR src, INT slen)
{
DWORD len;
LPSTR s;
@ -195,7 +195,7 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection)
/* protseq=ncalrpc: supposed to use NT LPC ports,
* but we'll implement it with named pipes for now */
if (strcmp(Connection->Protseq, "ncalrpc") == 0) {
static LPSTR prefix = "\\\\.\\pipe\\lrpc\\";
static LPCSTR prefix = "\\\\.\\pipe\\lrpc\\";
LPSTR pname;
pname = HeapAlloc(GetProcessHeap(), 0, strlen(prefix) + strlen(Connection->Endpoint) + 1);
strcat(strcpy(pname, prefix), Connection->Endpoint);
@ -216,7 +216,7 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection)
}
/* protseq=ncacn_np: named pipes */
else if (strcmp(Connection->Protseq, "ncacn_np") == 0) {
static LPSTR prefix = "\\\\.";
static LPCSTR prefix = "\\\\.";
LPSTR pname;
pname = HeapAlloc(GetProcessHeap(), 0, strlen(prefix) + strlen(Connection->Endpoint) + 1);
strcat(strcpy(pname, prefix), Connection->Endpoint);
@ -244,7 +244,7 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection)
/* protseq=ncalrpc: supposed to use NT LPC ports,
* but we'll implement it with named pipes for now */
if (strcmp(Connection->Protseq, "ncalrpc") == 0) {
static LPSTR prefix = "\\\\.\\pipe\\lrpc\\";
static LPCSTR prefix = "\\\\.\\pipe\\lrpc\\";
LPSTR pname;
HANDLE conn;
DWORD err;
@ -278,7 +278,7 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection)
}
/* protseq=ncacn_np: named pipes */
else if (strcmp(Connection->Protseq, "ncacn_np") == 0) {
static LPSTR prefix = "\\\\.";
static LPCSTR prefix = "\\\\.";
LPSTR pname;
HANDLE conn;
DWORD err;

View File

@ -51,7 +51,7 @@ typedef struct _RpcBinding
RpcConnection* FromConn;
} RpcBinding;
LPSTR RPCRT4_strndupA(LPSTR src, INT len);
LPSTR RPCRT4_strndupA(LPCSTR src, INT len);
LPWSTR RPCRT4_strndupW(LPWSTR src, INT len);
LPSTR RPCRT4_strdupWtoA(LPWSTR src);
LPWSTR RPCRT4_strdupAtoW(LPSTR src);

View File

@ -1048,7 +1048,7 @@ DWORD WINAPI SHSetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue,
{
DWORD dwRet = ERROR_SUCCESS, dwDummy;
HKEY hSubKey;
LPSTR szEmpty = "";
char szEmpty[] = "";
TRACE("(hkey=%p,%s,%s,%ld,%p,%ld)\n", hKey, debugstr_a(lpszSubKey),
debugstr_a(lpszValue), dwType, pvData, cbData);

View File

@ -71,7 +71,7 @@ static void test_UrlHash(void)
hash_url(TEST_URL_3);
}
static void test_url_part(const char* szUrl, DWORD dwPart, DWORD dwFlags, char* szExpected)
static void test_url_part(const char* szUrl, DWORD dwPart, DWORD dwFlags, const char* szExpected)
{
CHAR szPart[INTERNET_MAX_URL_LENGTH];
WCHAR wszPart[INTERNET_MAX_URL_LENGTH];

View File

@ -40,15 +40,15 @@ static SHCopyKeyA_func pSHCopyKeyA;
typedef DWORD (WINAPI *SHRegGetPathA_func)(HKEY,LPCSTR,LPCSTR,LPSTR,DWORD);
static SHRegGetPathA_func pSHRegGetPathA;
static char * sTestpath1 = "%LONGSYSTEMVAR%\\subdir1";
static char * sTestpath2 = "%FOO%\\subdir1";
static const char * sTestpath1 = "%LONGSYSTEMVAR%\\subdir1";
static const char * sTestpath2 = "%FOO%\\subdir1";
static char sExpTestpath1[MAX_PATH];
static char sExpTestpath2[MAX_PATH];
static unsigned sExpLen1;
static unsigned sExpLen2;
static char * sEmptyBuffer ="0123456789";
static const char * sEmptyBuffer ="0123456789";
/* delete key and all its subkeys */
static DWORD delete_key( HKEY hkey )
@ -135,7 +135,7 @@ static void test_SHQUeryValueEx(void)
DWORD dwType;
char buf[MAX_PATH];
DWORD dwRet;
char * sTestedFunction = "";
const char * sTestedFunction = "";
DWORD nUsedBuffer1,nUsedBuffer2;
ok(! RegOpenKeyExA(HKEY_CURRENT_USER, REG_TEST_KEY, 0, KEY_QUERY_VALUE, &hKey), "test4 RegOpenKey");

View File

@ -346,7 +346,7 @@ static DWORD MCIANIM_CalcFrame(WINE_MCIANIM* wma, DWORD dwFormatType, DWORD dwTi
static DWORD MCIANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms)
{
WINE_MCIANIM* wma = MCIANIM_mciGetOpenDrv(wDevID);
LPSTR str = 0;
LPCSTR str = 0;
DWORD ret = 0;
TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);

View File

@ -145,7 +145,7 @@ DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS l
*/
DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSA lpParms)
{
LPSTR str = 0;
LPCSTR str = 0;
WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
DWORD ret = 0;
@ -281,7 +281,7 @@ DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms)
FIXME("%s\n", buffer);
}
if (dwFlags & MCI_DGV_SET_FILEFORMAT) {
LPSTR str = "save";
LPCSTR str = "save";
if (dwFlags & MCI_DGV_SET_STILL)
str = "capture";

View File

@ -463,7 +463,7 @@ static DWORD CDROM_Audio_GetSerial(CDROM_TOC* toc)
*/
static DWORD MCICDA_Info(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms)
{
LPSTR str = NULL;
LPCSTR str = NULL;
WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID);
DWORD ret = 0;
char buffer[16];

View File

@ -1042,7 +1042,7 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
if (TRACE_ON(mcimidi)) {
char buf[1024];
WORD len = mmt->wEventLength - HIWORD(mmt->dwEventData);
static char* info[8] = {"", "Text", "Copyright", "Seq/Trk name",
static const char* info[8] = {"", "Text", "Copyright", "Seq/Trk name",
"Instrument", "Lyric", "Marker", "Cue-point"};
WORD idx = HIBYTE(LOWORD(mmt->dwEventData));

View File

@ -408,11 +408,12 @@ LONG ALSA_WaveInit(void)
snd_pcm_info_t * info;
snd_pcm_hw_params_t * hw_params;
WINE_WAVEOUT* wwo;
char device[] = "hw";
wwo = &WOutDev[0];
/* FIXME: use better values */
wwo->device = "hw";
wwo->device = device;
wwo->caps.wMid = 0x0002;
wwo->caps.wPid = 0x0104;
strcpy(wwo->caps.szPname, "SB16 Wave Out");

View File

@ -70,8 +70,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmaux);
/* FIXME: the two following string arrays should be moved to a resource file in a string table */
/* if it's done, better use a struct to hold labels, name, and muted channel volume cache */
static char* MIX_Labels[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_LABELS;
static char* MIX_Names [SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES;
static const char* MIX_Labels[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_LABELS;
static const char* MIX_Names [SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES;
struct mixerCtrl
{