You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2010/10/13 20:10:43 UTC

svn commit: r1022220 - in /incubator/thrift/trunk: compiler/cpp/src/generate/ compiler/cpp/src/parse/ lib/cpp/src/concurrency/ lib/cpp/src/protocol/ lib/cpp/src/server/ lib/cpp/src/transport/ lib/cpp/test/

Author: roger
Date: Wed Oct 13 18:10:18 2010
New Revision: 1022220

URL: http://svn.apache.org/viewvc?rev=1022220&view=rev
Log:
THRIFT-916 no errors on GNU/Linux when compiling with CXXFLAGS="-Wall -Wextra -pedantic"



Modified:
    incubator/thrift/trunk/compiler/cpp/src/generate/t_as3_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_cocoa_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_csharp_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_erl_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_hs_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_html_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_javame_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_js_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_ocaml_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_perl_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_php_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_py_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_st_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/generate/t_xsd_generator.cc
    incubator/thrift/trunk/compiler/cpp/src/parse/t_field.h
    incubator/thrift/trunk/lib/cpp/src/concurrency/Mutex.h
    incubator/thrift/trunk/lib/cpp/src/protocol/TCompactProtocol.tcc
    incubator/thrift/trunk/lib/cpp/src/server/TThreadPoolServer.cpp
    incubator/thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp
    incubator/thrift/trunk/lib/cpp/test/TBufferBaseTest.cpp
    incubator/thrift/trunk/lib/cpp/test/TMemoryBufferTest.cpp
    incubator/thrift/trunk/lib/cpp/test/TransportTest.cpp

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_as3_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_as3_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_as3_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_as3_generator.cc Wed Oct 13 18:10:18 2010
@@ -2595,4 +2595,5 @@ std::string t_as3_generator::get_enum_cl
 
 THRIFT_REGISTER_GENERATOR(as3, "AS3",
 "    bindable:          Add [bindable] metadata to all the struct classes.\n"
-);
+)
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_cocoa_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_cocoa_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_cocoa_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_cocoa_generator.cc Wed Oct 13 18:10:18 2010
@@ -2462,4 +2462,5 @@ string t_cocoa_generator::call_field_set
 
 THRIFT_REGISTER_GENERATOR(cocoa, "Cocoa",
 "    log_unexpected:  Log every time an unexpected field ID or type is encountered.\n"
-);
+)
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc Wed Oct 13 18:10:18 2010
@@ -4118,4 +4118,5 @@ THRIFT_REGISTER_GENERATOR(cpp, "C++",
 "    pure_enums:      Generate pure enums instead of wrapper classes.\n"
 "    dense:           Generate type specifications for the dense protocol.\n"
 "    include_prefix:  Use full include paths in generated files.\n"
-);
+)
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_csharp_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_csharp_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_csharp_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_csharp_generator.cc Wed Oct 13 18:10:18 2010
@@ -1697,4 +1697,5 @@ string t_csharp_generator::type_to_enum(
 }
 
 
-THRIFT_REGISTER_GENERATOR(csharp, "C#", "");
+THRIFT_REGISTER_GENERATOR(csharp, "C#", "")
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_erl_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_erl_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_erl_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_erl_generator.cc Wed Oct 13 18:10:18 2010
@@ -921,4 +921,5 @@ std::string t_erl_generator::type_module
   return uncapitalize(ttype->get_program()->get_name()) + "_types";
 }
 
-THRIFT_REGISTER_GENERATOR(erl, "Erlang", "");
+THRIFT_REGISTER_GENERATOR(erl, "Erlang", "")
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_hs_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_hs_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_hs_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_hs_generator.cc Wed Oct 13 18:10:18 2010
@@ -1468,4 +1468,5 @@ string t_hs_generator::render_hs_type(t_
 }
 
 
-THRIFT_REGISTER_GENERATOR(hs, "Haskell", "");
+THRIFT_REGISTER_GENERATOR(hs, "Haskell", "")
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_html_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_html_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_html_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_html_generator.cc Wed Oct 13 18:10:18 2010
@@ -644,4 +644,5 @@ void t_html_generator::generate_service(
   }
 }
 
