summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-30 20:19:44 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-30 20:19:44 -0700
commitaf2cc5bc2e13a61e6ab3d495d3edb34d94a42964 (patch)
treef3cf6b505190ac41b4c683ef74e1b9e6ff5e8c6c
parent7fbf2ff3c925a0cc55024bc8350ad9e9bf8d1e47 (diff)
Add const attributes to clear gcc -Wwrite-strings warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--common.c6
-rw-r--r--print_render.c4
-rw-r--r--proto.h8
-rw-r--r--prtype.c2
-rw-r--r--scope.c10
5 files changed, 15 insertions, 15 deletions
diff --git a/common.c b/common.c
index 3779b13..a0d240b 100644
--- a/common.c
+++ b/common.c
@@ -58,19 +58,19 @@
/* ********************************************** */
void
-enterprocedure (char *s)
+enterprocedure (const char *s)
{
debug(2,(stderr, "-> %s\n", s));
}
void
-warn (char *s)
+warn (const char *s)
{
fprintf(stderr, "####### %s\n", s);
}
void
-panic (char *s)
+panic (const char *s)
{
fprintf(stderr, "%s\n", s);
exit(1);
diff --git a/print_render.c b/print_render.c
index f4dbee0..b6053e8 100644
--- a/print_render.c
+++ b/print_render.c
@@ -390,7 +390,7 @@ RenderFreeGlyphSet (FD fd, const unsigned char *buf)
}
static void
-PrintGlyphs(const unsigned char *buf, int n, char *name)
+PrintGlyphs(const unsigned char *buf, int n, const char *name)
{
const unsigned char *gids;
const unsigned char *glyphs;
@@ -452,7 +452,7 @@ RenderFreeGlyphs (FD fd, const unsigned char *buf)
}
static void
-PrintGlyphList(const unsigned char *buf, int length, char *name, int size)
+PrintGlyphList(const unsigned char *buf, int length, const char *name, int size)
{
short n;
diff --git a/proto.h b/proto.h
index 7963e86..3c338c7 100644
--- a/proto.h
+++ b/proto.h
@@ -1,9 +1,9 @@
#include "x11.h"
/* common.c */
-extern void enterprocedure (char *s);
-extern void warn (char *s);
-extern void panic (char *s);
+extern void enterprocedure (const char *s);
+extern void warn (const char *s);
+extern void panic (const char *s);
extern void SetSignalHandling (void);
extern void SetUpConnectionSocket (int iport, void (*connectionFunc) (int));
@@ -266,7 +266,7 @@ extern void SetUpPair (FD client, FD server);
extern FD FDPair (FD fd);
extern FD ClientHalf (FD fd);
extern FD ServerHalf (FD fd);
-extern char *ClientName (FD fd);
+extern const char *ClientName (FD fd);
extern int ClientNumber (FD fd);
extern void NewConnection (FD fd);
extern void FlushFD (FD fd);
diff --git a/prtype.c b/prtype.c
index 81c9a61..371d315 100644
--- a/prtype.c
+++ b/prtype.c
@@ -68,7 +68,7 @@
/* print representation of a character for debugging */
-static char *
+static const char *
printrep (unsigned short c)
{
static char pr[8];
diff --git a/scope.c b/scope.c
index f2716d2..2fec497 100644
--- a/scope.c
+++ b/scope.c
@@ -131,11 +131,11 @@ static CMDResult CMDQuit (int argc, char **argv);
static CMDResult CMDHelp (int argc, char **argv);
typedef struct _CMDFunc {
- char *name;
- char *alias;
+ const char *name;
+ const char *alias;
CMDResult (*func)(int argc, char **argv);
- char *usage;
- char *help;
+ const char *usage;
+ const char *help;
} CMDFuncRec;
typedef const CMDFuncRec *CMDFuncPtr;
@@ -1050,7 +1050,7 @@ ServerHalf (
return(FDinfo[fd].pair);
}
-char *
+const char *
ClientName (
FD fd)
{