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_);