-THRIFT_REGISTER_GENERATOR(html, "HTML", "");
+THRIFT_REGISTER_GENERATOR(html, "HTML", "")
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc Wed Oct 13 18:10:18 2010
@@ -3924,5 +3924,5 @@ THRIFT_REGISTER_GENERATOR(java, "Java",
 "    private-members: Members will be private, but setter methods will return 'this' like usual.\n"
 "    nocamel:         Do not use CamelCase field accessors with beans.\n"
 "    hashcode:        Generate quality hashCode methods.\n"
-);
+)
 

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_javame_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_javame_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_javame_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_javame_generator.cc Wed Oct 13 18:10:18 2010
@@ -3375,4 +3375,5 @@ void t_javame_generator::generate_java_s
   indent(out) << "}" << endl << endl;
 }
 
-THRIFT_REGISTER_GENERATOR(javame, "Java ME", "");
+THRIFT_REGISTER_GENERATOR(javame, "Java ME", "")
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_js_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_js_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_js_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_js_generator.cc Wed Oct 13 18:10:18 2010
@@ -1469,4 +1469,5 @@ string t_js_generator ::type_to_enum(t_t
 }
 
 
-THRIFT_REGISTER_GENERATOR(js, "Javascript", "");
+THRIFT_REGISTER_GENERATOR(js, "Javascript", "")
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_ocaml_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_ocaml_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_ocaml_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_ocaml_generator.cc Wed Oct 13 18:10:18 2010
@@ -1873,4 +1873,5 @@ string t_ocaml_generator::render_ocaml_t
 }
 
 
-THRIFT_REGISTER_GENERATOR(ocaml, "OCaml", "");
+THRIFT_REGISTER_GENERATOR(ocaml, "OCaml", "")
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_perl_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_perl_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_perl_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_perl_generator.cc Wed Oct 13 18:10:18 2010
@@ -1803,4 +1803,5 @@ string t_perl_generator ::type_to_enum(t
   throw "INVALID TYPE IN type_to_enum: " + type->get_name();
 }
 
-THRIFT_REGISTER_GENERATOR(perl, "Perl", "");
+THRIFT_REGISTER_GENERATOR(perl, "Perl", "")
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_php_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_php_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_php_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_php_generator.cc Wed Oct 13 18:10:18 2010
@@ -2303,4 +2303,5 @@ THRIFT_REGISTER_GENERATOR(php, "PHP",
 "    autoload:        Generate PHP with autoload\n"
 "    oop:             Generate PHP with object oriented subclasses\n"
 "    rest:            Generate PHP REST processors\n"
-);
+)
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_py_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_py_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_py_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_py_generator.cc Wed Oct 13 18:10:18 2010
@@ -2379,4 +2379,5 @@ string t_py_generator::type_to_spec_args
 THRIFT_REGISTER_GENERATOR(py, "Python",
 "    new_style:       Generate new-style classes.\n" \
 "    twisted:         Generate Twisted-friendly RPC services.\n"
-);
+)
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc Wed Oct 13 18:10:18 2010
@@ -1183,4 +1183,5 @@ void t_rb_generator::generate_rb_union_v
   indent(out) << "end" << endl << endl;
 }
 
-THRIFT_REGISTER_GENERATOR(rb, "Ruby", "");
+THRIFT_REGISTER_GENERATOR(rb, "Ruby", "")
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_st_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_st_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_st_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_st_generator.cc Wed Oct 13 18:10:18 2010
@@ -1051,4 +1051,5 @@ string t_st_generator::type_to_enum(t_ty
 }
 
 
-THRIFT_REGISTER_GENERATOR(st, "Smalltalk", "");
+THRIFT_REGISTER_GENERATOR(st, "Smalltalk", "")
+

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_xsd_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_xsd_generator.cc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_xsd_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_xsd_generator.cc Wed Oct 13 18:10:18 2010
@@ -351,4 +351,5 @@ string t_xsd_generator::base_type_name(t
   }
 }
 
-THRIFT_REGISTER_GENERATOR(xsd, "XSD", "");
+THRIFT_REGISTER_GENERATOR(xsd, "XSD", "")
+

