THRIFT-916 no errors on GNU/Linux when compiling with CXXFLAGS="-Wall -Wextra -pedantic"
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1022220 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/concurrency/Mutex.h b/lib/cpp/src/concurrency/Mutex.h
index 7cedbe3..3ee5c6b 100644
--- a/lib/cpp/src/concurrency/Mutex.h
+++ b/lib/cpp/src/concurrency/Mutex.h
@@ -133,7 +133,7 @@
// as to whether we're doing acquireRead() or acquireWrite().
enum RWGuardType {
RW_READ = 0,
- RW_WRITE = 1,
+ RW_WRITE = 1
};
diff --git a/lib/cpp/src/protocol/TCompactProtocol.tcc b/lib/cpp/src/protocol/TCompactProtocol.tcc
index 8ad999c..ed9c281 100644
--- a/lib/cpp/src/protocol/TCompactProtocol.tcc
+++ b/lib/cpp/src/protocol/TCompactProtocol.tcc
@@ -58,7 +58,7 @@
CT_LIST = 0x09,
CT_SET = 0x0A,
CT_MAP = 0x0B,
- CT_STRUCT = 0x0C,
+ CT_STRUCT = 0x0C
};
const int8_t TTypeToCType[16] = {
diff --git a/lib/cpp/src/server/TThreadPoolServer.cpp b/lib/cpp/src/server/TThreadPoolServer.cpp
index 18319be..840b835 100644
--- a/lib/cpp/src/server/TThreadPoolServer.cpp
+++ b/lib/cpp/src/server/TThreadPoolServer.cpp
@@ -30,7 +30,7 @@
using namespace std;
using namespace apache::thrift;
using namespace apache::thrift::concurrency;
-using namespace apache::thrift::protocol;;
+using namespace apache::thrift::protocol;
using namespace apache::thrift::transport;
class TThreadPoolServer::Task : public Runnable {
diff --git a/lib/cpp/src/transport/TFileTransport.cpp b/lib/cpp/src/transport/TFileTransport.cpp
index 704dc56..4b14dee 100644
--- a/lib/cpp/src/transport/TFileTransport.cpp
+++ b/lib/cpp/src/transport/TFileTransport.cpp
@@ -421,8 +421,9 @@
offset_ = lseek(fd_, 0, SEEK_CUR);
int32_t padding = (int32_t)((offset_ / chunkSize_ + 1) * chunkSize_ - offset_);
- uint8_t zeros[padding];
- bzero(zeros, padding);
+ uint8_t* zeros = new uint8_t[padding];
+ memset(zeros, '\0', padding);
+ boost::scoped_array<uint8_t> array(zeros);
if (-1 == ::write(fd_, zeros, padding)) {
int errno_copy = errno;
GlobalOutput.perror("TFileTransport: writerThread() error while padding zeros ", errno_copy);
@@ -1004,7 +1005,7 @@
inputProtocolFactory_(protocolFactory),
outputProtocolFactory_(protocolFactory),
inputTransport_(inputTransport),
- outputTransport_(outputTransport) {};
+ outputTransport_(outputTransport) {}
void TFileProcessor::process(uint32_t numEvents, bool tail) {
shared_ptr<TProtocol> inputProtocol = inputProtocolFactory_->getProtocol(inputTransport_);
diff --git a/lib/cpp/test/TBufferBaseTest.cpp b/lib/cpp/test/TBufferBaseTest.cpp
index 21f4747..6e1bf16 100644
--- a/lib/cpp/test/TBufferBaseTest.cpp
+++ b/lib/cpp/test/TBufferBaseTest.cpp
@@ -172,7 +172,7 @@
}
-BOOST_AUTO_TEST_SUITE( TBufferBaseTest );
+BOOST_AUTO_TEST_SUITE( TBufferBaseTest )
BOOST_AUTO_TEST_CASE( test_MemoryBuffer_Write_GetBuffer ) {
init_data();
@@ -641,4 +641,5 @@
BOOST_CHECK_EQUAL(buffer->getBufferAsString(), output2);
}
-BOOST_AUTO_TEST_SUITE_END();
+BOOST_AUTO_TEST_SUITE_END()
+
diff --git a/lib/cpp/test/TMemoryBufferTest.cpp b/lib/cpp/test/TMemoryBufferTest.cpp
index 3dc19f8..3711970 100644
--- a/lib/cpp/test/TMemoryBufferTest.cpp
+++ b/lib/cpp/test/TMemoryBufferTest.cpp
@@ -25,7 +25,7 @@
#include <protocol/TBinaryProtocol.h>
#include "gen-cpp/ThriftTest_types.h"
-BOOST_AUTO_TEST_SUITE( TMemoryBufferTest );
+BOOST_AUTO_TEST_SUITE( TMemoryBufferTest )
BOOST_AUTO_TEST_CASE( test_roundtrip ) {
using apache::thrift::transport::TMemoryBuffer;
@@ -104,4 +104,5 @@
}
}
-BOOST_AUTO_TEST_SUITE_END();
+BOOST_AUTO_TEST_SUITE_END()
+
diff --git a/lib/cpp/test/TransportTest.cpp b/lib/cpp/test/TransportTest.cpp
index dceb708..59f2427 100644
--- a/lib/cpp/test/TransportTest.cpp
+++ b/lib/cpp/test/TransportTest.cpp
@@ -360,8 +360,9 @@
set_alarm();
// Write some data to the transport to hopefully unblock it.
- uint8_t buf[info->writeLength];
+ uint8_t* buf = new uint8_t[info->writeLength];
memset(buf, 'b', info->writeLength);
+ boost::scoped_array<uint8_t> array(buf);
info->transport->write(buf, info->writeLength);
info->transport->flush();
@@ -895,7 +896,7 @@
boost::unit_test::test_case* tc =
boost::unit_test::make_test_case(test_func, name.str());
suite_->add(tc, expectedFailures);
- };
+ }
template <class CoupledTransports>
void addTestBlocking(const char* transportName,