[PATCH] constify defaultFontPath() path argument

Bernardo Innocenti bernie at codewiz.org
Wed Jul 11 09:56:39 PDT 2007


---
 dix/dixfonts.c    |    8 +++++---
 dix/globals.c     |    2 +-
 include/dixfont.h |    2 +-
 include/globals.h |    2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index c21b3ec..915f284 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1783,10 +1783,10 @@ SetFontPath(ClientPtr client, int npaths, unsigned char *paths, int *error)
 }
 
 int
-SetDefaultFontPath(char *path)
+SetDefaultFontPath(const char *path)
 {
+    const unsigned char *pp;
     unsigned char *cp,
-               *pp,
                *nump,
                *newpath;
     int         num = 1,
@@ -1800,7 +1800,7 @@ SetDefaultFontPath(char *path)
     nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len);
     if (!newpath)
 	return BadAlloc;
-    pp = (unsigned char *) path;
+    pp = (const unsigned char *) path;
     cp++;
     while (*pp) {
 	if (*pp == ',') {
@@ -1886,7 +1886,9 @@ InitFonts (void)
     if (screenInfo.numScreens > screenInfo.numVideoScreens) {
 	PrinterFontRegisterFpeFunctions();
 	FontFileCheckRegisterFpeFunctions();
+#ifndef NOFONTSERVERACCESS
 	check_fs_register_fpe_functions();
+#endif
     } else 
 #endif
     {
diff --git a/dix/globals.c b/dix/globals.c
index f86c602..c40993e 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -133,7 +133,7 @@ int  logoScreenSaver = DEFAULT_LOGO_SCREEN_SAVER;
 Bool screenSaverSuspended = FALSE;
 #endif
 
-char *defaultFontPath = COMPILEDDEFAULTFONTPATH;
+const char *defaultFontPath = COMPILEDDEFAULTFONTPATH;
 char *defaultTextFont = COMPILEDDEFAULTFONT;
 char *defaultCursorFont = COMPILEDCURSORFONT;
 char *rgbPath = RGB_DB;
diff --git a/include/dixfont.h b/include/dixfont.h
index 709da62..2150253 100644
--- a/include/dixfont.h
+++ b/include/dixfont.h
@@ -103,7 +103,7 @@ extern int SetFontPath(ClientPtr /*client*/,
 		       unsigned char * /*paths*/,
 		       int * /*error*/);
 
-extern int SetDefaultFontPath(char * /*path*/);
+extern int SetDefaultFontPath(const char * /*path*/);
 
 extern unsigned char *GetFontPath(int * /*count*/,
 				  int * /*length*/);
diff --git a/include/globals.h b/include/globals.h
index e23ce77..435d656 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -15,7 +15,7 @@ extern CARD32 ScreenSaverInterval;
 extern Bool screenSaverSuspended;
 #endif
 
-extern char *defaultFontPath;
+extern const char *defaultFontPath;
 extern char *rgbPath;
 extern int monitorResolution;
 extern Bool loadableFonts;
-- 
1.5.2.2




More information about the xorg mailing list