From c44cc1989fe1b4cd94c115fb9a62b73afc46e62f Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 12 Feb 2010 13:53:00 +0000 Subject: Fix compiler warnings. --- server/src/log.cc | 2 +- server/src/luaresume.cc | 2 +- server/src/macrotool.cc | 6 +++--- server/src/macrotool_dump.cc | 12 ++++++------ server/src/macrotool_fieldnames.cc | 12 ++++++------ server/src/macrotool_filehandler.cc | 10 +++++----- server/src/macrotool_util.cc | 2 +- server/src/pracrod.cc | 6 +++--- server/src/queryhandlerpentominos.cc | 8 ++++---- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/server/src/log.cc b/server/src/log.cc index 92a77f6..fe72422 100644 --- a/server/src/log.cc +++ b/server/src/log.cc @@ -39,5 +39,5 @@ void log(std::string message) { syslog(LOG_CONS, // Write to console if error sending to system logger. - message.c_str()); + "%s", message.c_str()); } diff --git a/server/src/luaresume.cc b/server/src/luaresume.cc index 15377d8..9bf6fd4 100644 --- a/server/src/luaresume.cc +++ b/server/src/luaresume.cc @@ -99,7 +99,7 @@ std::string LUAResume::run(std::string program) return false; } - PRACRO_DEBUG("Running %s\n", program.c_str()); + PRACRO_DEBUG(luaresume, "Running %s\n", program.c_str()); /* lua_pushstring(L, value.toStdString().c_str()); diff --git a/server/src/macrotool.cc b/server/src/macrotool.cc index bb8c8fc..40ca845 100644 --- a/server/src/macrotool.cc +++ b/server/src/macrotool.cc @@ -117,13 +117,13 @@ int main(int argc, char *argv[]) case '?': case 'h': - printf(version_str); + printf("%s", version_str); printf(usage_str, argv[0]); return 0; case 'v': - printf(version_str); - printf(copyright_str); + printf("%s", version_str); + printf("%s", copyright_str); return 0; default: diff --git a/server/src/macrotool_dump.cc b/server/src/macrotool_dump.cc index 66b4ad7..f3f7e42 100644 --- a/server/src/macrotool_dump.cc +++ b/server/src/macrotool_dump.cc @@ -292,7 +292,7 @@ static void dump_templates() void macrotool_dump(std::vector params) { if(params.size() < 1) { - printf(usage_str); + printf("%s", usage_str); return; } @@ -301,7 +301,7 @@ void macrotool_dump(std::vector params) if(params[0] == "fields") { if(params.size() != 1) { printf("The command 'fields' doen't take any parameters.\n"); - printf(usage_str); + printf("%s", usage_str); return; } dump_fields(); @@ -311,7 +311,7 @@ void macrotool_dump(std::vector params) if(params[0] == "macros") { if(params.size() != 1) { printf("The command 'macro' doen't take any parameters.\n"); - printf(usage_str); + printf("%s", usage_str); return; } dump_macros(); @@ -321,7 +321,7 @@ void macrotool_dump(std::vector params) if(params[0] == "templates") { if(params.size() != 1) { printf("The command 'templates' doen't take any parameters.\n"); - printf(usage_str); + printf("%s", usage_str); return; } dump_templates(); @@ -329,11 +329,11 @@ void macrotool_dump(std::vector params) } if(params[0] == "help") { - printf(usage_str); + printf("%s", usage_str); return; } printf("Unknown command '%s'\n", params[0].c_str()); - printf(usage_str); + printf("%s", usage_str); return; } diff --git a/server/src/macrotool_fieldnames.cc b/server/src/macrotool_fieldnames.cc index 1d92df8..3a6e651 100644 --- a/server/src/macrotool_fieldnames.cc +++ b/server/src/macrotool_fieldnames.cc @@ -160,7 +160,7 @@ static void list() void macrotool_fieldnames(std::vector params) { if(params.size() < 1) { - printf(usage_str); + printf("%s", usage_str); return; } @@ -169,7 +169,7 @@ void macrotool_fieldnames(std::vector params) if(params[0] == "list") { if(params.size() != 1) { printf("The command 'list' does not need any parameters.\n"); - printf(usage_str); + printf("%s", usage_str); return; } list(); @@ -179,7 +179,7 @@ void macrotool_fieldnames(std::vector params) if(params[0] == "add") { if(params.size() != 3) { printf("The command 'add' needs 2 parameters.\n"); - printf(usage_str); + printf("%s", usage_str); return; } add(params[1], params[2]); @@ -189,7 +189,7 @@ void macrotool_fieldnames(std::vector params) if(params[0] == "del") { if(params.size() != 2) { printf("The command 'del' needs 1 parameter.\n"); - printf(usage_str); + printf("%s", usage_str); return; } del(params[1]); @@ -197,11 +197,11 @@ void macrotool_fieldnames(std::vector params) } if(params[0] == "help") { - printf(usage_str); + printf("%s", usage_str); return; } printf("Unknown command '%s'\n", params[0].c_str()); - printf(usage_str); + printf("%s", usage_str); return; } diff --git a/server/src/macrotool_filehandler.cc b/server/src/macrotool_filehandler.cc index d0245ba..c52921a 100644 --- a/server/src/macrotool_filehandler.cc +++ b/server/src/macrotool_filehandler.cc @@ -190,7 +190,7 @@ static void add(std::string file) void macrotool_filehandler(std::vector params) { if(params.size() < 1) { - printf(usage_str); + printf("%s", usage_str); return; } @@ -199,7 +199,7 @@ void macrotool_filehandler(std::vector params) if(params[0] == "add") { if(params.size() != 2) { printf("The command 'add' needs 1 parameter.\n"); - printf(usage_str); + printf("%s", usage_str); return; } add(params[1]); @@ -209,7 +209,7 @@ void macrotool_filehandler(std::vector params) if(params[0] == "check") { if(params.size() != 2) { printf("The command 'check' needs 1 parameter.\n"); - printf(usage_str); + printf("%s", usage_str); return; } check(params[1]); @@ -217,11 +217,11 @@ void macrotool_filehandler(std::vector params) } if(params[0] == "help") { - printf(usage_str); + printf("%s", usage_str); return; } printf("Unknown command '%s'\n", params[0].c_str()); - printf(usage_str); + printf("%s", usage_str); return; } diff --git a/server/src/macrotool_util.cc b/server/src/macrotool_util.cc index d6446f7..003e929 100644 --- a/server/src/macrotool_util.cc +++ b/server/src/macrotool_util.cc @@ -71,7 +71,7 @@ std::vector getTemplates() void printcolumn(std::string text, size_t width) { - printf(text.c_str()); + printf("%s", text.c_str()); for(size_t i = text.length(); i < width; i++) printf(" "); printf("\t"); } diff --git a/server/src/pracrod.cc b/server/src/pracrod.cc index 75f58a6..d17001c 100644 --- a/server/src/pracrod.cc +++ b/server/src/pracrod.cc @@ -202,13 +202,13 @@ int main(int argc, char *argv[]) case '?': case 'h': - printf(version_str); + printf("%s", version_str); printf(usage_str, argv[0]); return 0; case 'v': - printf(version_str); - printf(copyright_str); + printf("%s", version_str); + printf("%s", copyright_str); return 0; default: diff --git a/server/src/queryhandlerpentominos.cc b/server/src/queryhandlerpentominos.cc index c52b36c..62a742f 100644 --- a/server/src/queryhandlerpentominos.cc +++ b/server/src/queryhandlerpentominos.cc @@ -157,7 +157,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query) socket.write(header, strlen(header)); #endif/*WITHOUT_PENTOMINOS*/ - PRACRO_DEBUG(queryhandler, header); + PRACRO_DEBUG(queryhandler, "%s", header); sprintf(buf, " "); @@ -202,7 +202,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query) socket.write(buf, strlen(buf)); #endif/*WITHOUT_PENTOMINOS*/ - PRACRO_DEBUG(queryhandler, buf); + PRACRO_DEBUG(queryhandler, "%s", buf); QueryResult result; -- cgit v1.2.3