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

oldstable
Daniel Marmier 2003-10-07 03:30:47 +00:00 committed by Alexandre Julliard
parent 632676b17e
commit ee1eb63b31
9 changed files with 32 additions and 30 deletions

View File

@ -51,7 +51,7 @@ HWND crypt_hWindow = 0;
static inline PSTR CRYPT_GetProvKeyName(PCSTR pProvName)
{
const PSTR KEYSTR = "Software\\Microsoft\\Cryptography\\Defaults\\Provider\\";
PCSTR KEYSTR = "Software\\Microsoft\\Cryptography\\Defaults\\Provider\\";
PSTR keyname;
keyname = CRYPT_Alloc(strlen(KEYSTR) + strlen(pProvName) +1);
@ -66,8 +66,8 @@ static inline PSTR CRYPT_GetProvKeyName(PCSTR pProvName)
static inline PSTR CRYPT_GetTypeKeyName(DWORD dwType, BOOL user)
{
const PSTR MACHINESTR = "Software\\Microsoft\\Cryptography\\Defaults\\Provider Types\\Type XXX";
const PSTR USERSTR = "Software\\Microsoft\\Cryptography\\Provider Type XXX";
PCSTR MACHINESTR = "Software\\Microsoft\\Cryptography\\Defaults\\Provider Types\\Type XXX";
PCSTR USERSTR = "Software\\Microsoft\\Cryptography\\Provider Type XXX";
PSTR keyname;
PSTR ptr;

View File

@ -2486,7 +2486,8 @@ void extract_file(struct cab_file *fi, int lower, int fix, LPCSTR dir, cab_decom
exit_handler:
if (err) {
char *errmsg, *cabname;
const char *errmsg;
char *cabname;
switch (err) {
case DECR_NOMEMORY:
errmsg = "out of memory!\n"; break;

View File

@ -904,8 +904,9 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
lpItem->cxy = phdi->cxy;
if (phdi->mask & HDI_TEXT) {
static char empty[] = "";
if (!phdi->pszText) /* null pointer check */
phdi->pszText = "";
phdi->pszText = empty;
if (phdi->pszText != LPSTR_TEXTCALLBACKA) {
len = MultiByteToWideChar(CP_ACP, 0, phdi->pszText, -1, NULL, 0);
lpItem->pszText = Alloc( len*sizeof(WCHAR) );

View File

@ -529,7 +529,7 @@ static char* debug_getbuf()
return buffers[index++ % DEBUG_BUFFERS];
}
static inline char* debugrange(const RANGE *lprng)
static inline const char* debugrange(const RANGE *lprng)
{
if (lprng)
{
@ -539,7 +539,7 @@ static inline char* debugrange(const RANGE *lprng)
} else return "(null)";
}
static inline char* debugpoint(const POINT *lppt)
static inline const char* debugpoint(const POINT *lppt)
{
if (lppt)
{
@ -549,7 +549,7 @@ static inline char* debugpoint(const POINT *lppt)
} else return "(null)";
}
static inline char* debugrect(const RECT *rect)
static inline const char* debugrect(const RECT *rect)
{
if (rect)
{
@ -560,7 +560,7 @@ static inline char* debugrect(const RECT *rect)
} else return "(null)";
}
static char * debugscrollinfo(const SCROLLINFO *pScrollInfo)
static const char * debugscrollinfo(const SCROLLINFO *pScrollInfo)
{
char* buf = debug_getbuf(), *text = buf;
int len, size = DEBUG_BUFFER_SIZE;
@ -592,7 +592,7 @@ undo:
return text;
}
static char* debugnmlistview(const NMLISTVIEW *plvnm)
static const char* debugnmlistview(const NMLISTVIEW *plvnm)
{
if (plvnm)
{
@ -605,7 +605,7 @@ static char* debugnmlistview(const NMLISTVIEW *plvnm)
} else return "(null)";
}
static char* debuglvitem_t(const LVITEMW *lpLVItem, BOOL isW)
static const char* debuglvitem_t(const LVITEMW *lpLVItem, BOOL isW)
{
char* buf = debug_getbuf(), *text = buf;
int len, size = DEBUG_BUFFER_SIZE;
@ -641,7 +641,7 @@ undo:
return text;
}
static char* debuglvcolumn_t(const LVCOLUMNW *lpColumn, BOOL isW)
static const char* debuglvcolumn_t(const LVCOLUMNW *lpColumn, BOOL isW)
{
char* buf = debug_getbuf(), *text = buf;
int len, size = DEBUG_BUFFER_SIZE;
@ -681,7 +681,7 @@ undo:
return text;
}
static char* debuglvhittestinfo(const LVHITTESTINFO *lpht)
static const char* debuglvhittestinfo(const LVHITTESTINFO *lpht)
{
if (lpht)
{

View File

@ -334,7 +334,7 @@ typedef struct
static UINT mindragx = 0;
static UINT mindragy = 0;
static char *band_stylename[] = {
static const char *band_stylename[] = {
"RBBS_BREAK", /* 0001 */
"RBBS_FIXEDSIZE", /* 0002 */
"RBBS_CHILDEDGE", /* 0004 */
@ -346,7 +346,7 @@ static char *band_stylename[] = {
"RBBS_NOGRIPPER", /* 0100 */
NULL };
static char *band_maskname[] = {
static const char *band_maskname[] = {
"RBBIM_STYLE", /* 0x00000001 */
"RBBIM_COLORS", /* 0x00000002 */
"RBBIM_TEXT", /* 0x00000004 */

View File

@ -45,7 +45,7 @@ void _dump_cooperativelevel_DI(DWORD dwFlags) {
int i;
const struct {
DWORD mask;
char *name;
const char *name;
} flags[] = {
#define FE(x) { x, #x},
FE(DISCL_BACKGROUND)
@ -64,7 +64,7 @@ void _dump_EnumObjects_flags(DWORD dwFlags) {
int i;
const struct {
DWORD mask;
char *name;
const char *name;
} flags[] = {
#define FE(x) { x, #x},
FE(DIDFT_ABSAXIS)

View File

@ -3660,7 +3660,7 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections
{
HKEY hkResult;
LPCSTR searchSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Service Providers";
LPSTR guidDataSubKey = "Guid";
LPCSTR guidDataSubKey = "Guid";
char subKeyName[51];
DWORD dwIndex, sizeOfSubKeyName=50;
FILETIME filetime;
@ -3754,7 +3754,7 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections
{
HKEY hkResult;
LPCSTR searchSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Lobby Providers";
LPSTR guidDataSubKey = "Guid";
LPCSTR guidDataSubKey = "Guid";
char subKeyName[51];
DWORD dwIndex, sizeOfSubKeyName=50;
FILETIME filetime;
@ -5218,9 +5218,9 @@ HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA lpEnumCallback,
NULL, NULL, NULL, &filetime ) != ERROR_NO_MORE_ITEMS;
++dwIndex, sizeOfSubKeyName=50 )
{
LPSTR majVerDataSubKey = "dwReserved1";
LPSTR minVerDataSubKey = "dwReserved2";
LPSTR guidDataSubKey = "Guid";
LPCSTR majVerDataSubKey = "dwReserved1";
LPCSTR minVerDataSubKey = "dwReserved2";
LPCSTR guidDataSubKey = "Guid";
HKEY hkServiceProvider;
GUID serviceProviderGUID;
DWORD returnTypeGUID, returnTypeReserved, sizeOfReturnBuffer = 50;

View File

@ -775,8 +775,8 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes
char returnBuffer[51];
WCHAR buff[51];
DWORD dwAtIndex;
LPSTR atKey = "Address Types";
LPSTR guidDataSubKey = "Guid";
LPCSTR atKey = "Address Types";
LPCSTR guidDataSubKey = "Guid";
FILETIME filetime;
@ -886,7 +886,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumLocalApplications
HKEY hkResult;
LPCSTR searchSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Applications";
LPSTR guidDataSubKey = "Guid";
LPCSTR guidDataSubKey = "Guid";
DWORD dwIndex, sizeOfSubKeyName=50;
char subKeyName[51];
FILETIME filetime;
@ -1081,10 +1081,10 @@ static BOOL CALLBACK RunApplicationA_EnumLocalApplications
{
char returnBuffer[200];
DWORD returnType, sizeOfReturnBuffer;
LPSTR clSubKey = "CommandLine";
LPSTR cdSubKey = "CurrentDirectory";
LPSTR fileSubKey = "File";
LPSTR pathSubKey = "Path";
LPCSTR clSubKey = "CommandLine";
LPCSTR cdSubKey = "CurrentDirectory";
LPCSTR fileSubKey = "File";
LPCSTR pathSubKey = "Path";
/* FIXME: Lazy man hack - dplay struct has the present reg key saved */

View File

@ -68,7 +68,7 @@ typedef struct test_params
{
int sock_type;
int sock_prot;
char *inet_addr;
const char *inet_addr;
short inet_port;
int chunk_size;
int n_chunks;