summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-26 15:29:45 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-10-03 09:33:55 -0700
commitdf2008411a5c6a735af2b0fced01df660bb6978a (patch)
tree185e218dc1178cf8fbe7658de70fe12ef6ce178f
parent9347b890ba24db41c7cb6c6e76564e4896bc8cac (diff)
makestrs: Add const attributes to fix gcc -Wwrite-strings warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--util/makestrs.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/util/makestrs.c b/util/makestrs.c
index 89cd2dd..a52866a 100644
--- a/util/makestrs.c
+++ b/util/makestrs.c
@@ -226,7 +226,7 @@ static void DefaultWriteHeader (FILE *f, File *phile)
static void CopyTmplProlog (FILE *tmpl, FILE *f)
{
char buf[1024];
- static char* magic_string = X_MAGIC_STRING;
+ static const char* magic_string = X_MAGIC_STRING;
int magic_string_len = strlen (magic_string);
while (fgets (buf, sizeof buf, tmpl)) {
@@ -245,7 +245,7 @@ static void CopyTmplEpilog (FILE *tmpl, FILE *f)
(void) fputs (buf, f);
}
-static char* abistring[] = {
+static const char* abistring[] = {
"Default", "Array per string", "Intel", "Intel BC", "SPARC", "Function" };
static void WriteHeader (char *tagline, File *phile, int abi)
@@ -301,7 +301,7 @@ static void WriteSourceLine (TableEnt *te, int abi, int fudge)
(void) printf ("%s", "\n");
}
-static char* const_string = "%s %sConst char %s[] = {\n";
+static const char* const_string = "%s %sConst char %s[] = {\n";
static void IntelABIWriteSource (int abi)
{
@@ -460,15 +460,15 @@ static void DoLine(char *buf)
int token;
char lbuf[1024];
- static char* file_str = "#file";
- static char* table_str = "#table";
- static char* prefix_str = "#prefix";
- static char* feature_str = "#feature";
- static char* externref_str = "#externref";
- static char* externdef_str = "#externdef";
- static char* ctmpl_str = "#ctmpl";
- static char* htmpl_str = "#htmpl";
- static char* const_str = "#const";
+ static const char* file_str = "#file";
+ static const char* table_str = "#table";
+ static const char* prefix_str = "#prefix";
+ static const char* feature_str = "#feature";
+ static const char* externref_str = "#externref";
+ static const char* externdef_str = "#externdef";
+ static const char* ctmpl_str = "#ctmpl";
+ static const char* htmpl_str = "#htmpl";
+ static const char* const_str = "#const";
if (strncmp (buf, file_str, strlen (file_str)) == 0)
token = X_FILE_TOKEN;