Modified: incubator/thrift/trunk/compiler/cpp/src/parse/t_field.h
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/parse/t_field.h?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/parse/t_field.h (original)
+++ incubator/thrift/trunk/compiler/cpp/src/parse/t_field.h Wed Oct 13 18:10:18 2010
@@ -71,7 +71,7 @@ class t_field : public t_doc {
   enum e_req {
     T_REQUIRED,
     T_OPTIONAL,
-    T_OPT_IN_REQ_OUT,
+    T_OPT_IN_REQ_OUT
   };
 
   void set_req(e_req req) {

Modified: incubator/thrift/trunk/lib/cpp/src/concurrency/Mutex.h
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/concurrency/Mutex.h?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/concurrency/Mutex.h (original)
+++ incubator/thrift/trunk/lib/cpp/src/concurrency/Mutex.h Wed Oct 13 18:10:18 2010
@@ -133,7 +133,7 @@ class Guard {
 // as to whether we're doing acquireRead() or acquireWrite().
 enum RWGuardType {
   RW_READ = 0,
-  RW_WRITE = 1,
+  RW_WRITE = 1
 };
 
 

Modified: incubator/thrift/trunk/lib/cpp/src/protocol/TCompactProtocol.tcc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/protocol/TCompactProtocol.tcc?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/protocol/TCompactProtocol.tcc (original)
+++ incubator/thrift/trunk/lib/cpp/src/protocol/TCompactProtocol.tcc Wed Oct 13 18:10:18 2010
@@ -58,7 +58,7 @@ enum Types {
   CT_LIST           = 0x09,
   CT_SET            = 0x0A,
   CT_MAP            = 0x0B,
-  CT_STRUCT         = 0x0C,
+  CT_STRUCT         = 0x0C
 };
 
 const int8_t TTypeToCType[16] = {

Modified: incubator/thrift/trunk/lib/cpp/src/server/TThreadPoolServer.cpp
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/server/TThreadPoolServer.cpp?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/server/TThreadPoolServer.cpp (original)
+++ incubator/thrift/trunk/lib/cpp/src/server/TThreadPoolServer.cpp Wed Oct 13 18:10:18 2010
@@ -30,7 +30,7 @@ using boost::shared_ptr;
 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 {

Modified: incubator/thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp (original)
+++ incubator/thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp Wed Oct 13 18:10:18 2010
@@ -421,8 +421,9 @@ void TFileTransport::writerThread() {
             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 @@ TFileProcessor::TFileProcessor(shared_pt
   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_);

Modified: incubator/thrift/trunk/lib/cpp/test/TBufferBaseTest.cpp
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/test/TBufferBaseTest.cpp?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/test/TBufferBaseTest.cpp (original)
+++ incubator/thrift/trunk/lib/cpp/test/TBufferBaseTest.cpp Wed Oct 13 18:10:18 2010
@@ -172,7 +172,7 @@ void init_data() {
 }
 
 
-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_AUTO_TEST_CASE( test_FramedTranspo
   BOOST_CHECK_EQUAL(buffer->getBufferAsString(), output2);
 }
 
-BOOST_AUTO_TEST_SUITE_END();
+BOOST_AUTO_TEST_SUITE_END()
+

Modified: incubator/thrift/trunk/lib/cpp/test/TMemoryBufferTest.cpp
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/test/TMemoryBufferTest.cpp?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/test/TMemoryBufferTest.cpp (original)
+++ incubator/thrift/trunk/lib/cpp/test/TMemoryBufferTest.cpp Wed Oct 13 18:10:18 2010
@@ -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_CASE( test_exceptions )
     }
   }
 
-BOOST_AUTO_TEST_SUITE_END();
+BOOST_AUTO_TEST_SUITE_END()
+

Modified: incubator/thrift/trunk/lib/cpp/test/TransportTest.cpp
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/test/TransportTest.cpp?rev=1022220&r1=1022219&r2=1022220&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/test/TransportTest.cpp (original)
+++ incubator/thrift/trunk/lib/cpp/test/TransportTest.cpp Wed Oct 13 18:10:18 2010
@@ -360,8 +360,9 @@ void alarm_handler(int signum) {
   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 @@ class TransportTestGen {
     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,