Author: dreiss
Date: Tue Jun 10 15:56:12 2008
New Revision: 666368
URL: http://svn.apache.org/viewvc?rev=666368&view=rev
Log:
Fix some warnings caused by treating string literals as non-const.
Modified:
incubator/thrift/trunk/compiler/cpp/src/main.cc
incubator/thrift/trunk/compiler/cpp/src/main.h
Modified: incubator/thrift/trunk/compiler/cpp/src/main.cc
URL:
http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/main.cc?rev=666368&r1=666367&r2=666368&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/main.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/main.cc Tue Jun 10 15:56:12 2008
@@ -189,7 +189,7 @@
*
* @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 @@
*
* @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 @@
*
* @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 @@
*
* @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;
}
Modified: incubator/thrift/trunk/compiler/cpp/src/main.h
URL:
http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/main.h?rev=666368&r1=666367&r2=666368&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/main.h (original)
+++ incubator/thrift/trunk/compiler/cpp/src/main.h Tue Jun 10 15:56:12 2008
@@ -22,17 +22,17 @@
/**
* 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!