[PATCH:libFS 1/2] Change FSOpenServer and FSServerName to take const char * args.

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


Matches the current versions of the XOpenDisplay & XDisplayName
functions they're modeled on.

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

diff --git a/doc/FSlib.txt b/doc/FSlib.txt
index 6d1ee25..18f6ae7 100644
--- a/doc/FSlib.txt
+++ b/doc/FSlib.txt
@@ -6,7 +6,7 @@ Connection Setup
 
 FSServer     *
 FSOpenServer(
-    char       *server);
+    const char   *server);
 
 Creates a connection to the font server specified in the 'server' string.
 
@@ -223,8 +223,8 @@ server can handle.
 
 char       *
 FSServerName(
-    char       *server);
+    const char    *server);
 
 Returns the name that FSlib would use to connect to the server.
-Translates a NULL in the value of $FONT_SERVER.
+Translates a NULL into the value of $FONT_SERVER.
 
diff --git a/include/X11/fonts/FSlib.h b/include/X11/fonts/FSlib.h
index 9060791..b32f314 100644
--- a/include/X11/fonts/FSlib.h
+++ b/include/X11/fonts/FSlib.h
@@ -242,12 +242,12 @@ typedef struct _FSXFontInfoHeader {
 
 _XFUNCPROTOBEGIN
 
-extern FSServer * FSOpenServer ( char *server );
+extern FSServer * FSOpenServer ( const char *server );
 
 extern FSSyncHandler FSSynchronize(FSServer *, int);
 extern FSSyncHandler FSSetAfterFunction(FSServer *, FSSyncHandler);
 
-extern char * FSServerName ( char *server );
+extern char * FSServerName ( const char *server );
 extern char ** FSListExtensions ( FSServer *svr, int *next );
 extern int FSQueryExtension ( FSServer *svr, char *name, int *major_opcode,
 			      int *first_event, int *first_error );
diff --git a/src/FSOpenServ.c b/src/FSOpenServ.c
index 040b254..32f7d25 100644
--- a/src/FSOpenServ.c
+++ b/src/FSOpenServ.c
@@ -101,7 +101,7 @@ void OutOfMemory(
  */
 
 FSServer   *
-FSOpenServer(char *server)
+FSOpenServer(const char *server)
 {
     FSServer   *svr;
     int         i;
@@ -135,7 +135,7 @@ FSOpenServer(char *server)
     }
     (void) strcpy(svr->server_name, server);
 
-    if ((svr->trans_conn = _FSConnectServer(server)) == NULL) {
+    if ((svr->trans_conn = _FSConnectServer(svr->server_name)) == NULL) {
 	goto fail;
     }
 
diff --git a/src/FSServName.c b/src/FSServName.c
index 022be82..a535b38 100644
--- a/src/FSServName.c
+++ b/src/FSServName.c
@@ -59,12 +59,12 @@ in this Software without prior written authorization from The Open Group.
 #include	"FSlib.h"
 
 char       *
-FSServerName(char *server)
+FSServerName(const char *server)
 {
     char       *s;
 
     if (server != NULL && *server != '\0')
-	return server;
+	return (char *) server;
     if ((s = getenv("FONTSERVER")) != NULL)
 	return s;
     return NULL;
-- 
1.7.3.2



More information about the xorg-devel mailing list