Author: roger
Date: Sun Jul 17 18:55:59 2011
New Revision: 1147700

URL: http://svn.apache.org/viewvc?rev=1147700&view=rev
Log:
THRIFT-916 gcc warnings in c++ header files

Modified:
    thrift/trunk/compiler/cpp/src/generate/t_as3_generator.cc
    thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc
    thrift/trunk/compiler/cpp/src/generate/t_go_generator.cc   (contents, props 
changed)
    thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
    thrift/trunk/lib/cpp/src/async/TEvhttpClientChannel.cpp   (contents, props 
changed)
    thrift/trunk/lib/cpp/src/async/TEvhttpServer.cpp   (contents, props changed)
    thrift/trunk/lib/cpp/src/transport/TSSLSocket.cpp   (contents, props 
changed)
    thrift/trunk/lib/cpp/src/transport/TSSLSocket.h   (contents, props changed)
    thrift/trunk/test/cpp/src/StressTest.cpp   (contents, props changed)
    thrift/trunk/test/cpp/src/StressTestNonBlocking.cpp   (contents, props 
changed)
    thrift/trunk/test/cpp/src/TestClient.cpp   (contents, props changed)
    thrift/trunk/test/cpp/src/TestServer.cpp

Modified: thrift/trunk/compiler/cpp/src/generate/t_as3_generator.cc
URL: 
http://svn.apache.org/viewvc/thrift/trunk/compiler/cpp/src/generate/t_as3_generator.cc?rev=1147700&r1=1147699&r2=1147700&view=diff
==============================================================================
--- thrift/trunk/compiler/cpp/src/generate/t_as3_generator.cc (original)
+++ thrift/trunk/compiler/cpp/src/generate/t_as3_generator.cc Sun Jul 17 
18:55:59 2011
@@ -769,7 +769,6 @@ void t_as3_generator::generate_as3_struc
   "public function " << tstruct->get_name() << "() {" << endl;
   indent_up();
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* t = get_true_type((*m_iter)->get_type());
     if ((*m_iter)->get_value() != NULL) {
       indent(out) << "this._" << (*m_iter)->get_name() << " = " << 
(*m_iter)->get_value()->get_integer() << ";" <<
       endl;

Modified: thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc
URL: 
http://svn.apache.org/viewvc/thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc?rev=1147700&r1=1147699&r2=1147700&view=diff
==============================================================================
--- thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc (original)
+++ thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc Sun Jul 17 
18:55:59 2011
@@ -3007,6 +3007,12 @@ void t_cpp_generator::generate_process_f
         indent() << "T_GENERIC_PROTOCOL(this, oprot, _oprot);" << endl << endl;
     }
 
+    if (tfunction->is_oneway()) {
+      out <<
+        indent() << "(void) seqid;" << endl <<
+        indent() << "(void) oprot;" << endl;
+    }
+
     out <<
       indent() << tservice->get_name() + "_" + tfunction->get_name() + "_args" 
<< " args;" << endl <<
       indent() << "void* ctx = NULL;" << endl <<
@@ -3996,7 +4002,7 @@ string t_cpp_generator::function_signatu
                   ? "()"
                   : ("(" + type_name(ttype) + " const& _return)"));
       if (has_xceptions) {
-        exn_cob = ", 
std::tr1::function<void(::apache::thrift::TDelayedException* _throw)> exn_cob";
+        exn_cob = ", 
std::tr1::function<void(::apache::thrift::TDelayedException* _throw)> /* 
exn_cob */";
       }
     } else {
       throw "UNKNOWN STYLE";

Modified: thrift/trunk/compiler/cpp/src/generate/t_go_generator.cc
URL: 
http://svn.apache.org/viewvc/thrift/trunk/compiler/cpp/src/generate/t_go_generator.cc?rev=1147700&r1=1147699&r2=1147700&view=diff
==============================================================================
--- thrift/trunk/compiler/cpp/src/generate/t_go_generator.cc (original)
+++ thrift/trunk/compiler/cpp/src/generate/t_go_generator.cc Sun Jul 17 
18:55:59 2011
@@ -46,6 +46,8 @@ class t_go_generator : public t_generato
       const std::string& option_string)
     : t_generator(program)
   {
+    (void) parsed_options;
+    (void) option_string;
     std::map<std::string, std::string>::const_iterator iter;
     out_dir_base_ = "gen-go";
   }
