Fixed warnings with gcc option "-Wwrite-strings".
This commit is contained in:
parent
2c39191ef1
commit
7832562ee6
|
@ -375,7 +375,7 @@ err:
|
|||
#define NB_SESSION_REQ 0x81
|
||||
|
||||
/* RFC 1002, section 4.3.2 */
|
||||
static BOOL NB_SessionReq(int fd, char *called, char *calling)
|
||||
static BOOL NB_SessionReq(int fd, const char *called, const char *calling)
|
||||
{
|
||||
unsigned char buffer[0x100];
|
||||
int len = 0,r;
|
||||
|
@ -538,7 +538,7 @@ static BOOL NB_Transaction(int fd, struct NB_Buffer *in, struct NB_Buffer *out)
|
|||
|
||||
static DWORD SMB_GetError(unsigned char *buffer)
|
||||
{
|
||||
char *err_class;
|
||||
const char *err_class;
|
||||
|
||||
switch(buffer[SMB_ERRCLASS])
|
||||
{
|
||||
|
|
|
@ -231,7 +231,7 @@ static const SuffixCharset sufch_any[] = {
|
|||
|
||||
typedef struct __fet
|
||||
{
|
||||
LPSTR prefix;
|
||||
LPCSTR prefix;
|
||||
const SuffixCharset* sufch;
|
||||
struct __fet* next;
|
||||
} fontEncodingTemplate;
|
||||
|
@ -867,7 +867,7 @@ static BOOL LFD_ComposeLFD( const fontObject* fo,
|
|||
INT height, LPSTR lpLFD, UINT uRelax )
|
||||
{
|
||||
int i, h;
|
||||
char *any = "*";
|
||||
const char *any = "*";
|
||||
char h_string[64], resx_string[64], resy_string[64];
|
||||
LFD aLFD;
|
||||
|
||||
|
@ -1002,7 +1002,7 @@ static BOOL LFD_ComposeLFD( const fontObject* fo,
|
|||
|
||||
/* spacing */
|
||||
{
|
||||
char* w;
|
||||
const char* w;
|
||||
|
||||
if( fo->fi->fi_flags & FI_FIXEDPITCH )
|
||||
w = ( fo->fi->fi_flags & FI_FIXEDEX ) ? "c" : "m";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* XPM */
|
||||
static char * wine_xpm[] = {
|
||||
static const char * wine_xpm[] = {
|
||||
"48 48 159 2",
|
||||
" c None",
|
||||
". c #010101",
|
||||
|
|
|
@ -230,14 +230,14 @@ typedef struct macexpstackentry {
|
|||
* Prototypes
|
||||
*/
|
||||
static void newline(int);
|
||||
static int make_number(int radix, YYSTYPE *val, char *str, int len);
|
||||
static void put_buffer(char *s, int len);
|
||||
static int make_number(int radix, YYSTYPE *val, const char *str, int len);
|
||||
static void put_buffer(const char *s, int len);
|
||||
/* Buffer management */
|
||||
static void push_buffer(pp_entry_t *ppp, char *filename, char *incname, int pop);
|
||||
static bufferstackentry_t *pop_buffer(void);
|
||||
/* String functions */
|
||||
static void new_string(void);
|
||||
static void add_string(char *str, int len);
|
||||
static void add_string(const char *str, int len);
|
||||
static char *get_string(void);
|
||||
static void put_string(void);
|
||||
static int string_start(void);
|
||||
|
@ -246,7 +246,7 @@ static void push_macro(pp_entry_t *ppp);
|
|||
static macexpstackentry_t *top_macro(void);
|
||||
static macexpstackentry_t *pop_macro(void);
|
||||
static void free_macro(macexpstackentry_t *mep);
|
||||
static void add_text_to_macro(char *text, int len);
|
||||
static void add_text_to_macro(const char *text, int len);
|
||||
static void macro_add_arg(int last);
|
||||
static void macro_add_expansion(void);
|
||||
/* Expansion */
|
||||
|
@ -778,7 +778,7 @@ static void newline(int dowrite)
|
|||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static int make_number(int radix, YYSTYPE *val, char *str, int len)
|
||||
static int make_number(int radix, YYSTYPE *val, const char *str, int len)
|
||||
{
|
||||
int is_l = 0;
|
||||
int is_ll = 0;
|
||||
|
@ -849,7 +849,7 @@ static int make_number(int radix, YYSTYPE *val, char *str, int len)
|
|||
*/
|
||||
static void expand_special(pp_entry_t *ppp)
|
||||
{
|
||||
char *dbgtext = "?";
|
||||
const char *dbgtext = "?";
|
||||
static char *buf = NULL;
|
||||
|
||||
assert(ppp->type == def_special);
|
||||
|
@ -906,7 +906,7 @@ static int curdef_idx = 0;
|
|||
static int curdef_alloc = 0;
|
||||
static char *curdef_text = NULL;
|
||||
|
||||
static void add_text(char *str, int len)
|
||||
static void add_text(const char *str, int len)
|
||||
{
|
||||
if(len == 0)
|
||||
return;
|
||||
|
@ -1106,7 +1106,7 @@ static void new_string(void)
|
|||
str_startline = pp_status.line_number;
|
||||
}
|
||||
|
||||
static void add_string(char *str, int len)
|
||||
static void add_string(const char *str, int len)
|
||||
{
|
||||
if(len == 0)
|
||||
return;
|
||||
|
@ -1307,7 +1307,7 @@ static void free_macro(macexpstackentry_t *mep)
|
|||
free(mep);
|
||||
}
|
||||
|
||||
static void add_text_to_macro(char *text, int len)
|
||||
static void add_text_to_macro(const char *text, int len)
|
||||
{
|
||||
macexpstackentry_t *mep = top_macro();
|
||||
|
||||
|
@ -1388,7 +1388,7 @@ static void macro_add_expansion(void)
|
|||
* Output management
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static void put_buffer(char *s, int len)
|
||||
static void put_buffer(const char *s, int len)
|
||||
{
|
||||
if(top_macro())
|
||||
add_text_to_macro(s, len);
|
||||
|
|
|
@ -228,7 +228,7 @@ pp_entry_t *pp_add_define(char *def, char *text)
|
|||
ppp->ident = def;
|
||||
ppp->type = def_define;
|
||||
ppp->subst.text = text;
|
||||
ppp->filename = pp_status.input ? pp_xstrdup(pp_status.input) : "<internal or cmdline>";
|
||||
ppp->filename = pp_xstrdup(pp_status.input ? pp_status.input : "<internal or cmdline>");
|
||||
ppp->linenumber = pp_status.input ? pp_status.line_number : 0;
|
||||
ppp->next = pp_def_state->defines[idx];
|
||||
pp_def_state->defines[idx] = ppp;
|
||||
|
@ -272,7 +272,7 @@ pp_entry_t *pp_add_macro(char *id, marg_t *args[], int nargs, mtext_t *exp)
|
|||
ppp->margs = args;
|
||||
ppp->nargs = nargs;
|
||||
ppp->subst.mtext= exp;
|
||||
ppp->filename = pp_status.input ? pp_xstrdup(pp_status.input) : "<internal or cmdline>";
|
||||
ppp->filename = pp_xstrdup(pp_status.input ? pp_status.input : "<internal or cmdline>");
|
||||
ppp->linenumber = pp_status.input ? pp_status.line_number : 0;
|
||||
ppp->next = pp_def_state->defines[idx];
|
||||
pp_def_state->defines[idx] = ppp;
|
||||
|
@ -467,7 +467,7 @@ FILE *pp_open_include(const char *name, int search, char **newpath)
|
|||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static char *pp_if_state_str[] = {
|
||||
static const char * const pp_if_state_str[] = {
|
||||
"if_false",
|
||||
"if_true",
|
||||
"if_elif",
|
||||
|
|
|
@ -125,7 +125,7 @@ static LPWSTR _strdupnAtoW(LPCSTR strA,size_t lenA)
|
|||
|
||||
/* dump a Unicode string with proper escaping [Internal] */
|
||||
/* FIXME: this code duplicates server/unicode.c */
|
||||
static int _dump_strW(const WCHAR *str,size_t len,FILE *f,char escape[2])
|
||||
static int _dump_strW(const WCHAR *str,size_t len,FILE *f,const char escape[2])
|
||||
{
|
||||
static const char escapes[32] = ".......abtnvfr.............e....";
|
||||
char buffer[256];
|
||||
|
@ -168,7 +168,7 @@ static int _dump_strW(const WCHAR *str,size_t len,FILE *f,char escape[2])
|
|||
}
|
||||
|
||||
/* convert ansi string to unicode and dump with proper escaping [Internal] */
|
||||
static int _dump_strAtoW(LPCSTR strA,size_t len,FILE *f,char escape[2])
|
||||
static int _dump_strAtoW(LPCSTR strA,size_t len,FILE *f,const char escape[2])
|
||||
{
|
||||
WCHAR *strW;
|
||||
int ret;
|
||||
|
@ -688,7 +688,7 @@ static int _w95_dump_dkv(_w95dkh *dkh,int nrLS,int nrMS,FILE *f)
|
|||
/******************************************************************************
|
||||
* _w95_dump_dke [Internal]
|
||||
*/
|
||||
static int _w95_dump_dke(LPSTR key_name,_w95creg *creg,_w95rgkn *rgkn,_w95dke *dke,FILE *f,int level)
|
||||
static int _w95_dump_dke(LPCSTR key_name,_w95creg *creg,_w95rgkn *rgkn,_w95dke *dke,FILE *f,int level)
|
||||
{
|
||||
_w95dkh * dkh;
|
||||
LPSTR new_key_name = NULL;
|
||||
|
@ -936,7 +936,7 @@ static int _nt_dump_vk(LPSTR key_name, char *base, nt_vk *vk,FILE *f)
|
|||
}
|
||||
|
||||
/* it's called from _nt_dump_lf() */
|
||||
static int _nt_dump_nk(LPSTR key_name,char *base,nt_nk *nk,FILE *f,int level);
|
||||
static int _nt_dump_nk(LPCSTR key_name,char *base,nt_nk *nk,FILE *f,int level);
|
||||
|
||||
/*
|
||||
* get the subkeys
|
||||
|
@ -947,7 +947,7 @@ static int _nt_dump_nk(LPSTR key_name,char *base,nt_nk *nk,FILE *f,int level);
|
|||
* exception: if the id is 'il' there are no hash values and every
|
||||
* dword is a offset
|
||||
*/
|
||||
static int _nt_dump_lf(LPSTR key_name, char *base, int subkeys, nt_lf *lf, FILE *f, int level)
|
||||
static int _nt_dump_lf(LPCSTR key_name, char *base, int subkeys, nt_lf *lf, FILE *f, int level)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -1002,7 +1002,7 @@ error:
|
|||
}
|
||||
|
||||
/* _nt_dump_nk [Internal] */
|
||||
static int _nt_dump_nk(LPSTR key_name,char *base,nt_nk *nk,FILE *f,int level)
|
||||
static int _nt_dump_nk(LPCSTR key_name,char *base,nt_nk *nk,FILE *f,int level)
|
||||
{
|
||||
unsigned int n;
|
||||
DWORD *vl;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "unicode.h"
|
||||
|
||||
/* dump a Unicode string with proper escaping */
|
||||
int dump_strW( const WCHAR *str, size_t len, FILE *f, char escape[2] )
|
||||
int dump_strW( const WCHAR *str, size_t len, FILE *f, const char escape[2] )
|
||||
{
|
||||
static const char escapes[32] = ".......abtnvfr.............e....";
|
||||
char buffer[256];
|
||||
|
|
|
@ -33,6 +33,6 @@ static inline WCHAR *strdupW( const WCHAR *str )
|
|||
return memdup( str, len );
|
||||
}
|
||||
|
||||
extern int dump_strW( const WCHAR *str, size_t len, FILE *f, char escape[2] );
|
||||
extern int dump_strW( const WCHAR *str, size_t len, FILE *f, const char escape[2] );
|
||||
|
||||
#endif /* __WINE_SERVER_UNICODE_H */
|
||||
|
|
Loading…
Reference in New Issue