From 995bcdba85df22b9ad7e79a640a462d5dd2080dd Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Fri, 5 Jun 2009 02:48:19 +0000 Subject: [PATCH] Fixed some new gcc gripes about non-const char* for strings --- langkit/main.cpp | 4 ++-- wesley/main.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/langkit/main.cpp b/langkit/main.cpp index a06fbd8..437ac28 100644 --- a/langkit/main.cpp +++ b/langkit/main.cpp @@ -15,8 +15,8 @@ class TokenType { public: enum Type { File, Whitespace, Identifier, Number, Oper Function_Def, Scoped_Block, Statement, Equation, Return, Expression, Term, Factor, Add, Subtract, Multiply, Divide, Negate, Comment, //29 Value, Fun_Call }; }; -char *tokentype_to_string(int tokentype) { - char *token_types[] = {"File", "Whitespace", "Identifier", "Number", "Operator", "Parens_Open", "Parens_Close", //6 +const char *tokentype_to_string(int tokentype) { + const char *token_types[] = {"File", "Whitespace", "Identifier", "Number", "Operator", "Parens_Open", "Parens_Close", //6 "Square_Open", "Square_Close", "Curly_Open", "Curly_Close", "Comma", "Quoted_String", "Single_Quoted_String", "Carriage_Return", "Semicolon", //15 "Function_Def", "Scoped_Block", "Statement", "Equation", "Return", "Expression", "Term", "Factor", "Add", "Subtract", "Multiply", "Divide", "Negate", "Comment", //29 "Value", "Fun_Call" }; diff --git a/wesley/main.cpp b/wesley/main.cpp index 8afdbab..65e8e92 100644 --- a/wesley/main.cpp +++ b/wesley/main.cpp @@ -18,8 +18,8 @@ class TokenType { public: enum Type { File, Whitespace, Identifier, Number, Oper Function_Def, Scoped_Block, Statement, Equation, Return, Expression, Term, Factor, Negate, Comment, Value, Fun_Call, Method_Call, Poetry_Call, Comparison }; }; -char *tokentype_to_string(int tokentype) { - char *token_types[] = {"File", "Whitespace", "Identifier", "Number", "Operator", "Parens_Open", "Parens_Close", +const char *tokentype_to_string(int tokentype) { + const char *token_types[] = {"File", "Whitespace", "Identifier", "Number", "Operator", "Parens_Open", "Parens_Close", "Square_Open", "Square_Close", "Curly_Open", "Curly_Close", "Comma", "Quoted_String", "Single_Quoted_String", "Carriage_Return", "Semicolon", "Function_Def", "Scoped_Block", "Statement", "Equation", "Return", "Expression", "Term", "Factor", "Negate", "Comment", "Value", "Fun_Call", "Method_Call", "Poetry_Call", "Comparison" };