THRIFT-916 gcc warnings in c++ header files
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1147700 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/cpp/src/StressTest.cpp b/test/cpp/src/StressTest.cpp
old mode 100644
new mode 100755
index 0c91956..4892722
--- a/test/cpp/src/StressTest.cpp
+++ b/test/cpp/src/StressTest.cpp
@@ -92,7 +92,7 @@
int64_t echoI64(const int64_t arg) {return arg;}
void echoString(string& out, const string &arg) {
if (arg != "hello") {
- T_ERROR_ABORT("WRONG STRING!!!!");
+ T_ERROR_ABORT("WRONG STRING (%s)!!!!", arg.c_str());
}
out = arg;
}
diff --git a/test/cpp/src/StressTestNonBlocking.cpp b/test/cpp/src/StressTestNonBlocking.cpp
old mode 100644
new mode 100755
index 7650d49..0d8bc3a
--- a/test/cpp/src/StressTestNonBlocking.cpp
+++ b/test/cpp/src/StressTestNonBlocking.cpp
@@ -98,7 +98,7 @@
int64_t echoI64(const int64_t arg) {return arg;}
void echoString(string& out, const string &arg) {
if (arg != "hello") {
- T_ERROR_ABORT("WRONG STRING!!!!");
+ T_ERROR_ABORT("WRONG STRING (%s)!!!!", arg.c_str());
}
out = arg;
}
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
old mode 100644
new mode 100755
index 3f22ad2..9aed551
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -63,6 +63,9 @@
}
static void testString_clientReturn(const char* host, int port, event_base *base, TProtocolFactory* protocolFactory, ThriftTestCobClient* client) {
+ (void) host;
+ (void) port;
+ (void) protocolFactory;
try {
string s;
client->recv_testString(s);
@@ -283,7 +286,7 @@
*/
printf("testDouble(-5.2098523)");
double dub = testClient.testDouble(-5.2098523);
- printf(" = %lf\n", dub);
+ printf(" = %f\n", dub);
/**
* STRUCT TEST
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index 2c9d43a..4afbef6 100755
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -88,7 +88,7 @@
}
double testDouble(const double thing) {
- printf("testDouble(%lf)\n", thing);
+ printf("testDouble(%f)\n", thing);
return thing;
}
@@ -193,6 +193,7 @@
}
void testInsanity(map<UserId, map<Numberz::type,Insanity> > &insane, const Insanity &argument) {
+ (void) argument;
printf("testInsanity()\n");
Xtruct hello;
@@ -262,6 +263,10 @@
}
void testMulti(Xtruct &hello, const int8_t arg0, const int32_t arg1, const int64_t arg2, const std::map<int16_t, std::string> &arg3, const Numberz::type arg4, const UserId arg5) {
+ (void) arg3;
+ (void) arg4;
+ (void) arg5;
+
printf("testMulti()\n");
hello.string_thing = "Hello2";
@@ -319,21 +324,25 @@
class TestProcessorEventHandler : public TProcessorEventHandler {
virtual void* getContext(const char* fn_name, void* serverContext) {
+ (void) serverContext;
return new std::string(fn_name);
}
virtual void freeContext(void* ctx, const char* fn_name) {
+ (void) fn_name;
delete static_cast<std::string*>(ctx);
}
virtual void preRead(void* ctx, const char* fn_name) {
communicate("preRead", ctx, fn_name);
}
virtual void postRead(void* ctx, const char* fn_name, uint32_t bytes) {
+ (void) bytes;
communicate("postRead", ctx, fn_name);
}
virtual void preWrite(void* ctx, const char* fn_name) {
communicate("preWrite", ctx, fn_name);
}
virtual void postWrite(void* ctx, const char* fn_name, uint32_t bytes) {
+ (void) bytes;
communicate("postWrite", ctx, fn_name);
}
virtual void asyncComplete(void* ctx, const char* fn_name) {