[janitor] dlls/x11drv -Wwrite-strings cleanup

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

 



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

Index: dlls/x11drv/clipboard.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/clipboard.c,v
retrieving revision 1.12
diff -u -r1.12 clipboard.c
--- dlls/x11drv/clipboard.c	5 Sep 2003 23:08:26 -0000	1.12
+++ dlls/x11drv/clipboard.c	12 Oct 2003 10:18:35 -0000
@@ -156,70 +156,70 @@
  */
 WINE_CLIPFORMAT ClipFormats[]  =
 {
-    { CF_TEXT, "WCF_TEXT",  0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_TEXT, FAKE_LPSTR("WCF_TEXT"),  0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, NULL, &ClipFormats[1]},
 
-    { CF_BITMAP, "WCF_BITMAP", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_BITMAP, FAKE_LPSTR("WCF_BITMAP"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[0], &ClipFormats[2]},
 
-    { CF_METAFILEPICT, "WCF_METAFILEPICT", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportMetaFilePict,
+    { CF_METAFILEPICT, FAKE_LPSTR("WCF_METAFILEPICT"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportMetaFilePict,
         X11DRV_CLIPBOARD_ExportMetaFilePict, &ClipFormats[1], &ClipFormats[3]},
 
-    { CF_SYLK, "WCF_SYLK", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_SYLK, FAKE_LPSTR("WCF_SYLK"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[2], &ClipFormats[4]},
 
-    { CF_DIF, "WCF_DIF", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_DIF, FAKE_LPSTR("WCF_DIF"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[3], &ClipFormats[5]},
 
-    { CF_TIFF, "WCF_TIFF", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_TIFF, FAKE_LPSTR("WCF_TIFF"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[4], &ClipFormats[6]},
 
-    { CF_OEMTEXT, "WCF_OEMTEXT", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_OEMTEXT, FAKE_LPSTR("WCF_OEMTEXT"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[5], &ClipFormats[7]},
 
-    { CF_DIB, "WCF_DIB", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportXAPIXMAP,
+    { CF_DIB, FAKE_LPSTR("WCF_DIB"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportXAPIXMAP,
 	X11DRV_CLIPBOARD_ExportXAPIXMAP, &ClipFormats[6], &ClipFormats[8]},
 
-    { CF_PALETTE, "WCF_PALETTE", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_PALETTE, FAKE_LPSTR("WCF_PALETTE"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[7], &ClipFormats[9]},
 
-    { CF_PENDATA, "WCF_PENDATA", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_PENDATA, FAKE_LPSTR("WCF_PENDATA"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[8], &ClipFormats[10]},
 
-    { CF_RIFF, "WCF_RIFF", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_RIFF, FAKE_LPSTR("WCF_RIFF"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[9], &ClipFormats[11]},
 
-    { CF_WAVE, "WCF_WAVE", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_WAVE, FAKE_LPSTR("WCF_WAVE"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[10], &ClipFormats[12]},
 
-    { CF_UNICODETEXT, "WCF_UNICODETEXT", XA_STRING, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportXAString,
+    { CF_UNICODETEXT, FAKE_LPSTR("WCF_UNICODETEXT"), XA_STRING, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportXAString,
 	X11DRV_CLIPBOARD_ExportString, &ClipFormats[11], &ClipFormats[13]},
 
-    { CF_ENHMETAFILE, "WCF_ENHMETAFILE", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportEnhMetaFile,
+    { CF_ENHMETAFILE, FAKE_LPSTR("WCF_ENHMETAFILE"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportEnhMetaFile,
         X11DRV_CLIPBOARD_ExportEnhMetaFile, &ClipFormats[12], &ClipFormats[14]},
 
-    { CF_HDROP, "WCF_HDROP", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_HDROP, FAKE_LPSTR("WCF_HDROP"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[13], &ClipFormats[15]},
 
-    { CF_LOCALE, "WCF_LOCALE", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_LOCALE, FAKE_LPSTR("WCF_LOCALE"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[14], &ClipFormats[16]},
 
-    { CF_DIBV5, "WCF_DIBV5", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_DIBV5, FAKE_LPSTR("WCF_DIBV5"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[15], &ClipFormats[17]},
 
-    { CF_OWNERDISPLAY, "WCF_OWNERDISPLAY", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_OWNERDISPLAY, FAKE_LPSTR("WCF_OWNERDISPLAY"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[16], &ClipFormats[18]},
 
-    { CF_DSPTEXT, "WCF_DSPTEXT", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_DSPTEXT, FAKE_LPSTR("WCF_DSPTEXT"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[17], &ClipFormats[19]},
 
-    { CF_DSPBITMAP, "WCF_DSPBITMAP", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_DSPBITMAP, FAKE_LPSTR("WCF_DSPBITMAP"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[18], &ClipFormats[20]},
 
-    { CF_DSPMETAFILEPICT, "WCF_DSPMETAFILEPICT", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_DSPMETAFILEPICT, FAKE_LPSTR("WCF_DSPMETAFILEPICT"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[19], &ClipFormats[21]},
 
-    { CF_DSPENHMETAFILE, "WCF_DSPENHMETAFILE", 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
+    { CF_DSPENHMETAFILE, FAKE_LPSTR("WCF_DSPENHMETAFILE"), 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData,
         X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[20], NULL}
 };
 
Index: dlls/x11drv/desktop.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/desktop.c,v
retrieving revision 1.15
diff -u -r1.15 desktop.c
--- dlls/x11drv/desktop.c	30 Sep 2003 00:31:42 -0000	1.15
+++ dlls/x11drv/desktop.c	12 Oct 2003 10:18:37 -0000
@@ -285,8 +285,8 @@
     wm_hints->flags = InputHint | StateHint;
     wm_hints->input = True;
     wm_hints->initial_state = NormalState;
-    class_hints->res_name  = "wine";
-    class_hints->res_class = "Wine";
+    class_hints->res_name  = FAKE_CHARPTR("wine");
+    class_hints->res_class = FAKE_CHARPTR("Wine");
 
     XStringListToTextProperty( &name, 1, &window_name );
     XSetWMProperties( display, win, &window_name, &window_name,
Index: dlls/x11drv/keyboard.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/keyboard.c,v
retrieving revision 1.35
diff -u -r1.35 keyboard.c
--- dlls/x11drv/keyboard.c	2 Oct 2003 04:28:57 -0000	1.35
+++ dlls/x11drv/keyboard.c	12 Oct 2003 10:18:48 -0000
@@ -1034,7 +1034,7 @@
 
     Str[ascii_chars] = '\0';
     if (TRACE_ON(key)){
-	char	*ksname;
+	const char	*ksname;
 
 	ksname = TSXKeysymToString(keysym);
 	if (!ksname)
@@ -1374,7 +1374,7 @@
                     TRACE("(");
                     for (i = 0; i < keysyms_per_keycode; i += 1)
                     {
-                        char	*ksname;
+                        const char	*ksname;
 
                         keysym = XLookupKeysym(&e2, i);
                         ksname = XKeysymToString(keysym);
@@ -1393,7 +1393,7 @@
     /* If some keys still lack scancodes, assign some arbitrary ones to them now */
     for (scan = 0x60, keyc = min_keycode; keyc <= max_keycode; keyc++)
       if (keyc2vkey[keyc]&&!keyc2scan[keyc]) {
-	char *ksname;
+	const char *ksname;
 	keysym = XKeycodeToKeysym(display, keyc, 0);
 	ksname = XKeysymToString(keysym);
 	if (!ksname) ksname = "NoSymbol";
@@ -1868,7 +1868,7 @@
 	    }
 	else
 	    {
-	    char	*ksname;
+	    const char	*ksname;
 
 	    ksname = TSXKeysymToString(keysym);
 	    if (!ksname)
Index: dlls/x11drv/window.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/window.c,v
retrieving revision 1.59
diff -u -r1.59 window.c
--- dlls/x11drv/window.c	3 Oct 2003 03:38:05 -0000	1.59
+++ dlls/x11drv/window.c	12 Oct 2003 10:18:55 -0000
@@ -351,8 +351,8 @@
     /* class hints */
     if ((class_hints = XAllocClassHint()))
     {
-        class_hints->res_name = "wine";
-        class_hints->res_class = "Wine";
+        class_hints->res_name = FAKE_CHARPTR("wine");
+        class_hints->res_class = FAKE_CHARPTR("Wine");
         XSetClassHint( display, data->whole_window, class_hints );
         XFree( class_hints );
     }
Index: dlls/x11drv/wineclipsrv.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/wineclipsrv.c,v
retrieving revision 1.4
diff -u -r1.4 wineclipsrv.c
--- dlls/x11drv/wineclipsrv.c	5 Jul 2002 21:22:09 -0000	1.4
+++ dlls/x11drv/wineclipsrv.c	12 Oct 2003 10:19:04 -0000
@@ -141,6 +141,8 @@
 #define C_WARN           4
 #define C_TRACE          8
 
+#define FAKE_CHARPTR(s)  ((char *)(unsigned long)(s))
+
 /*
  * Global variables
  */
@@ -151,7 +153,7 @@
 static Window g_win = 0;               /* the hidden clipboard server window */
 static GC g_gc = 0;
 
-static char *g_szOutOfMemory = "Insufficient memory!\n";
+static const char *g_szOutOfMemory = "Insufficient memory!\n";
 
 /* X selection context info */
 static char _CLIPBOARD[] = "CLIPBOARD";        /* CLIPBOARD atom name */
@@ -206,7 +208,7 @@
 void EVENT_SelectionClear( XSelectionClearEvent *event );
 void EVENT_PropertyNotify( XPropertyEvent *event );
 Pixmap DuplicatePixmap(Pixmap pixmap);
-void TextOut(Window win, GC gc, char *pStr);
+void TextOut(Window win, GC gc, const char *pStr);
 void getGC(Window win, GC *gc);
 
 
@@ -281,7 +283,7 @@
     unsigned int width, height;	/* window size */
     unsigned int border_width = 4;	/* four pixels */
     unsigned int display_width, display_height;
-    char *window_name = "Wine Clipboard Server";
+    char *window_name = FAKE_CHARPTR("Wine Clipboard Server");
     XSizeHints *size_hints = NULL;
     XWMHints *wm_hints = NULL;
     XClassHint *class_hints = NULL;
@@ -351,7 +353,7 @@
     wm_hints->flags = StateHint | InputHint;
 
     class_hints->res_name = progname;
-    class_hints->res_class = "WineClipSrv";
+    class_hints->res_class = FAKE_CHARPTR("WineClipSrv");
 
     XSetWMProperties(g_display, g_win, &windowName, NULL,
                     argv, argc, size_hints, wm_hints,
@@ -1177,7 +1179,7 @@
 /***********************************************************************
  *           TextOut
  */
-void TextOut(Window win, GC gc, char *pStr)
+void TextOut(Window win, GC gc, const char *pStr)
 {
 	int y_offset, x_offset;
 
Index: dlls/x11drv/x11drv.h
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/x11drv.h,v
retrieving revision 1.5
diff -u -r1.5 x11drv.h
--- dlls/x11drv/x11drv.h	16 Sep 2003 20:24:29 -0000	1.5
+++ dlls/x11drv/x11drv.h	12 Oct 2003 10:19:04 -0000
@@ -48,6 +48,9 @@
 
 #define MAX_PIXELFORMATS 8
 
+#define FAKE_CHARPTR(s)	((char *)(unsigned long)(s))
+#define FAKE_LPSTR(s)	((LPSTR)(unsigned long)(s))
+
 struct tagBITMAPOBJ;
 struct tagCURSORICONINFO;
 struct tagPALETTEOBJ;

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

  Powered by Linux