From df2008411a5c6a735af2b0fced01df660bb6978a Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 26 Sep 2011 15:29:45 -0700 Subject: makestrs: Add const attributes to fix gcc -Wwrite-strings warnings Signed-off-by: Alan Coopersmith --- util/makestrs.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'util') 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; -- cgit v1.2.3