[PATCH:libFS 2/2] Mark pattern argument to FSListFonts* as const char *

Alan Coopersmith alan.coopersmith at oracle.com
Fri Nov 11 21:43:05 PST 2011


Needed to fix gcc -Wwrite-strings warnings in clients such as fslsfonts

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 doc/FSlib.txt             |    4 ++--
 include/X11/fonts/FSlib.h |    4 ++--
 src/FSFontInfo.c          |    2 +-
 src/FSFtNames.c           |    2 +-
 src/FSlibInt.c            |    4 ++--
 src/FSlibint.h            |    2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/doc/FSlib.txt b/doc/FSlib.txt
index 18f6ae7..1bdfea3 100644
--- a/doc/FSlib.txt
+++ b/doc/FSlib.txt
@@ -42,7 +42,7 @@ Closes the font.
 char      **
 FSListFonts(
     FSServer     *svr,
-    char       *pattern,
+    const char   *pattern,
     int         maxNames,
     int        *actualCount);
 
@@ -59,7 +59,7 @@ Frees the list of font names returned by FSListFonts.
 char      **
 FSListFontsWithXInfo(
     FSServer     *svr,
-    char       *pattern,
+    const char   *pattern,
     int         maxNames,
     int        *actualCount,
     fsFontHeader ***info,
diff --git a/include/X11/fonts/FSlib.h b/include/X11/fonts/FSlib.h
index b32f314..8063b3e 100644
--- a/include/X11/fonts/FSlib.h
+++ b/include/X11/fonts/FSlib.h
@@ -258,9 +258,9 @@ extern char ** FSGetCatalogues ( FSServer *svr, int *num );
 
 extern long FSMaxRequestSize ( FSServer *svr );
 
-extern char ** FSListFonts ( FSServer *svr, char *pattern, int maxNames,
+extern char ** FSListFonts ( FSServer *svr, const char *pattern, int maxNames,
 			     int *actualCount );
-extern char ** FSListFontsWithXInfo ( FSServer *svr, char *pattern,
+extern char ** FSListFontsWithXInfo ( FSServer *svr, const char *pattern,
 				      int maxNames, int *count,
 				      FSXFontInfoHeader ***info,
 				      FSPropInfo ***pprops,
diff --git a/src/FSFontInfo.c b/src/FSFontInfo.c
index 3d449bf..d9c84b6 100644
--- a/src/FSFontInfo.c
+++ b/src/FSFontInfo.c
@@ -56,7 +56,7 @@ in this Software without prior written authorization from The Open Group.
 char      **
 FSListFontsWithXInfo(
     FSServer		  *svr,
-    char		  *pattern,
+    const char		  *pattern,
     int			   maxNames,
     int			  *count,
     FSXFontInfoHeader	***info,
diff --git a/src/FSFtNames.c b/src/FSFtNames.c
index 7d21efb..9624205 100644
--- a/src/FSFtNames.c
+++ b/src/FSFtNames.c
@@ -57,7 +57,7 @@ in this Software without prior written authorization from The Open Group.
 char      **
 FSListFonts(
     FSServer	*svr,
-    char	*pattern,
+    const char	*pattern,
     int		 maxNames,
     int		*actualCount)
 {
diff --git a/src/FSlibInt.c b/src/FSlibInt.c
index 5a33b64..eea9840 100644
--- a/src/FSlibInt.c
+++ b/src/FSlibInt.c
@@ -536,7 +536,7 @@ _FSReadPad(
 void
 _FSSend(
     register FSServer	*svr,
-    char		*data,
+    const char		*data,
     register long	 size)
 {
     struct iovec iov[3];
@@ -591,7 +591,7 @@ _FSSend(
 	    }
 
 	InsertIOV(svr->buffer, svrbufsize)
-	InsertIOV(data, size)
+	InsertIOV((char *)data, size)
 	InsertIOV(pad, padsize)
 
 	ESET(0);
diff --git a/src/FSlibint.h b/src/FSlibint.h
index b44b153..d5a66b8 100644
--- a/src/FSlibint.h
+++ b/src/FSlibint.h
@@ -74,7 +74,7 @@ extern void _FSFlush ( FSServer *svr );
 extern void _FSRead ( FSServer *svr, char *data, long size );
 extern void _FSReadEvents ( FSServer *svr );
 extern void _FSReadPad ( FSServer *svr, char *data, long size );
-extern void _FSSend ( FSServer *svr, char *data, long size );
+extern void _FSSend ( FSServer *svr, const char *data, long size );
 extern void _FSEnq ( FSServer *svr, fsEvent *event );
 extern void _FSFreeServerStructure ( FSServer *svr );
 extern int _FSError ( FSServer *svr, fsError *rep );
-- 
1.7.3.2



More information about the xorg-devel mailing list