Fix some warnings caused by treating string literals as non-const.
authorDavid Reiss <dreiss@apache.org>
Tue, 10 Jun 2008 22:56:12 +0000 (22:56 +0000)
committerDavid Reiss <dreiss@apache.org>
Tue, 10 Jun 2008 22:56:12 +0000 (22:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666368 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/main.cc
compiler/cpp/src/main.h

index efee937..acb27a8 100644 (file)
@@ -189,7 +189,7 @@ char *saferealpath(const char *path, char *resolved_path) {
  *
  * @param fmt C format string followed by additional arguments
  */
-void yyerror(char* fmt, ...) {
+void yyerror(const char* fmt, ...) {
   va_list args;
   fprintf(stderr,
           "[ERROR:%s:%d] (last token was '%s')\n",
@@ -209,7 +209,7 @@ void yyerror(char* fmt, ...) {
  *
  * @param fmt C format string followed by additional arguments
  */
-void pdebug(char* fmt, ...) {
+void pdebug(const char* fmt, ...) {
   if (g_debug == 0) {
     return;
   }
@@ -226,7 +226,7 @@ void pdebug(char* fmt, ...) {
  *
  * @param fmt C format string followed by additional arguments
  */
-void pverbose(char* fmt, ...) {
+void pverbose(const char* fmt, ...) {
   if (g_verbose == 0) {
     return;
   }
@@ -241,7 +241,7 @@ void pverbose(char* fmt, ...) {
  *
  * @param fmt C format string followed by additional arguments
  */
-void pwarning(int level, char* fmt, ...) {
+void pwarning(int level, const char* fmt, ...) {
   if (g_warn < level) {
     return;
   }
index 3ab2744..eb355f0 100644 (file)
@@ -22,17 +22,17 @@ int yyparse(void);
 /**
  * Expected to be defined by Flex/Bison
  */
-void yyerror(char* fmt, ...);
+void yyerror(const char* fmt, ...);
 
 /**
  * Parse debugging output, used to print helpful info
  */
-void pdebug(char* fmt, ...);
+void pdebug(const char* fmt, ...);
 
 /**
  * Parser warning
  */
-void pwarning(int level, char* fmt, ...);
+void pwarning(int level, const char* fmt, ...);
 
 /**
  * Failure!