[janitor] miscellaneous -Wwrite-strings cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Index: files/smb.c
===================================================================
RCS file: /home/wine/wine/files/smb.c,v
retrieving revision 1.23
diff -u -r1.23 smb.c
--- files/smb.c	8 Oct 2003 03:52:11 -0000	1.23
+++ files/smb.c	19 Oct 2003 11:16:52 -0000
@@ -375,7 +375,7 @@
 #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 DWORD SMB_GetError(unsigned char *buffer)
 {
-    char *err_class;
+    const char *err_class;
 
     switch(buffer[SMB_ERRCLASS])
     {
Index: graphics/x11drv/xfont.c
===================================================================
RCS file: /home/wine/wine/graphics/x11drv/xfont.c,v
retrieving revision 1.120
diff -u -r1.120 xfont.c
--- graphics/x11drv/xfont.c	15 Sep 2003 20:05:09 -0000	1.120
+++ graphics/x11drv/xfont.c	19 Oct 2003 11:16:56 -0000
@@ -231,7 +231,7 @@
 
 typedef struct __fet
 {
-  LPSTR		 prefix;
+  LPCSTR	 prefix;
   const SuffixCharset* sufch;
   struct __fet*  next;
 } fontEncodingTemplate;
@@ -867,7 +867,7 @@
 			    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 @@
 
 /* spacing */
    {
-       char* w;
+       const char* w;
 
        if( fo->fi->fi_flags & FI_FIXEDPITCH )
 	   w = ( fo->fi->fi_flags & FI_FIXEDEX ) ? "c" : "m";
Index: include/bitmaps/wine.xpm
===================================================================
RCS file: /home/wine/wine/include/bitmaps/wine.xpm,v
retrieving revision 1.1
diff -u -r1.1 wine.xpm
--- include/bitmaps/wine.xpm	2 Nov 2000 20:22:08 -0000	1.1
+++ include/bitmaps/wine.xpm	19 Oct 2003 11:16:57 -0000
@@ -1,5 +1,5 @@
 /* XPM */
-static char * wine_xpm[] = {
+static const char * wine_xpm[] = {
 "48 48 159 2",
 "  	c None",
 ". 	c #010101",
Index: libs/wpp/ppl.l
===================================================================
RCS file: /home/wine/wine/libs/wpp/ppl.l,v
retrieving revision 1.3
diff -u -r1.3 ppl.l
--- libs/wpp/ppl.l	18 Jun 2003 03:30:40 -0000	1.3
+++ libs/wpp/ppl.l	19 Oct 2003 11:16:59 -0000
@@ -230,14 +230,14 @@
  * 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 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 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 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_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 @@
 	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 @@
 	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 @@
  * 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);
Index: libs/wpp/preproc.c
===================================================================
RCS file: /home/wine/wine/libs/wpp/preproc.c,v
retrieving revision 1.4
diff -u -r1.4 preproc.c
--- libs/wpp/preproc.c	23 Sep 2003 22:54:57 -0000	1.4
+++ libs/wpp/preproc.c	19 Oct 2003 11:16:59 -0000
@@ -228,7 +228,7 @@
 	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 @@
 	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 @@
  *
  *-------------------------------------------------------------------------
  */
-static char *pp_if_state_str[] = {
+static const char * const pp_if_state_str[] = {
 	"if_false",
 	"if_true",
 	"if_elif",
Index: misc/registry.c
===================================================================
RCS file: /home/wine/wine/misc/registry.c,v
retrieving revision 1.133
diff -u -r1.133 registry.c
--- misc/registry.c	16 Oct 2003 19:12:49 -0000	1.133
+++ misc/registry.c	19 Oct 2003 11:17:02 -0000
@@ -125,7 +125,7 @@
 
 /* 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 @@
 }
 
 /* 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 @@
 /******************************************************************************
  * _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 @@
 }
 
 /* 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 @@
  * 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 @@
 }
 
 /* _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;

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux