summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-10-02 09:16:05 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-11-11 20:15:06 -0800
commit3715cd752bac912a56aa1cbb9dd874624a709aab (patch)
tree2558e6031d81d08dbf35b6b8ecf6060a0487548c /src
parent8d130ac0fcf19e0e0dd0a404d9317fd8860baad4 (diff)
Add const attributes to fix gcc -Wwrite-strings warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'src')
-rw-r--r--src/FreeType/ftenc.c6
-rw-r--r--src/FreeType/ftfuncs.c2
-rw-r--r--src/bitmap/bdfutils.c12
-rw-r--r--src/bitmap/bitscale.c2
-rw-r--r--src/builtins/builtin.h2
-rw-r--r--src/fc/fsio.c6
-rw-r--r--src/fc/fsio.h4
-rw-r--r--src/fontfile/fontdir.c4
-rw-r--r--src/util/atom.c4
-rw-r--r--src/util/fontxlfd.c2
10 files changed, 22 insertions, 22 deletions
diff --git a/src/FreeType/ftenc.c b/src/FreeType/ftenc.c
index 3c1d43b..9e31d75 100644
--- a/src/FreeType/ftenc.c
+++ b/src/FreeType/ftenc.c
@@ -43,9 +43,9 @@ THE SOFTWARE.
static int find_cmap(int, int, int, FT_Face, FT_CharMap *);
static int
-FTEncFontSpecific(char *encoding)
+FTEncFontSpecific(const char *encoding)
{
- char *p = encoding;
+ const char *p = encoding;
if(strcasecmp(encoding, "microsoft-symbol") == 0)
return 1;
@@ -69,7 +69,7 @@ FTPickMapping(char *xlfd, int length, char *filename, FT_Face face,
int ftrc;
int symbol = 0;
const char *enc, *reg;
- char *encoding_name = 0;
+ const char *encoding_name = 0;
char buf[20];
if(xlfd)
diff --git a/src/FreeType/ftfuncs.c b/src/FreeType/ftfuncs.c
index b8cf49a..918e3f3 100644
--- a/src/FreeType/ftfuncs.c
+++ b/src/FreeType/ftfuncs.c
@@ -94,7 +94,7 @@ static CharInfoRec noSuchChar = { /* metrics */{0,0,0,0,0,0},
/* The propery names for all the XLFD properties. */
-static char *xlfd_props[] = {
+static const char *xlfd_props[] = {
"FOUNDRY",
"FAMILY_NAME",
"WEIGHT_NAME",
diff --git a/src/bitmap/bdfutils.c b/src/bitmap/bdfutils.c
index a0106b7..3a3ee26 100644
--- a/src/bitmap/bdfutils.c
+++ b/src/bitmap/bdfutils.c
@@ -68,7 +68,7 @@ int bdfFileLineNum;
/***====================================================================***/
void
-bdfError(char* message, ...)
+bdfError(const char* message, ...)
{
va_list args;
@@ -81,7 +81,7 @@ bdfError(char* message, ...)
/***====================================================================***/
void
-bdfWarning(char *message, ...)
+bdfWarning(const char *message, ...)
{
va_list args;
@@ -127,7 +127,7 @@ bdfGetLine(FontFilePtr file, unsigned char *buf, int len)
/***====================================================================***/
Atom
-bdfForceMakeAtom(char *str, int *size)
+bdfForceMakeAtom(const char *str, int *size)
{
register int len = strlen(str);
Atom the_atom;
@@ -249,7 +249,7 @@ bdfHexByte(unsigned char *s)
* check for known special property values
*/
-static char *SpecialAtoms[] = {
+static const char *SpecialAtoms[] = {
"FONT_ASCENT",
#define BDF_FONT_ASCENT 0
"FONT_DESCENT",
@@ -279,8 +279,8 @@ Bool
bdfSpecialProperty(FontPtr pFont, FontPropPtr prop,
char isString, bdfFileState *bdfState)
{
- char **special;
- char *name;
+ const char **special;
+ const char *name;
name = NameForAtom(prop->name);
for (special = SpecialAtoms; *special; special++)
diff --git a/src/bitmap/bitscale.c b/src/bitmap/bitscale.c
index b857237..e89ba7c 100644
--- a/src/bitmap/bitscale.c
+++ b/src/bitmap/bitscale.c
@@ -78,7 +78,7 @@ enum scaleType {
};
typedef struct _fontProp {
- char *name;
+ const char *name;
Atom atom;
enum scaleType type;
} fontProp;
diff --git a/src/builtins/builtin.h b/src/builtins/builtin.h
index d97d9a5..75dff8d 100644
--- a/src/builtins/builtin.h
+++ b/src/builtins/builtin.h
@@ -36,7 +36,7 @@ typedef struct _BuiltinFile {
} BuiltinFileRec, *BuiltinFilePtr;
typedef struct _BuiltinDir {
- char *file_name;
+ const char *file_name;
char *font_name;
} BuiltinDirRec, *BuiltinDirPtr;
diff --git a/src/fc/fsio.c b/src/fc/fsio.c
index 569b3aa..03a689f 100644
--- a/src/fc/fsio.c
+++ b/src/fc/fsio.c
@@ -369,7 +369,7 @@ _fs_io_fini (FSFpePtr conn)
}
static int
-_fs_do_write(FSFpePtr conn, char *data, long len, long size)
+_fs_do_write(FSFpePtr conn, const char *data, long len, long size)
{
if (size == 0) {
#ifdef DEBUG
@@ -403,7 +403,7 @@ _fs_do_write(FSFpePtr conn, char *data, long len, long size)
* Write the indicated bytes
*/
int
-_fs_write (FSFpePtr conn, char *data, long len)
+_fs_write (FSFpePtr conn, const char *data, long len)
{
return _fs_do_write (conn, data, len, len);
}
@@ -412,7 +412,7 @@ _fs_write (FSFpePtr conn, char *data, long len)
* Write the indicated bytes adding any appropriate pad
*/
int
-_fs_write_pad(FSFpePtr conn, char *data, long len)
+_fs_write_pad(FSFpePtr conn, const char *data, long len)
{
return _fs_do_write (conn, data, len, len + padlength[len & 3]);
}
diff --git a/src/fc/fsio.h b/src/fc/fsio.h
index 1d1b3dd..2bb8e0b 100644
--- a/src/fc/fsio.h
+++ b/src/fc/fsio.h
@@ -129,8 +129,8 @@ typedef struct _fs_fpe_data {
#define FSIO_ERROR -1
extern Bool _fs_reopen_server ( FSFpePtr conn );
-extern int _fs_write ( FSFpePtr conn, char *data, long size );
-extern int _fs_write_pad ( FSFpePtr conn, char *data, long len );
+extern int _fs_write ( FSFpePtr conn, const char *data, long size );
+extern int _fs_write_pad ( FSFpePtr conn, const char *data, long len );
extern int _fs_wait_for_readable ( FSFpePtr conn, int ms );
extern long _fs_pad_length (long len);
diff --git a/src/fontfile/fontdir.c b/src/fontfile/fontdir.c
index e524696..97b2ba3 100644
--- a/src/fontfile/fontdir.c
+++ b/src/fontfile/fontdir.c
@@ -102,12 +102,12 @@ FontFileFreeTable (FontTablePtr table)
}
FontDirectoryPtr
-FontFileMakeDir(char *dirName, int size)
+FontFileMakeDir(const char *dirName, int size)
{
FontDirectoryPtr dir;
int dirlen;
int needslash = 0;
- char *attrib;
+ const char *attrib;
int attriblen;
#if !defined(WIN32)
diff --git a/src/util/atom.c b/src/util/atom.c
index 4f69363..c47cb5c 100644
--- a/src/util/atom.c
+++ b/src/util/atom.c
@@ -54,7 +54,7 @@ static int reverseMapSize;
static Atom lastAtom;
static int
-Hash(char *string, int len)
+Hash(const char *string, int len)
{
int h;
@@ -147,7 +147,7 @@ NameEqual (const char *a, const char *b, int l)
#endif
weak Atom
-MakeAtom(char *string, unsigned len, int makeit)
+MakeAtom(const char *string, unsigned len, int makeit)
{
AtomListPtr a;
int hash;
diff --git a/src/util/fontxlfd.c b/src/util/fontxlfd.c
index 8124037..18046e9 100644
--- a/src/util/fontxlfd.c
+++ b/src/util/fontxlfd.c
@@ -70,7 +70,7 @@ GetInt(char *ptr, int *val)
#ifndef NO_LOCALE
static struct lconv *locale = 0;
#endif
-static char *radix = ".", *plus = "+", *minus = "-";
+static const char *radix = ".", *plus = "+", *minus = "-";
static char *
readreal(char *ptr, double *result)