diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-09-28 18:53:17 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-09-28 18:53:17 -0700 |
commit | 5340bddccdd21fd34aae996ac3347ddb71f00de6 (patch) | |
tree | 5353a06970ae9e27420f3f4877e442e3fe791003 | |
parent | 84bfc56a89929999db92925c078d9e2f801b1689 (diff) |
Add const attributes to fix gcc -Wwrite-strings warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | x11perf.c | 18 | ||||
-rw-r--r-- | x11perf.h | 8 |
2 files changed, 13 insertions, 13 deletions
@@ -45,7 +45,7 @@ static Pixmap tileToQuery = None; static char *displayName; int abortTest; -typedef struct _RopNames { char *name; int rop; } RopNameRec, *RopNamePtr; +typedef struct _RopNames { const char *name; int rop; } RopNameRec, *RopNamePtr; static RopNameRec ropNames[] = { { "clear", GXclear }, /* 0 */ @@ -92,7 +92,7 @@ static RopNameRec formatNames[] = { { "NATIVE", PictStandardNative }, }; -static char *(visualClassNames)[] = { +static const char *(visualClassNames)[] = { "StaticGray", "GrayScale", "StaticColor", @@ -126,9 +126,9 @@ static int formats[NUM_FORMATS] = { PictStandardNative }; static int numPlanemasks = 1; static unsigned long planemasks[256] = { (unsigned long)~0 }; -static char *foreground = NULL; -static char *background = NULL; -static char *ddbackground = NULL; +static const char *foreground = NULL; +static const char *background = NULL; +static const char *ddbackground = NULL; static int clips = 0; static int numSubWindows = 7; @@ -473,9 +473,9 @@ AbortTest(void) static void usage(void) { - char **cpp; + const char **cpp; int i = 0; - static char *help_message[] = { + static const char *help_message[] = { "where options include:", " -display <host:display> the X server to contact", " -sync do the tests in synchronous mode", @@ -798,7 +798,7 @@ DestroyPerfGCs(XParms xp) } static unsigned long -AllocateColor(Display *display, char *name, unsigned long pixel) +AllocateColor(Display *display, const char *name, unsigned long pixel) { XColor color; @@ -823,7 +823,7 @@ AllocateColor(Display *display, char *name, unsigned long pixel) static void -DisplayStatus(Display *d, char *message, char *test, int try) +DisplayStatus(Display *d, const char *message, const char *test, int try) { char s[500]; @@ -74,7 +74,7 @@ typedef struct _Parms { /* Optional fields. (Wouldn't object-oriented programming be nice ?) */ int special; /* Usually size of objects to paint */ - char *font, *bfont; + const char *font, *bfont; int fillStyle; /* Solid, transparent stipple, opaque stipple, tile */ } ParmRec, *Parms; @@ -115,9 +115,9 @@ typedef enum { } TestType; typedef struct _Test { - char *option; /* Name to use in prompt line */ - char *label; /* Fuller description of test */ - char *label14; /* Labels that are different in Version 1.4 */ + const char *option; /* Name to use in prompt line */ + const char *label; /* Fuller description of test */ + const char *label14; /* Labels that are different in Version 1.4 */ InitProc init; /* Initialization procedure */ Proc proc; /* Timed benchmark procedure */ CleanupProc passCleanup;/* Cleanup between repetitions of same test */ |