@@ -771,6 +773,7 @@ void t_go_generator::generate_go_struct_
                                                    bool is_exception,
                                                    bool is_result) {
 
+  (void) is_exception;
   const vector<t_field*>& members = tstruct->get_members();
   const vector<t_field*>& sorted_members = tstruct->get_sorted_members();
   vector<t_field*>::const_iterator m_iter;
@@ -996,6 +999,7 @@ void t_go_generator::generate_go_struct_
                                                 t_struct* tstruct,
                                                 const string& tstruct_name,
                                                 bool is_result) {
+  (void) is_result;
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
   string escaped_tstruct_name(escape_string(tstruct->get_name()));
@@ -2236,6 +2240,8 @@ void t_go_generator::generate_deserializ
                                                 string err,
                                                 bool inclass,
                                                 bool coerceData) {
+  (void) inclass;
+  (void) coerceData;
   t_type* orig_type = tfield->get_type();
   t_type* type = get_true_type(orig_type);
   string name(prefix + 
publicize(variable_name_to_go_name(tfield->get_name())));
@@ -2330,6 +2336,7 @@ void t_go_generator::generate_deserializ
                                                   bool declare,
                                                   string prefix,
                                                   string err) {
+  (void) err;
   string err2(tmp("err"));
   string eq(" := ");
   if(!declare) {
@@ -2452,6 +2459,8 @@ void t_go_generator::generate_deserializ
                                                        bool   declare,
                                                        string prefix,
                                                        string err) {
+  (void) declare;
+  (void) err;
   string key = tmp("_key");
   string val = tmp("_val");
   t_field fkey(tmap->get_key_type(), key);
@@ -2472,6 +2481,7 @@ void t_go_generator::generate_deserializ
                                                        bool   declare,
                                                        string prefix,
                                                        string err) {
+  (void) declare;
   string elem = tmp("_elem");
   t_field felem(tset->get_elem_type(), elem);
 
@@ -2489,6 +2499,7 @@ void t_go_generator::generate_deserializ
                                                         bool   declare,
                                                         string prefix,
                                                         string err) {
+  (void) declare;
   string elem = tmp("_elem");
   t_field felem(tlist->get_elem_type(), elem);
 
@@ -3074,4 +3085,4 @@ string t_go_generator::type_to_spec_args
 }
 
 
-THRIFT_REGISTER_GENERATOR(go, "Go", "");
+THRIFT_REGISTER_GENERATOR(go, "Go", "")

Propchange: thrift/trunk/compiler/cpp/src/generate/t_go_generator.cc
------------------------------------------------------------------------------
    svn:executable = *

Modified: thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
URL: 
http://svn.apache.org/viewvc/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc?rev=1147700&r1=1147699&r2=1147700&view=diff
==============================================================================
--- thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc (original)
+++ thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc Sun Jul 17 
18:55:59 2011
@@ -3875,6 +3875,7 @@ void t_java_generator::generate_java_str
 
 // generates java method to serialize (in the Java sense) the object
 void t_java_generator::generate_java_struct_write_object(ofstream& out, 
t_struct* tstruct) {
+  (void) tstruct;
   indent(out) << "private void writeObject(java.io.ObjectOutputStream out) 
throws java.io.IOException {" << endl;
   indent(out) << "  try {" << endl;
   indent(out) << "    write(new 
org.apache.thrift.protocol.TCompactProtocol(new 
org.apache.thrift.transport.TIOStreamTransport(out)));" << endl;

Modified: thrift/trunk/lib/cpp/src/async/TEvhttpClientChannel.cpp
URL: 
http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/async/TEvhttpClientChannel.cpp?rev=1147700&r1=1147699&r2=1147700&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/async/TEvhttpClientChannel.cpp (original)
+++ thrift/trunk/lib/cpp/src/async/TEvhttpClientChannel.cpp Sun Jul 17 18:55:59 
2011
@@ -93,12 +93,16 @@ bool TEvhttpClientChannel::sendAndRecvMe
 
 bool TEvhttpClientChannel::sendMessage(
     const VoidCallback& cob, apache::thrift::transport::TMemoryBuffer* 
message) {
+  (void) cob;
+  (void) message;
   abort(); // XXX
 }
 
 
 bool TEvhttpClientChannel::recvMessage(
     const VoidCallback& cob, apache::thrift::transport::TMemoryBuffer* 
message) {
+  (void) cob;
+  (void) message;
   abort(); // XXX
 }
 

Propchange: thrift/trunk/lib/cpp/src/async/TEvhttpClientChannel.cpp
------------------------------------------------------------------------------
    svn:executable = *

Modified: thrift/trunk/lib/cpp/src/async/TEvhttpServer.cpp
URL: 
http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/async/TEvhttpServer.cpp?rev=1147700&r1=1147699&r2=1147700&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/async/TEvhttpServer.cpp (original)
+++ thrift/trunk/lib/cpp/src/async/TEvhttpServer.cpp Sun Jul 17 18:55:59 2011
@@ -124,6 +124,7 @@ void TEvhttpServer::process(struct evhtt
 
 
 void TEvhttpServer::complete(RequestContext* ctx, bool success) {
+  (void) success;
   std::auto_ptr<RequestContext> ptr(ctx);
 
   int code = 200;

Propchange: thrift/trunk/lib/cpp/src/async/TEvhttpServer.cpp
------------------------------------------------------------------------------
    svn:executable = *

Modified: thrift/trunk/lib/cpp/src/transport/TSSLSocket.cpp
URL: 
http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/transport/TSSLSocket.cpp?rev=1147700&r1=1147699&r2=1147700&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/transport/TSSLSocket.cpp (original)
+++ thrift/trunk/lib/cpp/src/transport/TSSLSocket.cpp Sun Jul 17 18:55:59 2011
@@ -258,7 +258,7 @@ void TSSLSocket::authorize() {
   // both certificate and access manager are present
 
   string host;
-  sockaddr_storage sa = {};
+  sockaddr_storage sa;
   socklen_t saLength = sizeof(sa);
 
   if (getpeername(socket_, (sockaddr*)&sa, &saLength) != 0) {
@@ -591,7 +591,10 @@ void buildErrors(string& errors, int err
  * Default implementation of AccessManager
  */
 Decision DefaultClientAccessManager::verify(const sockaddr_storage& sa)
-  throw() { return SKIP; }
+  throw() { 
+  (void) sa;
+  return SKIP;
+}
 
 Decision DefaultClientAccessManager::verify(const string& host,
                                             const char* name,

Propchange: thrift/trunk/lib/cpp/src/transport/TSSLSocket.cpp
------------------------------------------------------------------------------
    svn:executable = *

Modified: thrift/trunk/lib/cpp/src/transport/TSSLSocket.h
URL: 
http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/transport/TSSLSocket.h?rev=1147700&r1=1147699&r2=1147700&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/transport/TSSLSocket.h (original)
+++ thrift/trunk/lib/cpp/src/transport/TSSLSocket.h Sun Jul 17 18:55:59 2011
@@ -201,7 +201,7 @@ class TSSLSocketFactory {
    * @param password Pass collected password to OpenSSL
    * @param size     Maximum length of password including NULL character
    */
-  virtual void getPassword(std::string& password, int size) { }
+  virtual void getPassword(std::string& /* password */, int /* size */) {}
  private:
   bool server_;
   boost::shared_ptr<AccessManager> access_;
@@ -253,7 +253,7 @@ class AccessManager {
   enum Decision {
     DENY   = -1,    // deny access
     SKIP   =  0,    // cannot make decision, move on to next (if any)
-    ALLOW  =  1,    // allow access
+    ALLOW  =  1     // allow access
   };
  /**
   * Destructor
@@ -270,7 +270,7 @@ class AccessManager {
   * @param  sa Peer IP address
   * @return True if the peer is trusted, false otherwise
   */
- virtual Decision verify(const sockaddr_storage& sa) throw() { return DENY; }
+ virtual Decision verify(const sockaddr_storage& /* sa */ ) throw() { return 
DENY; }
  /**
   * Determine whether the peer should be granted access or not. It's called
   * every time a DNS subjectAltName/common name is extracted from peer's
@@ -284,7 +284,7 @@ class AccessManager {
   *
   * Note: The "name" parameter may be UTF8 encoded.
   */
- virtual Decision verify(const std::string& host, const char* name, int size)
+ virtual Decision verify(const std::string& /* host */, const char* /* name 
*/, int /* size */)
    throw() { return DENY; }
  /**
   * Determine whether the peer should be granted access or not. It's called
@@ -295,7 +295,7 @@ class AccessManager {
   * @param  size Length of the IP address
   * @return True if the peer is trusted, false otherwise
   */
- virtual Decision verify(const sockaddr_storage& sa, const char* data, int 
size)
+ virtual Decision verify(const sockaddr_storage& /* sa */, const char* /* data 
*/, int /* size */)
    throw() { return DENY; }
 };
 

Propchange: thrift/trunk/lib/cpp/src/transport/TSSLSocket.h
------------------------------------------------------------------------------
    svn:executable = *

Modified: thrift/trunk/test/cpp/src/StressTest.cpp
URL: 
http://svn.apache.org/viewvc/thrift/trunk/test/cpp/src/StressTest.cpp?rev=1147700&r1=1147699&r2=1147700&view=diff
==============================================================================
--- thrift/trunk/test/cpp/src/StressTest.cpp (original)
+++ thrift/trunk/test/cpp/src/StressTest.cpp Sun Jul 17 18:55:59 2011
@@ -92,7 +92,7 @@ class Server : public ServiceIf {
   int64_t echoI64(const int64_t arg) {return arg;}
   void echoString(string& out, const string &arg) {
     if (arg != "hello") {
-      T_ERROR_ABORT("WRONG STRING!!!!");
+      T_ERROR_ABORT("WRONG STRING (%s)!!!!", arg.c_str());
     }
     out = arg;
   }

Propchange: thrift/trunk/test/cpp/src/StressTest.cpp
------------------------------------------------------------------------------
    svn:executable = *

Modified: thrift/trunk/test/cpp/src/StressTestNonBlocking.cpp
URL: 
http://svn.apache.org/viewvc/thrift/trunk/test/cpp/src/StressTestNonBlocking.cpp?rev=1147700&r1=1147699&r2=1147700&view=diff
==============================================================================
--- thrift/trunk/test/cpp/src/StressTestNonBlocking.cpp (original)
+++ thrift/trunk/test/cpp/src/StressTestNonBlocking.cpp Sun Jul 17 18:55:59 2011
@@ -98,7 +98,7 @@ class Server : public ServiceIf {
   int64_t echoI64(const int64_t arg) {return arg;}
   void echoString(string& out, const string &arg) {
     if (arg != "hello") {
-      T_ERROR_ABORT("WRONG STRING!!!!");
+      T_ERROR_ABORT("WRONG STRING (%s)!!!!", arg.c_str());
     }
     out = arg;
   }

Propchange: thrift/trunk/test/cpp/src/StressTestNonBlocking.cpp
------------------------------------------------------------------------------
    svn:executable = *

Modified: thrift/trunk/test/cpp/src/TestClient.cpp
URL: 
http://svn.apache.org/viewvc/thrift/trunk/test/cpp/src/TestClient.cpp?rev=1147700&r1=1147699&r2=1147700&view=diff
==============================================================================
--- thrift/trunk/test/cpp/src/TestClient.cpp (original)
+++ thrift/trunk/test/cpp/src/TestClient.cpp Sun Jul 17 18:55:59 2011
@@ -63,6 +63,9 @@ uint64_t now()
 }
 
 static void testString_clientReturn(const char* host, int port, event_base 
*base, TProtocolFactory* protocolFactory, ThriftTestCobClient* client) {
+  (void) host;
+  (void) port;
+  (void) protocolFactory;
   try {
     string s;
     client->recv_testString(s);
@@ -283,7 +286,7 @@ int main(int argc, char** argv) {
      */
     printf("testDouble(-5.2098523)");
     double dub = testClient.testDouble(-5.2098523);
-    printf(" = %lf\n", dub);
+    printf(" = %f\n", dub);
 
     /**
      * STRUCT TEST

Propchange: thrift/trunk/test/cpp/src/TestClient.cpp
------------------------------------------------------------------------------
    svn:executable = *

Modified: thrift/trunk/test/cpp/src/TestServer.cpp
URL: 
http://svn.apache.org/viewvc/thrift/trunk/test/cpp/src/TestServer.cpp?rev=1147700&r1=1147699&r2=1147700&view=diff
==============================================================================
--- thrift/trunk/test/cpp/src/TestServer.cpp (original)
+++ thrift/trunk/test/cpp/src/TestServer.cpp Sun Jul 17 18:55:59 2011
@@ -88,7 +88,7 @@ class TestHandler : public ThriftTestIf 
   }
 
   double testDouble(const double thing) {
-    printf("testDouble(%lf)\n", thing);
+    printf("testDouble(%f)\n", thing);
     return thing;
   }
 
@@ -193,6 +193,7 @@ class TestHandler : public ThriftTestIf 
   }
 
   void testInsanity(map<UserId, map<Numberz::type,Insanity> > &insane, const 
Insanity &argument) {
+    (void) argument;
     printf("testInsanity()\n");
 
     Xtruct hello;
@@ -262,6 +263,10 @@ class TestHandler : public ThriftTestIf 
   }
 
   void testMulti(Xtruct &hello, const int8_t arg0, const int32_t arg1, const 
int64_t arg2, const std::map<int16_t, std::string>  &arg3, const Numberz::type 
arg4, const UserId arg5) {
+    (void) arg3;
+    (void) arg4;
+    (void) arg5;
+    
     printf("testMulti()\n");
 
     hello.string_thing = "Hello2";
@@ -319,21 +324,25 @@ class TestHandler : public ThriftTestIf 
 
 class TestProcessorEventHandler : public TProcessorEventHandler {
   virtual void* getContext(const char* fn_name, void* serverContext) {
+    (void) serverContext;
     return new std::string(fn_name);
   }
   virtual void freeContext(void* ctx, const char* fn_name) {
+    (void) fn_name;
     delete static_cast<std::string*>(ctx);
   }
   virtual void preRead(void* ctx, const char* fn_name) {
     communicate("preRead", ctx, fn_name);
   }
   virtual void postRead(void* ctx, const char* fn_name, uint32_t bytes) {
+    (void) bytes;
     communicate("postRead", ctx, fn_name);
   }
   virtual void preWrite(void* ctx, const char* fn_name) {
     communicate("preWrite", ctx, fn_name);
   }
   virtual void postWrite(void* ctx, const char* fn_name, uint32_t bytes) {
+    (void) bytes;
     communicate("postWrite", ctx, fn_name);
   }
   virtual void asyncComplete(void* ctx, const char* fn_name) {


Reply via email to