THRIFT-916 compile with -Wall -Wextra without warning on Debian Lenny
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1036250 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/TProcessor.h b/lib/cpp/src/TProcessor.h
index 16b46df..cf4f3b8 100644
--- a/lib/cpp/src/TProcessor.h
+++ b/lib/cpp/src/TProcessor.h
@@ -44,42 +44,69 @@
* The return value is passed to all other callbacks
* for that function invocation.
*/
- virtual void* getContext(const char* fn_name, void* serverContext) { return NULL; }
+ virtual void* getContext(const char* fn_name, void* serverContext) {
+ (void) fn_name;
+ (void) serverContext;
+ return NULL;
+ }
/**
* Expected to free resources associated with a context.
*/
- virtual void freeContext(void* ctx, const char* fn_name) { }
+ virtual void freeContext(void* ctx, const char* fn_name) {
+ (void) ctx;
+ (void) fn_name;
+ }
/**
* Called before reading arguments.
*/
- virtual void preRead(void* ctx, const char* fn_name) {}
+ virtual void preRead(void* ctx, const char* fn_name) {
+ (void) ctx;
+ (void) fn_name;
+ }
/**
* Called between reading arguments and calling the handler.
*/
- virtual void postRead(void* ctx, const char* fn_name, uint32_t bytes) {}
+ virtual void postRead(void* ctx, const char* fn_name, uint32_t bytes) {
+ (void) ctx;
+ (void) fn_name;
+ (void) bytes;
+ }
/**
* Called between calling the handler and writing the response.
*/
- virtual void preWrite(void* ctx, const char* fn_name) {}
+ virtual void preWrite(void* ctx, const char* fn_name) {
+ (void) ctx;
+ (void) fn_name;
+ }
/**
* Called after writing the response.
*/
- virtual void postWrite(void* ctx, const char* fn_name, uint32_t bytes) {}
+ virtual void postWrite(void* ctx, const char* fn_name, uint32_t bytes) {
+ (void) ctx;
+ (void) fn_name;
+ (void) bytes;
+ }
/**
* Called when an async function call completes successfully.
*/
- virtual void asyncComplete(void* ctx, const char* fn_name) {}
+ virtual void asyncComplete(void* ctx, const char* fn_name) {
+ (void) ctx;
+ (void) fn_name;
+ }
/**
* Called if the handler throws an undeclared exception.
*/
- virtual void handlerError(void* ctx, const char* fn_name) {}
+ virtual void handlerError(void* ctx, const char* fn_name) {
+ (void) ctx;
+ (void) fn_name;
+ }
protected:
TProcessorEventHandler() {}
diff --git a/lib/cpp/src/async/TAsyncProtocolProcessor.cpp b/lib/cpp/src/async/TAsyncProtocolProcessor.cpp
index 05d504b..eaa86e0 100644
--- a/lib/cpp/src/async/TAsyncProtocolProcessor.cpp
+++ b/lib/cpp/src/async/TAsyncProtocolProcessor.cpp
@@ -43,6 +43,7 @@
std::tr1::function<void(bool healthy)> _return,
boost::shared_ptr<TProtocol> oprot,
bool healthy) {
+ (void) oprot;
// This is a stub function to hold a reference to oprot.
return _return(healthy);
}
diff --git a/lib/cpp/src/concurrency/ThreadManager.cpp b/lib/cpp/src/concurrency/ThreadManager.cpp
index a65394b..f7b2690 100644
--- a/lib/cpp/src/concurrency/ThreadManager.cpp
+++ b/lib/cpp/src/concurrency/ThreadManager.cpp
@@ -68,7 +68,7 @@
void join() { stopImpl(true); }
- const ThreadManager::STATE state() const {
+ ThreadManager::STATE state() const {
return state_;
}
@@ -492,6 +492,7 @@
}
void ThreadManager::Impl::remove(shared_ptr<Runnable> task) {
+ (void) task;
Synchronized s(monitor_);
if (state_ != ThreadManager::STARTED) {
throw IllegalStateException();
diff --git a/lib/cpp/src/concurrency/ThreadManager.h b/lib/cpp/src/concurrency/ThreadManager.h
index 95c4906..6d7b0ef 100644
--- a/lib/cpp/src/concurrency/ThreadManager.h
+++ b/lib/cpp/src/concurrency/ThreadManager.h
@@ -93,7 +93,7 @@
STOPPED
};
- virtual const STATE state() const = 0;
+ virtual STATE state() const = 0;
virtual boost::shared_ptr<ThreadFactory> threadFactory() const = 0;
diff --git a/lib/cpp/src/concurrency/TimerManager.cpp b/lib/cpp/src/concurrency/TimerManager.cpp
index 10eabda..f7acd0a 100644
--- a/lib/cpp/src/concurrency/TimerManager.cpp
+++ b/lib/cpp/src/concurrency/TimerManager.cpp
@@ -271,13 +271,14 @@
void TimerManager::remove(shared_ptr<Runnable> task) {
+ (void) task;
Synchronized s(monitor_);
if (state_ != TimerManager::STARTED) {
throw IllegalStateException();
}
}
-const TimerManager::STATE TimerManager::state() const { return state_; }
+TimerManager::STATE TimerManager::state() const { return state_; }
}}} // apache::thrift::concurrency
diff --git a/lib/cpp/src/concurrency/TimerManager.h b/lib/cpp/src/concurrency/TimerManager.h
index dfbf0ea..d905ddb 100644
--- a/lib/cpp/src/concurrency/TimerManager.h
+++ b/lib/cpp/src/concurrency/TimerManager.h
@@ -99,7 +99,7 @@
STOPPED
};
- virtual const STATE state() const;
+ virtual STATE state() const;
private:
boost::shared_ptr<const ThreadFactory> threadFactory_;
diff --git a/lib/cpp/src/concurrency/Util.cpp b/lib/cpp/src/concurrency/Util.cpp
index ac2a460..af23449 100644
--- a/lib/cpp/src/concurrency/Util.cpp
+++ b/lib/cpp/src/concurrency/Util.cpp
@@ -31,7 +31,7 @@
namespace apache { namespace thrift { namespace concurrency {
-const int64_t Util::currentTimeTicks(int64_t ticksPerSec) {
+int64_t Util::currentTimeTicks(int64_t ticksPerSec) {
int64_t result;
#if defined(HAVE_CLOCK_GETTIME)
diff --git a/lib/cpp/src/concurrency/Util.h b/lib/cpp/src/concurrency/Util.h
index 18a221d..c6bd25e 100644
--- a/lib/cpp/src/concurrency/Util.h
+++ b/lib/cpp/src/concurrency/Util.h
@@ -68,7 +68,7 @@
result.tv_usec = (value % MS_PER_S) * US_PER_MS; // ms to us
}
- static const void toTicks(int64_t& result, int64_t secs, int64_t oldTicks,
+ static void toTicks(int64_t& result, int64_t secs, int64_t oldTicks,
int64_t oldTicksPerSec, int64_t newTicksPerSec) {
result = secs * newTicksPerSec;
result += oldTicks * newTicksPerSec / oldTicksPerSec;
@@ -81,7 +81,7 @@
/**
* Converts struct timespec to arbitrary-sized ticks since epoch
*/
- static const void toTicks(int64_t& result,
+ static void toTicks(int64_t& result,
const struct timespec& value,
int64_t ticksPerSec) {
return toTicks(result, value.tv_sec, value.tv_nsec, NS_PER_S, ticksPerSec);
@@ -90,7 +90,7 @@
/**
* Converts struct timeval to arbitrary-sized ticks since epoch
*/
- static const void toTicks(int64_t& result,
+ static void toTicks(int64_t& result,
const struct timeval& value,
int64_t ticksPerSec) {
return toTicks(result, value.tv_sec, value.tv_usec, US_PER_S, ticksPerSec);
@@ -99,7 +99,7 @@
/**
* Converts struct timespec to milliseconds
*/
- static const void toMilliseconds(int64_t& result,
+ static void toMilliseconds(int64_t& result,
const struct timespec& value) {
return toTicks(result, value, MS_PER_S);
}
@@ -107,7 +107,7 @@
/**
* Converts struct timeval to milliseconds
*/
- static const void toMilliseconds(int64_t& result,
+ static void toMilliseconds(int64_t& result,
const struct timeval& value) {
return toTicks(result, value, MS_PER_S);
}
@@ -115,31 +115,31 @@
/**
* Converts struct timespec to microseconds
*/
- static const void toUsec(int64_t& result, const struct timespec& value) {
+ static void toUsec(int64_t& result, const struct timespec& value) {
return toTicks(result, value, US_PER_S);
}
/**
* Converts struct timeval to microseconds
*/
- static const void toUsec(int64_t& result, const struct timeval& value) {
+ static void toUsec(int64_t& result, const struct timeval& value) {
return toTicks(result, value, US_PER_S);
}
/**
* Get current time as a number of arbitrary-size ticks from epoch
*/
- static const int64_t currentTimeTicks(int64_t ticksPerSec);
+ static int64_t currentTimeTicks(int64_t ticksPerSec);
/**
* Get current time as milliseconds from epoch
*/
- static const int64_t currentTime() { return currentTimeTicks(MS_PER_S); }
+ static int64_t currentTime() { return currentTimeTicks(MS_PER_S); }
/**
* Get current time as micros from epoch
*/
- static const int64_t currentTimeUsec() { return currentTimeTicks(US_PER_S); }
+ static int64_t currentTimeUsec() { return currentTimeTicks(US_PER_S); }
};
}}} // apache::thrift::concurrency
diff --git a/lib/cpp/src/concurrency/test/ThreadFactoryTests.h b/lib/cpp/src/concurrency/test/ThreadFactoryTests.h
index e4f98a9..c1dc89d 100644
--- a/lib/cpp/src/concurrency/test/ThreadFactoryTests.h
+++ b/lib/cpp/src/concurrency/test/ThreadFactoryTests.h
@@ -308,6 +308,7 @@
};
void foo(PosixThreadFactory *tf) {
+ (void) tf;
}
bool floodNTest(size_t loop=1, size_t count=100000) {
diff --git a/lib/cpp/src/concurrency/test/ThreadManagerTests.h b/lib/cpp/src/concurrency/test/ThreadManagerTests.h
index 129a9a2..b6b5c3e 100644
--- a/lib/cpp/src/concurrency/test/ThreadManagerTests.h
+++ b/lib/cpp/src/concurrency/test/ThreadManagerTests.h
@@ -235,7 +235,7 @@
* pendingTaskCountMax + 1th task. Verify that we unblock when a task completes */
bool blockTest(int64_t timeout=100LL, size_t workerCount=2) {
-
+ (void) timeout;
bool success = false;
try {
diff --git a/lib/cpp/src/processor/PeekProcessor.cpp b/lib/cpp/src/processor/PeekProcessor.cpp
index 076975b..9a9b672 100644
--- a/lib/cpp/src/processor/PeekProcessor.cpp
+++ b/lib/cpp/src/processor/PeekProcessor.cpp
@@ -107,14 +107,18 @@
}
void PeekProcessor::peekName(const std::string& fname) {
+ (void) fname;
}
void PeekProcessor::peekBuffer(uint8_t* buffer, uint32_t size) {
+ (void) buffer;
+ (void) size;
}
void PeekProcessor::peek(boost::shared_ptr<TProtocol> in,
TType ftype,
int16_t fid) {
+ (void) fid;
in->skip(ftype);
}
diff --git a/lib/cpp/src/protocol/TBinaryProtocol.tcc b/lib/cpp/src/protocol/TBinaryProtocol.tcc
index 0f1c34a..3d93348 100644
--- a/lib/cpp/src/protocol/TBinaryProtocol.tcc
+++ b/lib/cpp/src/protocol/TBinaryProtocol.tcc
@@ -54,6 +54,7 @@
template <class Transport_>
uint32_t TBinaryProtocolT<Transport_>::writeStructBegin(const char* name) {
+ (void) name;
return 0;
}
@@ -66,6 +67,7 @@
uint32_t TBinaryProtocolT<Transport_>::writeFieldBegin(const char* name,
const TType fieldType,
const int16_t fieldId) {
+ (void) name;
uint32_t wsize = 0;
wsize += writeByte((int8_t)fieldType);
wsize += writeI16(fieldId);
@@ -244,6 +246,7 @@
uint32_t TBinaryProtocolT<Transport_>::readFieldBegin(std::string& name,
TType& fieldType,
int16_t& fieldId) {
+ (void) name;
uint32_t result = 0;
int8_t type;
result += readByte(type);
diff --git a/lib/cpp/src/protocol/TCompactProtocol.tcc b/lib/cpp/src/protocol/TCompactProtocol.tcc
index ed9c281..55b784f 100644
--- a/lib/cpp/src/protocol/TCompactProtocol.tcc
+++ b/lib/cpp/src/protocol/TCompactProtocol.tcc
@@ -131,6 +131,7 @@
*/
template <class Transport_>
uint32_t TCompactProtocolT<Transport_>::writeStructBegin(const char* name) {
+ (void) name;
lastField_.push(lastFieldId_);
lastFieldId_ = 0;
return 0;
@@ -286,6 +287,7 @@
const TType fieldType,
const int16_t fieldId,
int8_t typeOverride) {
+ (void) name;
uint32_t wsize = 0;
// if there's a type override, use that.
@@ -455,6 +457,7 @@
uint32_t TCompactProtocolT<Transport_>::readFieldBegin(std::string& name,
TType& fieldType,
int16_t& fieldId) {
+ (void) name;
uint32_t rsize = 0;
int8_t byte;
int8_t type;
diff --git a/lib/cpp/src/protocol/TDebugProtocol.cpp b/lib/cpp/src/protocol/TDebugProtocol.cpp
index ee82e71..28e175b 100644
--- a/lib/cpp/src/protocol/TDebugProtocol.cpp
+++ b/lib/cpp/src/protocol/TDebugProtocol.cpp
@@ -148,6 +148,7 @@
uint32_t TDebugProtocol::writeMessageBegin(const std::string& name,
const TMessageType messageType,
const int32_t seqid) {
+ (void) seqid;
string mtype;
switch (messageType) {
case T_CALL : mtype = "call" ; break;
diff --git a/lib/cpp/src/protocol/TDenseProtocol.cpp b/lib/cpp/src/protocol/TDenseProtocol.cpp
index b9a3d1f..86e5e28 100644
--- a/lib/cpp/src/protocol/TDenseProtocol.cpp
+++ b/lib/cpp/src/protocol/TDenseProtocol.cpp
@@ -281,6 +281,7 @@
}
uint32_t TDenseProtocol::writeStructBegin(const char* name) {
+ (void) name;
uint32_t xfer = 0;
// The TypeSpec stack should be empty if this is the top-level read/write.
@@ -314,6 +315,7 @@
uint32_t TDenseProtocol::writeFieldBegin(const char* name,
const TType fieldType,
const int16_t fieldId) {
+ (void) name;
uint32_t xfer = 0;
// Skip over optional fields.
@@ -507,6 +509,7 @@
}
uint32_t TDenseProtocol::readStructBegin(string& name) {
+ (void) name;
uint32_t xfer = 0;
if (ts_stack_.empty()) {
@@ -544,6 +547,7 @@
uint32_t TDenseProtocol::readFieldBegin(string& name,
TType& fieldType,
int16_t& fieldId) {
+ (void) name;
uint32_t xfer = 0;
// For optional fields, check to see if they are there.
diff --git a/lib/cpp/src/protocol/TJSONProtocol.cpp b/lib/cpp/src/protocol/TJSONProtocol.cpp
index 5b0b18d..d038df4 100644
--- a/lib/cpp/src/protocol/TJSONProtocol.cpp
+++ b/lib/cpp/src/protocol/TJSONProtocol.cpp
@@ -255,6 +255,7 @@
* Write context data to the transport. Default is to do nothing.
*/
virtual uint32_t write(TTransport &trans) {
+ (void) trans;
return 0;
};
@@ -262,6 +263,7 @@
* Read context data from the transport. Default is to do nothing.
*/
virtual uint32_t read(TJSONProtocol::LookaheadReader &reader) {
+ (void) reader;
return 0;
};
@@ -561,6 +563,7 @@
}
uint32_t TJSONProtocol::writeStructBegin(const char* name) {
+ (void) name;
return writeJSONObjectStart();
}
@@ -571,6 +574,7 @@
uint32_t TJSONProtocol::writeFieldBegin(const char* name,
const TType fieldType,
const int16_t fieldId) {
+ (void) name;
uint32_t result = writeJSONInteger(fieldId);
result += writeJSONObjectStart();
result += writeJSONString(getTypeNameForTypeID(fieldType));
@@ -874,6 +878,7 @@
}
uint32_t TJSONProtocol::readStructBegin(std::string& name) {
+ (void) name;
return readJSONObjectStart();
}
@@ -884,6 +889,7 @@
uint32_t TJSONProtocol::readFieldBegin(std::string& name,
TType& fieldType,
int16_t& fieldId) {
+ (void) name;
uint32_t result = 0;
// Check if we hit the end of the list
uint8_t ch = reader_.peek();
diff --git a/lib/cpp/src/protocol/TVirtualProtocol.h b/lib/cpp/src/protocol/TVirtualProtocol.h
index 9133dbe..6c7f519 100644
--- a/lib/cpp/src/protocol/TVirtualProtocol.h
+++ b/lib/cpp/src/protocol/TVirtualProtocol.h
@@ -42,6 +42,9 @@
uint32_t readMessageBegin(std::string& name,
TMessageType& messageType,
int32_t& seqid) {
+ (void) name;
+ (void) messageType;
+ (void) seqid;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
@@ -52,6 +55,7 @@
}
uint32_t readStructBegin(std::string& name) {
+ (void) name;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
@@ -64,6 +68,9 @@
uint32_t readFieldBegin(std::string& name,
TType& fieldType,
int16_t& fieldId) {
+ (void) name;
+ (void) fieldType;
+ (void) fieldId;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
@@ -74,6 +81,9 @@
}
uint32_t readMapBegin(TType& keyType, TType& valType, uint32_t& size) {
+ (void) keyType;
+ (void) valType;
+ (void) size;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
@@ -84,6 +94,8 @@
}
uint32_t readListBegin(TType& elemType, uint32_t& size) {
+ (void) elemType;
+ (void) size;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
@@ -94,6 +106,8 @@
}
uint32_t readSetBegin(TType& elemType, uint32_t& size) {
+ (void) elemType;
+ (void) size;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
@@ -104,46 +118,55 @@
}
uint32_t readBool(bool& value) {
+ (void) value;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readBool(std::vector<bool>::reference value) {
+ (void) value;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readByte(int8_t& byte) {
+ (void) byte;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readI16(int16_t& i16) {
+ (void) i16;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readI32(int32_t& i32) {
+ (void) i32;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readI64(int64_t& i64) {
+ (void) i64;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readDouble(double& dub) {
+ (void) dub;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readString(std::string& str) {
+ (void) str;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readBinary(std::string& str) {
+ (void) str;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
@@ -151,6 +174,9 @@
uint32_t writeMessageBegin(const std::string& name,
const TMessageType messageType,
const int32_t seqid) {
+ (void) name;
+ (void) messageType;
+ (void) seqid;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
@@ -162,6 +188,7 @@
uint32_t writeStructBegin(const char* name) {
+ (void) name;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
@@ -174,6 +201,9 @@
uint32_t writeFieldBegin(const char* name,
const TType fieldType,
const int16_t fieldId) {
+ (void) name;
+ (void) fieldType;
+ (void) fieldId;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
@@ -191,6 +221,9 @@
uint32_t writeMapBegin(const TType keyType,
const TType valType,
const uint32_t size) {
+ (void) keyType;
+ (void) valType;
+ (void) size;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
@@ -201,6 +234,8 @@
}
uint32_t writeListBegin(const TType elemType, const uint32_t size) {
+ (void) elemType;
+ (void) size;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
@@ -211,6 +246,8 @@
}
uint32_t writeSetBegin(const TType elemType, const uint32_t size) {
+ (void) elemType;
+ (void) size;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
@@ -221,41 +258,49 @@
}
uint32_t writeBool(const bool value) {
+ (void) value;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeByte(const int8_t byte) {
+ (void) byte;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeI16(const int16_t i16) {
+ (void) i16;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeI32(const int32_t i32) {
+ (void) i32;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeI64(const int64_t i64) {
+ (void) i64;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeDouble(const double dub) {
+ (void) dub;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeString(const std::string& str) {
+ (void) str;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeBinary(const std::string& str) {
+ (void) str;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
diff --git a/lib/cpp/src/server/TNonblockingServer.cpp b/lib/cpp/src/server/TNonblockingServer.cpp
index 8f5a9f3..69ae235 100644
--- a/lib/cpp/src/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/server/TNonblockingServer.cpp
@@ -602,6 +602,7 @@
* connections on fd and assign TConnection objects to handle those requests.
*/
void TNonblockingServer::handleEvent(int fd, short which) {
+ (void) which;
// Make sure that libevent didn't mess up the socket handles
assert(fd == serverSocket_);
diff --git a/lib/cpp/src/transport/TBufferTransports.cpp b/lib/cpp/src/transport/TBufferTransports.cpp
index fa70531..52920c2 100644
--- a/lib/cpp/src/transport/TBufferTransports.cpp
+++ b/lib/cpp/src/transport/TBufferTransports.cpp
@@ -109,6 +109,8 @@
}
const uint8_t* TBufferedTransport::borrowSlow(uint8_t* buf, uint32_t* len) {
+ (void) buf;
+ (void) len;
// Simply return NULL. We don't know if there is actually data available on
// the underlying transport, so calling read() might block.
return NULL;
@@ -262,6 +264,8 @@
}
const uint8_t* TFramedTransport::borrowSlow(uint8_t* buf, uint32_t* len) {
+ (void) buf;
+ (void) len;
// Don't try to be clever with shifting buffers.
// If the fast path failed let the protocol use its slow path.
// Besides, who is going to try to borrow across messages?
@@ -364,6 +368,7 @@
}
const uint8_t* TMemoryBuffer::borrowSlow(uint8_t* buf, uint32_t* len) {
+ (void) buf;
rBound_ = wBase_;
if (available_read() >= *len) {
*len = available_read();
diff --git a/lib/cpp/src/transport/THttpClient.cpp b/lib/cpp/src/transport/THttpClient.cpp
index 400597e..604df0d 100644
--- a/lib/cpp/src/transport/THttpClient.cpp
+++ b/lib/cpp/src/transport/THttpClient.cpp
@@ -64,7 +64,7 @@
}
*code = '\0';
- while (*(code++) == ' ');
+ while (*(code++) == ' ') {};
char* msg = strchr(code, ' ');
if (msg == NULL) {
diff --git a/lib/cpp/src/transport/THttpServer.cpp b/lib/cpp/src/transport/THttpServer.cpp
index 3ed869a..166c0f6 100644
--- a/lib/cpp/src/transport/THttpServer.cpp
+++ b/lib/cpp/src/transport/THttpServer.cpp
@@ -61,7 +61,7 @@
}
*path = '\0';
- while (*(++path) == ' ');
+ while (*(++path) == ' ') {};
char* http = strchr(path, ' ');
if (http == NULL) {
diff --git a/lib/cpp/src/transport/TZlibTransport.cpp b/lib/cpp/src/transport/TZlibTransport.cpp
index 881150d..be65288 100644
--- a/lib/cpp/src/transport/TZlibTransport.cpp
+++ b/lib/cpp/src/transport/TZlibTransport.cpp
@@ -313,6 +313,7 @@
}
const uint8_t* TZlibTransport::borrow(uint8_t* buf, uint32_t* len) {
+ (void) buf;
// Don't try to be clever with shifting buffers.
// If we have enough data, give a pointer to it,
// otherwise let the protcol use its slow path.
diff --git a/lib/cpp/test/AllProtocolTests.cpp b/lib/cpp/test/AllProtocolTests.cpp
index db29ccc..8fec7f5 100644
--- a/lib/cpp/test/AllProtocolTests.cpp
+++ b/lib/cpp/test/AllProtocolTests.cpp
@@ -31,6 +31,8 @@
char errorMessage[ERR_LEN];
int main(int argc, char** argv) {
+ (void) argc;
+ (void) argv;
try {
testProtocol<TBinaryProtocol>("TBinaryProtocol");
testProtocol<TCompactProtocol>("TCompactProtocol");
diff --git a/lib/cpp/test/DebugProtoTest_extras.cpp b/lib/cpp/test/DebugProtoTest_extras.cpp
index e68c544..c89db74 100644
--- a/lib/cpp/test/DebugProtoTest_extras.cpp
+++ b/lib/cpp/test/DebugProtoTest_extras.cpp
@@ -25,6 +25,7 @@
namespace thrift { namespace test { namespace debug {
bool Empty::operator<(Empty const& other) const {
+ (void) other;
// It is empty, so all are equal.
return false;
}
diff --git a/lib/cpp/test/TFileTransportTest.cpp b/lib/cpp/test/TFileTransportTest.cpp
index 98fd18d..6260094 100644
--- a/lib/cpp/test/TFileTransportTest.cpp
+++ b/lib/cpp/test/TFileTransportTest.cpp
@@ -70,6 +70,7 @@
FsyncLog() {}
void fsync(int fd) {
+ (void) fd;
FsyncCall call;
gettimeofday(&call.time, NULL);
calls_.push_back(call);
diff --git a/lib/cpp/test/TransportTest.cpp b/lib/cpp/test/TransportTest.cpp
index 46a89a7..d12e384 100644
--- a/lib/cpp/test/TransportTest.cpp
+++ b/lib/cpp/test/TransportTest.cpp
@@ -341,6 +341,7 @@
void set_alarm();
void alarm_handler(int signum) {
+ (void) signum;
// The alarm timed out, which almost certainly means we're stuck
// on a transport that is incorrectly blocked.
++numTriggersFired;