THRIFT-3246 Reduce the number of trivial warnings in Windows C++ CMake builds
Client: cpp
Patch: Ben Craig <bencraig@apache.org>
This closes #553
diff --git a/lib/cpp/test/processor/Handlers.h b/lib/cpp/test/processor/Handlers.h
index d894107..c90993a 100644
--- a/lib/cpp/test/processor/Handlers.h
+++ b/lib/cpp/test/processor/Handlers.h
@@ -56,7 +56,7 @@
_return = strings_;
}
- void getDataWait(std::string& _return, int32_t length) {
+ void getDataWait(std::string& _return, const int32_t length) {
concurrency::Guard g(mutex_);
log_->append(EventLog::ET_CALL_GET_DATA_WAIT, 0, 0);
@@ -139,11 +139,16 @@
boost::shared_ptr<EventLog> log_;
};
+#ifdef _WIN32
+ #pragma warning( push )
+ #pragma warning (disable : 4250 ) //inheriting methods via dominance
+#endif;
+
class ChildHandler : public ParentHandler, virtual public ChildServiceIf {
public:
ChildHandler(const boost::shared_ptr<EventLog>& log) : ParentHandler(log), value_(0) {}
- int32_t setValue(int32_t value) {
+ int32_t setValue(const int32_t value) {
concurrency::Guard g(mutex_);
log_->append(EventLog::ET_CALL_SET_VALUE, 0, 0);
@@ -163,6 +168,10 @@
int32_t value_;
};
+#ifdef _WIN32
+ #pragma warning( pop )
+#endif
+
struct ConnContext {
public:
ConnContext(boost::shared_ptr<protocol::TProtocol> in,
diff --git a/lib/cpp/test/processor/ProcessorTest.cpp b/lib/cpp/test/processor/ProcessorTest.cpp
index 40d926e..5aaa57e 100644
--- a/lib/cpp/test/processor/ProcessorTest.cpp
+++ b/lib/cpp/test/processor/ProcessorTest.cpp
@@ -522,7 +522,7 @@
// can test the timing for the preRead() call.
string requestName = "getDataWait";
string eventName = "ParentService.getDataWait";
- int32_t seqid = time(NULL);
+ int32_t seqid = int32_t(time(NULL));
TBinaryProtocol protocol(socket);
protocol.writeMessageBegin(requestName, T_CALL, seqid);
socket->flush();
@@ -819,7 +819,7 @@
try {
client->recv_unexpectedExceptionWait();
BOOST_FAIL("expected TApplicationError to be thrown");
- } catch (const TApplicationException& e) {
+ } catch (const TApplicationException&) {
}
// Now we should see a handler error event
diff --git a/lib/cpp/test/processor/ServerThread.cpp b/lib/cpp/test/processor/ServerThread.cpp
index 8834269..e9d468f 100644
--- a/lib/cpp/test/processor/ServerThread.cpp
+++ b/lib/cpp/test/processor/ServerThread.cpp
@@ -90,7 +90,7 @@
try {
// Try to serve requests
server_->serve();
- } catch (const TException& x) {
+ } catch (const TException&) {
// TNonblockingServer throws a generic TException if it fails to bind.
// If we get a TException, we'll optimistically assume the bind failed.
++port_;