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/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 {