Patch from Ross McFarland to compile with strict warnings
Summary: Use comment trick in params that are unused to prevent warnings
Reviewed By: dreiss
Test Plan: Generate C++ code and compile -W -Wall
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665469 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/concurrency/Util.h b/lib/cpp/src/concurrency/Util.h
index 3ebc0b1..29e3567 100644
--- a/lib/cpp/src/concurrency/Util.h
+++ b/lib/cpp/src/concurrency/Util.h
@@ -7,7 +7,9 @@
#ifndef _THRIFT_CONCURRENCY_UTIL_H_
#define _THRIFT_CONCURRENCY_UTIL_H_ 1
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <assert.h>
#include <stddef.h>
diff --git a/lib/cpp/src/server/TNonblockingServer.h b/lib/cpp/src/server/TNonblockingServer.h
index df3103f..e043b54 100644
--- a/lib/cpp/src/server/TNonblockingServer.h
+++ b/lib/cpp/src/server/TNonblockingServer.h
@@ -310,13 +310,13 @@
void transition();
// Handler wrapper
- static void eventHandler(int fd, short which, void* v) {
+ static void eventHandler(int fd, short /* which */, void* v) {
assert(fd == ((TConnection*)v)->socket_);
((TConnection*)v)->workSocket();
}
// Handler wrapper for task block
- static void taskHandler(int fd, short which, void* v) {
+ static void taskHandler(int fd, short /* which */, void* v) {
assert(fd == ((TConnection*)v)->taskHandle_);
if (-1 == ::close(((TConnection*)v)->taskHandle_)) {
GlobalOutput("TConnection::taskHandler close handle failed, resource leak");
diff --git a/lib/cpp/src/server/TServer.h b/lib/cpp/src/server/TServer.h
index b51d1d5..d7245c7 100644
--- a/lib/cpp/src/server/TServer.h
+++ b/lib/cpp/src/server/TServer.h
@@ -44,14 +44,14 @@
/**
* Called when a new client has connected and is about to being processing.
*/
- virtual void clientBegin(boost::shared_ptr<TProtocol> input,
- boost::shared_ptr<TProtocol> output) {}
+ virtual void clientBegin(boost::shared_ptr<TProtocol> /* input */,
+ boost::shared_ptr<TProtocol> /* output */) {}
/**
* Called when a client has finished making requests.
*/
- virtual void clientEnd(boost::shared_ptr<TProtocol> input,
- boost::shared_ptr<TProtocol> output) {}
+ virtual void clientEnd(boost::shared_ptr<TProtocol> /* input */,
+ boost::shared_ptr<TProtocol> /* output */) {}
protected:
diff --git a/lib/cpp/src/transport/TTransport.h b/lib/cpp/src/transport/TTransport.h
index 469acd2..d775d4e 100644
--- a/lib/cpp/src/transport/TTransport.h
+++ b/lib/cpp/src/transport/TTransport.h
@@ -71,7 +71,7 @@
* @return How many bytes were actually read
* @throws TTransportException If an error occurs
*/
- virtual uint32_t read(uint8_t* buf, uint32_t len) {
+ virtual uint32_t read(uint8_t* /* buf */, uint32_t /* len */) {
throw TTransportException(TTransportException::NOT_OPEN, "Base TTransport cannot read.");
}
@@ -115,7 +115,7 @@
* @param buf The data to write out
* @throws TTransportException if an error occurs
*/
- virtual void write(const uint8_t* buf, uint32_t len) {
+ virtual void write(const uint8_t* /* buf */, uint32_t /* len */) {
throw TTransportException(TTransportException::NOT_OPEN, "Base TTransport cannot write.");
}
@@ -162,7 +162,7 @@
* the transport's internal buffers.
* @throws TTransportException if an error occurs
*/
- virtual const uint8_t* borrow(uint8_t* buf, uint32_t* len) {
+ virtual const uint8_t* borrow(uint8_t* /* buf */, uint32_t* /* len */) {
return NULL;
}
@@ -175,7 +175,7 @@
* @param len How many bytes to consume
* @throws TTransportException If an error occurs
*/
- virtual void consume(uint32_t len) {
+ virtual void consume(uint32_t /* len */) {
throw TTransportException(TTransportException::NOT_OPEN, "Base TTransport cannot consume.");
}
diff --git a/lib/cpp/src/transport/TTransportUtils.h b/lib/cpp/src/transport/TTransportUtils.h
index 0aa29c9..83abf8e 100644
--- a/lib/cpp/src/transport/TTransportUtils.h
+++ b/lib/cpp/src/transport/TTransportUtils.h
@@ -34,7 +34,7 @@
void open() {}
- void write(const uint8_t* buf, uint32_t len) {
+ void write(const uint8_t* /* buf */, uint32_t /* len */) {
return;
}