[PATCH] Allow paths and patterns to be const
Keith Packard
keithp at keithp.com
Mon Nov 18 16:58:54 PST 2013
Signed-off-by: Keith Packard <keithp at keithp.com>
---
Note that this changes the API to the library; the X server, in
particular, requires changes before this can be merged.
font.h | 4 ++--
fontstruct.h | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/font.h b/font.h
index e6a00cd..dec78b1 100644
--- a/font.h
+++ b/font.h
@@ -143,7 +143,7 @@ extern void EmptyFontPatternCache (
extern void CacheFontPattern (
FontPatternCachePtr /* cache */,
- char * /* pattern */,
+ const char * /* pattern */,
int /* patlen */,
FontPtr /* pFont */
);
@@ -153,7 +153,7 @@ extern FontResolutionPtr GetClientResolutions(
extern FontPtr FindCachedFontPattern (
FontPatternCachePtr /* cache */,
- char * /* pattern */,
+ const char * /* pattern */,
int /* patlen */
);
diff --git a/fontstruct.h b/fontstruct.h
index 451ed6a..d62f594 100644
--- a/fontstruct.h
+++ b/fontstruct.h
@@ -148,20 +148,20 @@ typedef struct _FontNames {
/* External view of font paths */
typedef struct _FontPathElement {
int name_length;
- char *name;
+ const char *name;
int type;
int refcount;
pointer private;
} FontPathElementRec;
-typedef Bool (*NameCheckFunc) (char *name);
+typedef Bool (*NameCheckFunc) (const char *name);
typedef int (*InitFpeFunc) (FontPathElementPtr fpe);
typedef int (*FreeFpeFunc) (FontPathElementPtr fpe);
typedef int (*ResetFpeFunc) (FontPathElementPtr fpe);
typedef int (*OpenFontFunc) ( pointer client,
FontPathElementPtr fpe,
Mask flags,
- char* name,
+ const char* name,
int namelen,
fsBitmapFormat format,
fsBitmapFormatMask fmask,
@@ -172,14 +172,14 @@ typedef int (*OpenFontFunc) ( pointer client,
typedef void (*CloseFontFunc) (FontPathElementPtr fpe, FontPtr pFont);
typedef int (*ListFontsFunc) (pointer client,
FontPathElementPtr fpe,
- char* pat,
+ const char* pat,
int len,
int max,
FontNamesPtr names);
typedef int (*StartLfwiFunc) (pointer client,
FontPathElementPtr fpe,
- char* pat,
+ const char* pat,
int len,
int max,
pointer* privatep);
@@ -207,7 +207,7 @@ typedef int (*LoadGlyphsFunc) (pointer client,
typedef int (*StartLaFunc) (pointer client,
FontPathElementPtr fpe,
- char* pat,
+ const char* pat,
int len,
int max,
pointer* privatep);
--
1.8.4.2
More information about the xorg-devel
mailing list