THRIFT-916 compile with -Wall -Wextra without warning on Debian Lenny
authorRoger Meier <roger@apache.org>
Wed, 17 Nov 2010 22:11:26 +0000 (22:11 +0000)
committerRoger Meier <roger@apache.org>
Wed, 17 Nov 2010 22:11:26 +0000 (22:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1036250 13f79535-47bb-0310-9956-ffa450edef68

46 files changed:
compiler/cpp/src/generate/t_as3_generator.cc
compiler/cpp/src/generate/t_c_glib_generator.cc
compiler/cpp/src/generate/t_cocoa_generator.cc
compiler/cpp/src/generate/t_cpp_generator.cc
compiler/cpp/src/generate/t_csharp_generator.cc
compiler/cpp/src/generate/t_erl_generator.cc
compiler/cpp/src/generate/t_generator.h
compiler/cpp/src/generate/t_hs_generator.cc
compiler/cpp/src/generate/t_html_generator.cc
compiler/cpp/src/generate/t_java_generator.cc
compiler/cpp/src/generate/t_javame_generator.cc
compiler/cpp/src/generate/t_js_generator.cc
compiler/cpp/src/generate/t_ocaml_generator.cc
compiler/cpp/src/generate/t_perl_generator.cc
compiler/cpp/src/generate/t_php_generator.cc
compiler/cpp/src/generate/t_py_generator.cc
compiler/cpp/src/generate/t_rb_generator.cc
compiler/cpp/src/generate/t_st_generator.cc
compiler/cpp/src/generate/t_xsd_generator.cc
compiler/cpp/src/thriftl.ll
lib/cpp/src/TProcessor.h
lib/cpp/src/async/TAsyncProtocolProcessor.cpp
lib/cpp/src/concurrency/ThreadManager.cpp
lib/cpp/src/concurrency/ThreadManager.h
lib/cpp/src/concurrency/TimerManager.cpp
lib/cpp/src/concurrency/TimerManager.h
lib/cpp/src/concurrency/Util.cpp
lib/cpp/src/concurrency/Util.h
lib/cpp/src/concurrency/test/ThreadFactoryTests.h
lib/cpp/src/concurrency/test/ThreadManagerTests.h
lib/cpp/src/processor/PeekProcessor.cpp
lib/cpp/src/protocol/TBinaryProtocol.tcc
lib/cpp/src/protocol/TCompactProtocol.tcc
lib/cpp/src/protocol/TDebugProtocol.cpp
lib/cpp/src/protocol/TDenseProtocol.cpp
lib/cpp/src/protocol/TJSONProtocol.cpp
lib/cpp/src/protocol/TVirtualProtocol.h
lib/cpp/src/server/TNonblockingServer.cpp
lib/cpp/src/transport/TBufferTransports.cpp
lib/cpp/src/transport/THttpClient.cpp
lib/cpp/src/transport/THttpServer.cpp
lib/cpp/src/transport/TZlibTransport.cpp
lib/cpp/test/AllProtocolTests.cpp
lib/cpp/test/DebugProtoTest_extras.cpp
lib/cpp/test/TFileTransportTest.cpp
lib/cpp/test/TransportTest.cpp

index d06d933..aa258a1 100644 (file)
@@ -44,6 +44,7 @@ class t_as3_generator : public t_oop_generator {
       const std::string& option_string)
     : t_oop_generator(program)
   {
+    (void) option_string;
     std::map<std::string, std::string>::const_iterator iter;
     
     iter = parsed_options.find("bindable");
@@ -285,7 +286,9 @@ void t_as3_generator::close_generator() {}
  *
  * @param ttypedef The type definition
  */
-void t_as3_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_as3_generator::generate_typedef(t_typedef* ttypedef) {
+  (void) ttypedef;
+}
 
 /**
  * Enums are a class with a set of static constants.
@@ -498,6 +501,7 @@ void t_as3_generator::print_const_value(std::ofstream& out, string name, t_type*
 }
 
 string t_as3_generator::render_const_value(ofstream& out, string name, t_type* type, t_const_value* value) {
+  (void) name;
   type = get_true_type(type);
   std::ostringstream render;
   
@@ -967,6 +971,8 @@ void t_as3_generator::generate_as3_struct_result_writer(ofstream& out,
 }
 
 void t_as3_generator::generate_reflection_getters(ostringstream& out, t_type* type, string field_name, string cap_name) {
+  (void) type;
+  (void) cap_name;
   indent(out) << "case " << upcase_string(field_name) << ":" << endl;
   indent_up();
   indent(out) << "return this." << field_name << ";" << endl;
@@ -974,6 +980,8 @@ void t_as3_generator::generate_reflection_getters(ostringstream& out, t_type* ty
 }
 
 void t_as3_generator::generate_reflection_setters(ostringstream& out, t_type* type, string field_name, string cap_name) {
+  (void) type;
+  (void) cap_name;
   indent(out) << "case " << upcase_string(field_name) << ":" << endl;
   indent_up();
   indent(out) << "if (value == null) {" << endl;
@@ -1772,6 +1780,7 @@ void t_as3_generator::generate_function_helpers(t_function* tfunction) {
  */
 void t_as3_generator::generate_process_function(t_service* tservice,
                                                  t_function* tfunction) {
+  (void) tservice;
   // Open class
   indent(f_service_) <<
   "private function " << tfunction->get_name() << "():Function {" << endl;
@@ -2194,6 +2203,7 @@ void t_as3_generator::generate_serialize_field(ofstream& out,
 void t_as3_generator::generate_serialize_struct(ofstream& out,
                                                  t_struct* tstruct,
                                                  string prefix) {
+  (void) tstruct;
   out <<
     indent() << prefix << ".write(oprot);" << endl;
 }
@@ -2313,6 +2323,7 @@ void t_as3_generator::generate_serialize_list_element(ofstream& out,
  * @return As3 type name, i.e. HashMap<Key,Value>
  */
 string t_as3_generator::type_name(t_type* ttype, bool in_container, bool in_init) {
+  (void) in_init;
   // In As3 typedefs are just resolved to their real type
   ttype = get_true_type(ttype);
   string prefix;
@@ -2349,6 +2360,7 @@ string t_as3_generator::type_name(t_type* ttype, bool in_container, bool in_init
  */
 string t_as3_generator::base_type_name(t_base_type* type,
                                         bool in_container) {
+  (void) in_container;
   t_base_type::t_base tbase = type->get_base();
 
   switch (tbase) {
index a569ae6..8d34bac 100644 (file)
@@ -28,6 +28,8 @@ class t_c_glib_generator : public t_oop_generator
                       const map<string, string> &parsed_options,
                       const string &option_string) : t_oop_generator (program)
   {
+    (void) parsed_options;
+    (void) option_string;
     /* set the output directory */
     this->out_dir_base_ = "gen-c_glib";
 
@@ -520,6 +522,7 @@ t_c_glib_generator::is_complex_type (t_type *ttype)
 string
 t_c_glib_generator::type_name (t_type* ttype, bool in_typedef, bool is_const)
 {
+  (void) in_typedef;
   if (ttype->is_base_type ())
   {
     string bname = base_type_name ((t_base_type *) ttype);
@@ -1709,6 +1712,7 @@ t_c_glib_generator::generate_service_client (t_service *tservice)
 void
 t_c_glib_generator::generate_service_server (t_service *tservice)
 {
+  (void) tservice;
   /* get some C friendly service names */
   string service_name_u = initial_caps_to_underscores (service_name_);
   string service_name_uc = to_upper_case (service_name_u);
@@ -2349,6 +2353,7 @@ void
 t_c_glib_generator::generate_serialize_struct (ofstream &out, t_struct *tstruct,
                                           string prefix, int error_ret)
 {
+  (void) tstruct;
   out <<
     indent () << "if ((ret = thrift_struct_write (THRIFT_STRUCT (" << prefix << "), protocol, error)) < 0)" << endl <<
     indent () << "  return " << error_ret << ";" << endl <<
@@ -2823,6 +2828,7 @@ t_c_glib_generator::generate_deserialize_list_element (ofstream &out, t_list *tl
                                                   string prefix, string index,
                                                   int error_ret)
 {
+  (void) index;
   string elem = tmp ("_elem");
   t_field felem (tlist->get_elem_type (), elem);
 
index 29ace00..26537ac 100644 (file)
@@ -43,6 +43,7 @@ class t_cocoa_generator : public t_oop_generator {
       const std::string& option_string)
     : t_oop_generator(program)
   {
+    (void) option_string;
     std::map<std::string, std::string>::const_iterator iter;
     
     iter = parsed_options.find("log_unexpected");
@@ -541,6 +542,7 @@ void t_cocoa_generator::generate_cocoa_struct_initializer_signature(ofstream &ou
 void t_cocoa_generator::generate_cocoa_struct_field_accessor_declarations(ofstream &out,
                                                                           t_struct* tstruct,
                                                                           bool is_exception) {
+  (void) is_exception;
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
@@ -1019,6 +1021,7 @@ void t_cocoa_generator::generate_cocoa_struct_result_writer(ofstream& out,
 void t_cocoa_generator::generate_cocoa_struct_field_accessor_implementations(ofstream& out,
                                                                              t_struct* tstruct,
                                                                              bool is_exception) {
+  (void) is_exception;
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
@@ -1954,6 +1957,7 @@ void t_cocoa_generator::generate_serialize_field(ofstream& out,
 void t_cocoa_generator::generate_serialize_struct(ofstream& out,
                                                   t_struct* tstruct,
                                                   string fieldName) {
+  (void) tstruct;
   out <<
     indent() << "[" << fieldName << " write: outProtocol];" << endl;
 }
index f5c8def..6fe3397 100644 (file)
@@ -48,6 +48,7 @@ class t_cpp_generator : public t_oop_generator {
       const std::string& option_string)
     : t_oop_generator(program)
   {
+    (void) option_string;
     std::map<std::string, std::string>::const_iterator iter;
 
     iter = parsed_options.find("pure_enums");
@@ -686,6 +687,7 @@ void t_cpp_generator::print_const_value(ofstream& out, string name, t_type* type
  *
  */
 string t_cpp_generator::render_const_value(ofstream& out, string name, t_type* type, t_const_value* value) {
+  (void) name;
   std::ostringstream render;
 
   if (type->is_base_type()) {
@@ -3389,6 +3391,7 @@ void t_cpp_generator::generate_deserialize_field(ofstream& out,
 void t_cpp_generator::generate_deserialize_struct(ofstream& out,
                                                   t_struct* tstruct,
                                                   string prefix) {
+  (void) tstruct;
   indent(out) <<
     "xfer += " << prefix << ".read(iprot);" << endl;
 }
@@ -3607,6 +3610,7 @@ void t_cpp_generator::generate_serialize_field(ofstream& out,
 void t_cpp_generator::generate_serialize_struct(ofstream& out,
                                                 t_struct* tstruct,
                                                 string prefix) {
+  (void) tstruct;
   indent(out) <<
     "xfer += " << prefix << ".write(oprot);" << endl;
 }
index d32652c..45ed646 100644 (file)
@@ -44,6 +44,8 @@ class t_csharp_generator : public t_oop_generator
         const std::string& option_string)
       : t_oop_generator(program)
     {
+      (void) parsed_options;
+      (void) option_string;
       out_dir_base_ = "gen-csharp";
     }
     void init_generator();
@@ -175,7 +177,9 @@ string t_csharp_generator::csharp_thrift_usings() {
 }
 
 void t_csharp_generator::close_generator() { }
-void t_csharp_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_csharp_generator::generate_typedef(t_typedef* ttypedef) {
+  (void) ttypedef;
+}
 
 void t_csharp_generator::generate_enum(t_enum* tenum) {
   string f_enum_name = namespace_dir_+"/" + (tenum->get_name())+".cs";
@@ -334,6 +338,7 @@ bool t_csharp_generator::print_const_value(std::ofstream& out, string name, t_ty
 }
 
 std::string t_csharp_generator::render_const_value(ofstream& out, string name, t_type* type, t_const_value* value) {
+  (void) name;
   std::ostringstream render;
 
   if (type->is_base_type()) {
@@ -1096,6 +1101,7 @@ void t_csharp_generator::generate_function_helpers(t_function* tfunction) {
 }
 
 void t_csharp_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
+  (void) tservice;
   indent(f_service_) <<
     "public void " << tfunction->get_name() << "_Process(int seqid, TProtocol iprot, TProtocol oprot)" << endl;
   scope_up(f_service_);
@@ -1424,6 +1430,7 @@ void t_csharp_generator::generate_serialize_field(ofstream& out, t_field* tfield
 }
 
 void t_csharp_generator::generate_serialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
+  (void) tstruct;
   out <<
     indent() << prefix << ".Write(oprot);" << endl;
 }
@@ -1537,6 +1544,7 @@ std::string t_csharp_generator::prop_name(t_field* tfield) {
 }
 
 string t_csharp_generator::type_name(t_type* ttype, bool in_container, bool in_init) {
+  (void) in_init;
   while (ttype->is_typedef()) {
     ttype = ((t_typedef*)ttype)->get_type();
   }
@@ -1567,6 +1575,7 @@ string t_csharp_generator::type_name(t_type* ttype, bool in_container, bool in_i
 }
 
 string t_csharp_generator::base_type_name(t_base_type* tbase, bool in_container) {
+  (void) in_container;
   switch (tbase->get_base()) {
     case t_base_type::TYPE_VOID:
       return "void";
index 7e2ac75..0f9a822 100644 (file)
@@ -44,6 +44,8 @@ class t_erl_generator : public t_generator {
       const std::string& option_string)
     : t_generator(program)
   {
+    (void) parsed_options;
+    (void) option_string;
     program_name_[0] = tolower(program_name_[0]);
     service_name_[0] = tolower(service_name_[0]);
     out_dir_base_ = "gen-erl";
@@ -213,6 +215,7 @@ void t_erl_generator::hrl_header(ostream& out, string name) {
 }
 
 void t_erl_generator::hrl_footer(ostream& out, string name) {
+  (void) name;
   out << "-endif." << endl;
 }
 
@@ -274,6 +277,7 @@ void t_erl_generator::close_generator() {
  * @param ttypedef The type definition
  */
 void t_erl_generator::generate_typedef(t_typedef* ttypedef) {
+  (void) ttypedef;
 }
 
 /**
@@ -472,6 +476,7 @@ void t_erl_generator::generate_erl_struct_definition(ostream& out,
                                                      bool is_exception,
                                                      bool is_result)
 {
+  (void) is_result;
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
 
@@ -612,6 +617,7 @@ void t_erl_generator::generate_service_helpers(t_service* tservice) {
  * @param tfunction The function
  */
 void t_erl_generator::generate_erl_function_helpers(t_function* tfunction) {
+  (void) tfunction;
 }
 
 /**
@@ -655,7 +661,7 @@ void t_erl_generator::generate_service_interface(t_service* tservice) {
  */
 void t_erl_generator::generate_function_info(t_service* tservice,
                                                 t_function* tfunction) {
-
+  (void) tservice;
   string name_atom = "'" + tfunction->get_name() + "'";
 
 
index 458922f..4de0568 100644 (file)
@@ -73,7 +73,10 @@ class t_generator {
    * Will be called with subnamespace, i.e. is_valid_namespace("twisted")
    * will be called for the above example.
    */
-  static bool is_valid_namespace(const std::string& sub_namespace) { return false; }
+  static bool is_valid_namespace(const std::string& sub_namespace) {
+    (void) sub_namespace;
+    return false;
+  }
 
   /**
    * Escape string to use one in generated sources.
@@ -102,7 +105,9 @@ class t_generator {
 
   virtual void generate_typedef  (t_typedef*  ttypedef)  = 0;
   virtual void generate_enum     (t_enum*     tenum)     = 0;
-  virtual void generate_const    (t_const*    tconst) {}
+  virtual void generate_const    (t_const*    tconst) {
+    (void) tconst;
+  }
   virtual void generate_struct   (t_struct*   tstruct)   = 0;
   virtual void generate_service  (t_service*  tservice)  = 0;
   virtual void generate_xception (t_struct*   txception) {
index 36eb36c..fcc055a 100644 (file)
@@ -43,6 +43,8 @@ class t_hs_generator : public t_oop_generator {
                  const string& option_string)
     : t_oop_generator(program)
   {
+    (void) parsed_options;
+    (void) option_string;
     out_dir_base_ = "gen-hs";
   }
 
@@ -517,6 +519,7 @@ void t_hs_generator::generate_hs_struct_definition(ofstream& out,
                                                    t_struct* tstruct,
                                                    bool is_exception,
                                                    bool helper) {
+  (void) helper;
   string tname = type_name(tstruct);
   string name = tstruct->get_name();
 
@@ -992,6 +995,7 @@ void t_hs_generator::generate_service_server(t_service* tservice) {
  */
 void t_hs_generator::generate_process_function(t_service* tservice,
                                                t_function* tfunction) {
+  (void) tservice;
   // Open function
   string funname = decapitalize(tfunction->get_name());
   indent(f_service_) << "process_" << funname << " (seqid, iprot, oprot, handler) = do" << endl;
@@ -1098,6 +1102,7 @@ void t_hs_generator::generate_process_function(t_service* tservice,
 void t_hs_generator::generate_deserialize_field(ofstream &out,
                                                 t_field* tfield,
                                                 string prefix) {
+  (void) prefix;
   t_type* type = tfield->get_type();
   generate_deserialize_type(out,type);
 }
index d1b2f05..881e0f8 100644 (file)
@@ -44,6 +44,8 @@ class t_html_generator : public t_generator {
       const std::string& option_string)
     : t_generator(program)
   {
+    (void) parsed_options;
+    (void) option_string;  
     out_dir_base_ = "gen-html";
     escape_.clear();
     escape_['&']  = "&amp;";
index 9471774..7acd9ac 100644 (file)
@@ -44,6 +44,7 @@ class t_java_generator : public t_oop_generator {
       const std::string& option_string)
     : t_oop_generator(program)
   {
+    (void) option_string;
     std::map<std::string, std::string>::const_iterator iter;
 
     iter = parsed_options.find("beans");
@@ -356,7 +357,9 @@ void t_java_generator::close_generator() {}
  *
  * @param ttypedef The type definition
  */
-void t_java_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_java_generator::generate_typedef(t_typedef* ttypedef) {
+  (void) ttypedef;
+}
 
 /**
  * Enums are a class with a set of static constants.
@@ -585,6 +588,7 @@ void t_java_generator::print_const_value(std::ofstream& out, string name, t_type
 }
 
 string t_java_generator::render_const_value(ofstream& out, string name, t_type* type, t_const_value* value) {
+  (void) name;
   type = get_true_type(type);
   std::ostringstream render;
 
@@ -978,6 +982,7 @@ void t_java_generator::generate_get_field_desc(ofstream& out, t_struct* tstruct)
 }
 
 void t_java_generator::generate_get_struct_desc(ofstream& out, t_struct* tstruct) {
+  (void) tstruct;
   indent(out) << "@Override" << endl;
   indent(out) << "protected TStruct getStructDesc() {" << endl;
   indent(out) << "  return STRUCT_DESC;" << endl;
@@ -1013,6 +1018,7 @@ void t_java_generator::generate_union_comparisons(ofstream& out, t_struct* tstru
 }
 
 void t_java_generator::generate_union_hashcode(ofstream& out, t_struct* tstruct) {
+  (void) tstruct;
   if (gen_hash_code_) {
     indent(out) << "@Override" << endl;
     indent(out) << "public int hashCode() {" << endl;
@@ -1653,6 +1659,7 @@ void t_java_generator::generate_java_struct_result_writer(ofstream& out,
 }
 
 void t_java_generator::generate_java_struct_field_by_id(ofstream& out, t_struct* tstruct) {
+  (void) tstruct;
   indent(out) << "public _Fields fieldForId(int fieldId) {" << endl;
   indent(out) << "  return _Fields.findByThriftId(fieldId);" << endl;
   indent(out) << "}" << endl << endl;
@@ -2704,6 +2711,7 @@ void t_java_generator::generate_function_helpers(t_function* tfunction) {
  */
 void t_java_generator::generate_process_function(t_service* tservice,
                                                  t_function* tfunction) {
+  (void) tservice;
   // Open class
   indent(f_service_) <<
     "private class " << tfunction->get_name() << " implements ProcessFunction {" << endl;
@@ -3141,6 +3149,7 @@ void t_java_generator::generate_serialize_field(ofstream& out,
 void t_java_generator::generate_serialize_struct(ofstream& out,
                                                  t_struct* tstruct,
                                                  string prefix) {
+  (void) tstruct;
   out <<
     indent() << prefix << ".write(oprot);" << endl;
 }
@@ -3228,6 +3237,7 @@ void t_java_generator::generate_serialize_map_element(ofstream& out,
                                                       t_map* tmap,
                                                       string iter,
                                                       string map) {
+  (void) map;
   t_field kfield(tmap->get_key_type(), iter + ".getKey()");
   generate_serialize_field(out, &kfield, "");
   t_field vfield(tmap->get_val_type(), iter + ".getValue()");
@@ -3474,6 +3484,7 @@ string t_java_generator::argument_list(t_struct* tstruct, bool include_types) {
 }
 
 string t_java_generator::async_argument_list(t_function* tfunct, t_struct* tstruct, t_type* ttype, bool include_types) {
+  (void) ttype;
   string result = "";
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
@@ -3721,6 +3732,7 @@ void t_java_generator::generate_deep_copy_container(ofstream &out, std::string s
 }
 
 void t_java_generator::generate_deep_copy_non_container(ofstream& out, std::string source_name, std::string dest_name, t_type* type) {
+  (void) dest_name;
   if (type->is_base_type() || type->is_enum() || type->is_typedef()) {
     if (((t_base_type*)type)->is_binary()) {
       out << "TBaseHelper.copyBinary(" << source_name << ");" << endl;
index ff2d285..b390239 100644 (file)
@@ -44,6 +44,8 @@ class t_javame_generator : public t_oop_generator {
       const std::string& option_string)
     : t_oop_generator(program)
   {
+    (void) parsed_options;
+    (void) option_string;
     std::map<std::string, std::string>::const_iterator iter;
     out_dir_base_ = "gen-javame";
   }
@@ -313,7 +315,9 @@ void t_javame_generator::close_generator() {}
  *
  * @param ttypedef The type definition
  */
-void t_javame_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_javame_generator::generate_typedef(t_typedef* ttypedef) {
+  (void) ttypedef;
+}
 
 /**
  * Enums are a class with a set of static constants.
@@ -537,6 +541,7 @@ void t_javame_generator::print_const_value(std::ofstream& out, string name, t_ty
 }
 
 string t_javame_generator::render_const_value(ofstream& out, string name, t_type* type, t_const_value* value) {
+  (void) name;
   type = get_true_type(type);
   std::ostringstream render;
 
@@ -934,6 +939,7 @@ void t_javame_generator::generate_get_field_desc(ofstream& out, t_struct* tstruc
 }
 
 void t_javame_generator::generate_get_struct_desc(ofstream& out, t_struct* tstruct) {
+  (void) tstruct;
   indent(out) << "protected TStruct getStructDesc() {" << endl;
   indent(out) << "  return STRUCT_DESC;" << endl;
   indent(out) << "}" << endl;
@@ -967,6 +973,7 @@ void t_javame_generator::generate_union_comparisons(ofstream& out, t_struct* tst
 }
 
 void t_javame_generator::generate_union_hashcode(ofstream& out, t_struct* tstruct) {
+  (void) tstruct;
   indent(out) << "/**" << endl;
   indent(out) << " * If you'd like this to perform more respectably, use the hashcode generator option." << endl;
   indent(out) << " */" << endl;
@@ -1553,7 +1560,7 @@ void t_javame_generator::generate_reflection_setters(ostringstream& out, t_type*
 }
 
 void t_javame_generator::generate_generic_field_getters_setters(std::ofstream& out, t_struct* tstruct) {
-
+  (void) out;
   std::ostringstream getter_stream;
   std::ostringstream setter_stream;
 
@@ -2313,6 +2320,7 @@ void t_javame_generator::generate_function_helpers(t_function* tfunction) {
  */
 void t_javame_generator::generate_process_function(t_service* tservice,
                                                  t_function* tfunction) {
+  (void) tservice;
   // Open class
   indent(f_service_) <<
     "private class " << tfunction->get_name() << " implements ProcessFunction {" << endl;
@@ -2754,6 +2762,7 @@ void t_javame_generator::generate_serialize_field(ofstream& out,
 void t_javame_generator::generate_serialize_struct(ofstream& out,
                                                  t_struct* tstruct,
                                                  string prefix) {
+  (void) tstruct;
   out <<
     indent() << prefix << ".write(oprot);" << endl;
 }
@@ -2881,6 +2890,8 @@ void t_javame_generator::generate_serialize_list_element(ofstream& out,
  * @return Java type name, i.e. Vector
  */
 string t_javame_generator::type_name(t_type* ttype, bool in_container, bool in_init, bool skip_generic) {
+  (void) in_init;
+  (void) skip_generic;
   // In Java typedefs are just resolved to their real type
   ttype = get_true_type(ttype);
   string prefix;
index 921cbb4..bb1033c 100644 (file)
@@ -41,7 +41,8 @@ class t_js_generator : public t_oop_generator {
                 const std::map<std::string, std::string>& parsed_options,
                 const std::string& option_string) :
      t_oop_generator(program) {
-
+     (void) parsed_options;
+     (void) option_string;
      out_dir_base_ = "gen-js";
   }
 
@@ -262,7 +263,9 @@ void t_js_generator::close_generator() {
  *
  * @param ttypedef The type definition
  */
-void t_js_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_js_generator::generate_typedef(t_typedef* ttypedef) {
+  (void) ttypedef;
+}
 
 /**
  * Generates code for an enumerated type. Since define is expensive to lookup
@@ -642,7 +645,7 @@ void t_js_generator::generate_service(t_service* tservice) {
  * @param tservice The service to generate a server for.
  */
 void t_js_generator::generate_service_processor(t_service* tservice) {
-
+  (void) tservice;
 }
 
 /**
@@ -652,7 +655,8 @@ void t_js_generator::generate_service_processor(t_service* tservice) {
  */
 void t_js_generator::generate_process_function(t_service* tservice,
                                                  t_function* tfunction) {
-
+  (void) tservice;
+  (void) tfunction;
 }
 
 /**
@@ -705,14 +709,14 @@ void t_js_generator::generate_js_function_helpers(t_function* tfunction) {
  * @param tservice The service to generate a header definition for
  */
 void t_js_generator::generate_service_interface(t_service* tservice) {
-
+  (void) tservice;
 }
 
 /**
  * Generates a REST interface
  */
 void t_js_generator::generate_service_rest(t_service* tservice) {
-
+  (void) tservice;
 }
 
 /**
@@ -904,6 +908,7 @@ void t_js_generator::generate_deserialize_field(ofstream &out,
                                                   t_field* tfield,
                                                   string prefix,
                                                   bool inclass) {
+  (void) inclass;
   t_type* type = get_true_type(tfield->get_type());
 
   if (type->is_void()) {
@@ -1207,7 +1212,8 @@ void t_js_generator::generate_serialize_field(ofstream &out,
 void t_js_generator::generate_serialize_struct(ofstream &out,
                                                  t_struct* tstruct,
                                                  string prefix) {
-    indent(out) << prefix << ".write(output)" << endl;
+  (void) tstruct;
+  indent(out) << prefix << ".write(output)" << endl;
 }
 
 /**
index 5ed4a99..18a8072 100644 (file)
@@ -43,6 +43,8 @@ class t_ocaml_generator : public t_oop_generator {
       const std::string& option_string)
     : t_oop_generator(program)
   {
+    (void) parsed_options;
+    (void) option_string;
     out_dir_base_ = "gen-ocaml";
   }
 
@@ -1283,6 +1285,7 @@ void t_ocaml_generator::generate_service_server(t_service* tservice) {
  */
 void t_ocaml_generator::generate_process_function(t_service* tservice,
                                                t_function* tfunction) {
+  (void) tservice;
   // Open function
   indent(f_service_) <<
     "method private process_" << tfunction->get_name() <<
@@ -1624,6 +1627,7 @@ void t_ocaml_generator::generate_serialize_field(ofstream &out,
 void t_ocaml_generator::generate_serialize_struct(ofstream &out,
                                                t_struct* tstruct,
                                                string prefix) {
+  (void) tstruct;
   indent(out) << prefix << "#write(oprot)";
 }
 
index 33589c2..e1796dc 100644 (file)
@@ -43,6 +43,8 @@ class t_perl_generator : public t_oop_generator {
       const std::string& option_string)
     : t_oop_generator(program)
   {
+    (void) parsed_options;
+    (void) option_string;
     out_dir_base_ = "gen-perl";
     escape_['$'] = "\\$";
     escape_['@'] = "\\@";
@@ -291,7 +293,9 @@ void t_perl_generator::close_generator() {
  *
  * @param ttypedef The type definition
  */
-void t_perl_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_perl_generator::generate_typedef(t_typedef* ttypedef) {
+  (void) ttypedef;
+}
 
 /**
  * Generates code for an enumerated type. Since define is expensive to lookup
@@ -1254,6 +1258,7 @@ void t_perl_generator::generate_deserialize_field(ofstream &out,
                                                   t_field* tfield,
                                                   string prefix,
                                                   bool inclass) {
+  (void) inclass;
   t_type* type = get_true_type(tfield->get_type());
 
   if (type->is_void()) {
@@ -1556,7 +1561,8 @@ void t_perl_generator::generate_serialize_field(ofstream &out,
 void t_perl_generator::generate_serialize_struct(ofstream &out,
                                                  t_struct* tstruct,
                                                  string prefix) {
-    indent(out) <<
+  (void) tstruct;
+  indent(out) <<
       "$xfer += $" << prefix << "->write($output);" << endl;
 }
 
index 200d89a..d1b33a9 100644 (file)
@@ -42,6 +42,7 @@ class t_php_generator : public t_oop_generator {
       const std::string& option_string)
     : t_oop_generator(program)
   {
+    (void) option_string;
     std::map<std::string, std::string>::const_iterator iter;
 
     iter = parsed_options.find("inlined");
@@ -317,7 +318,9 @@ void t_php_generator::close_generator() {
  *
  * @param ttypedef The type definition
  */
-void t_php_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_php_generator::generate_typedef(t_typedef* ttypedef) {
+  (void) ttypedef;
+}
 
 /**
  * Generates code for an enumerated type. Since define is expensive to lookup
@@ -2018,6 +2021,7 @@ void t_php_generator::generate_serialize_field(ofstream &out,
 void t_php_generator::generate_serialize_struct(ofstream &out,
                                                 t_struct* tstruct,
                                                 string prefix) {
+  (void) tstruct;
   indent(out) <<
     "$xfer += $" << prefix << "->write($output);" << endl;
 }
index bdd0c29..cb1950f 100644 (file)
@@ -44,6 +44,7 @@ class t_py_generator : public t_generator {
       const std::string& option_string)
     : t_generator(program)
   {
+    (void) option_string;
     std::map<std::string, std::string>::const_iterator iter;
 
     iter = parsed_options.find("new_style");
@@ -365,7 +366,9 @@ void t_py_generator::close_generator() {
  *
  * @param ttypedef The type definition
  */
-void t_py_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_py_generator::generate_typedef(t_typedef* ttypedef) {
+  (void) ttypedef;
+}
 
 /**
  * Generates code for an enumerated type. Done using a class to scope
@@ -562,7 +565,7 @@ void t_py_generator::generate_py_struct_definition(ofstream& out,
                                                    t_struct* tstruct,
                                                    bool is_exception,
                                                    bool is_result) {
-
+  (void) is_result;
   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;
@@ -1572,6 +1575,7 @@ void t_py_generator::generate_service_server(t_service* tservice) {
  */
 void t_py_generator::generate_process_function(t_service* tservice,
                                                t_function* tfunction) {
+  (void) tservice;
   // Open function
   indent(f_service_) <<
     "def process_" << tfunction->get_name() <<
@@ -1767,6 +1771,7 @@ void t_py_generator::generate_deserialize_field(ofstream &out,
                                                 t_field* tfield,
                                                 string prefix,
                                                 bool inclass) {
+  (void) inclass;
   t_type* type = get_true_type(tfield->get_type());
 
   if (type->is_void()) {
@@ -2040,6 +2045,7 @@ void t_py_generator::generate_serialize_field(ofstream &out,
 void t_py_generator::generate_serialize_struct(ofstream &out,
                                                t_struct* tstruct,
                                                string prefix) {
+  (void) tstruct;
   indent(out) <<
     prefix << ".write(oprot)" << endl;
 }
index 770f8e7..c9db29a 100644 (file)
@@ -49,6 +49,8 @@ class t_rb_generator : public t_oop_generator {
       const std::string& option_string)
     : t_oop_generator(program)
   {
+    (void) parsed_options;
+    (void) option_string;
     out_dir_base_ = "gen-rb";
   }
 
@@ -282,7 +284,9 @@ void t_rb_generator::close_generator() {
  *
  * @param ttypedef The type definition
  */
-void t_rb_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_rb_generator::generate_typedef(t_typedef* ttypedef) {
+  (void) ttypedef;
+}
 
 /**
  * Generates code for an enumerated type. Done using a class to scope
@@ -511,6 +515,7 @@ void t_rb_generator::generate_rb_struct(std::ofstream& out, t_struct* tstruct, b
  * Generates a ruby union
  */
 void t_rb_generator::generate_rb_union(std::ofstream& out, t_struct* tstruct, bool is_exception = false) {
+  (void) is_exception;
   generate_rdoc(out, tstruct);
   indent(out) << "class " << type_name(tstruct) << " < ::Thrift::Union" << endl;
 
@@ -933,6 +938,7 @@ void t_rb_generator::generate_service_server(t_service* tservice) {
  */
 void t_rb_generator::generate_process_function(t_service* tservice,
                                                t_function* tfunction) {
+  (void) tservice;
   // Open function
   indent(f_service_) <<
     "def process_" << tfunction->get_name() <<
index fd8f035..6ca3701 100644 (file)
@@ -49,6 +49,8 @@ class t_st_generator : public t_oop_generator {
       const std::string& option_string)
     : t_oop_generator(program)
   {
+    (void) parsed_options;
+    (void) option_string;
     out_dir_base_ = "gen-st";
   }
 
@@ -240,7 +242,9 @@ string t_st_generator::generated_category() {
  *
  * @param ttypedef The type definition
  */
-void t_st_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_st_generator::generate_typedef(t_typedef* ttypedef) {
+  (void) ttypedef;
+}
 
 void t_st_generator::st_class_def(std::ofstream &out, string name) {
   out << "Object subclass: #" << prefix(name) << endl;
index c343b9a..923ec70 100644 (file)
@@ -41,6 +41,8 @@ class t_xsd_generator : public t_generator {
       const std::string& option_string)
     : t_generator(program)
   {
+    (void) parsed_options;
+    (void) option_string;
     out_dir_base_ = "gen-xsd";
   }
 
@@ -58,7 +60,9 @@ class t_xsd_generator : public t_generator {
    */
 
   void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum) {}
+  void generate_enum(t_enum* tenum) {
+    (void) tenum;
+  }
 
   void generate_service(t_service* tservice);
   void generate_struct(t_struct* tstruct);
index 17ac818..a6229f4 100644 (file)
@@ -25,6 +25,9 @@
 
 %{
 
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Wunused-label"
+
 #include <string>
 #include <errno.h>
 
index 16b46df..cf4f3b8 100644 (file)
@@ -44,42 +44,69 @@ class TProcessorEventHandler {
    * The return value is passed to all other callbacks
    * for that function invocation.
    */
-  virtual void* getContext(const char* fn_name, void* serverContext) { return NULL; }
+  virtual void* getContext(const char* fn_name, void* serverContext) {
+    (void) fn_name;
+    (void) serverContext;
+    return NULL;
+  }
 
   /**
    * Expected to free resources associated with a context.
    */
-  virtual void freeContext(void* ctx, const char* fn_name) { }
+  virtual void freeContext(void* ctx, const char* fn_name) {
+    (void) ctx;
+    (void) fn_name;
+  }
 
   /**
    * Called before reading arguments.
    */
-  virtual void preRead(void* ctx, const char* fn_name) {}
+  virtual void preRead(void* ctx, const char* fn_name) {
+    (void) ctx;
+    (void) fn_name;
+  }
 
   /**
    * Called between reading arguments and calling the handler.
    */
-  virtual void postRead(void* ctx, const char* fn_name, uint32_t bytes) {}
+  virtual void postRead(void* ctx, const char* fn_name, uint32_t bytes) {
+    (void) ctx;
+    (void) fn_name;
+    (void) bytes;
+  }
 
   /**
    * Called between calling the handler and writing the response.
    */
-  virtual void preWrite(void* ctx, const char* fn_name) {}
+  virtual void preWrite(void* ctx, const char* fn_name) {
+    (void) ctx;
+    (void) fn_name;
+  }
 
   /**
    * Called after writing the response.
    */
-  virtual void postWrite(void* ctx, const char* fn_name, uint32_t bytes) {}
+  virtual void postWrite(void* ctx, const char* fn_name, uint32_t bytes) {
+    (void) ctx;
+    (void) fn_name;
+    (void) bytes;
+  }
 
   /**
    * Called when an async function call completes successfully.
    */
-  virtual void asyncComplete(void* ctx, const char* fn_name) {}
+  virtual void asyncComplete(void* ctx, const char* fn_name) {
+    (void) ctx;
+    (void) fn_name;
+  }
 
   /**
    * Called if the handler throws an undeclared exception.
    */
-  virtual void handlerError(void* ctx, const char* fn_name) {}
+  virtual void handlerError(void* ctx, const char* fn_name) {
+    (void) ctx;
+    (void) fn_name;
+  }
 
  protected:
   TProcessorEventHandler() {}
index 05d504b..eaa86e0 100644 (file)
@@ -43,6 +43,7 @@ void TAsyncProtocolProcessor::process(
     std::tr1::function<void(bool healthy)> _return,
     boost::shared_ptr<TProtocol> oprot,
     bool healthy) {
+  (void) oprot;
   // This is a stub function to hold a reference to oprot.
   return _return(healthy);
 }
index a65394b..f7b2690 100644 (file)
@@ -68,7 +68,7 @@ class ThreadManager::Impl : public ThreadManager  {
 
   void join() { stopImpl(true); }
 
-  const ThreadManager::STATE state() const {
+  ThreadManager::STATE state() const {
     return state_;
   }
 
@@ -492,6 +492,7 @@ void ThreadManager::Impl::removeWorker(size_t value) {
   }
 
 void ThreadManager::Impl::remove(shared_ptr<Runnable> task) {
+  (void) task;
   Synchronized s(monitor_);
   if (state_ != ThreadManager::STARTED) {
     throw IllegalStateException();
index 95c4906..6d7b0ef 100644 (file)
@@ -93,7 +93,7 @@ class ThreadManager {
     STOPPED
   };
 
-  virtual const STATE state() const = 0;
+  virtual STATE state() const = 0;
 
   virtual boost::shared_ptr<ThreadFactory> threadFactory() const = 0;
 
index 10eabda..f7acd0a 100644 (file)
@@ -271,13 +271,14 @@ void TimerManager::add(shared_ptr<Runnable> task, const struct timespec& value)
 
 
 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
 
index dfbf0ea..d905ddb 100644 (file)
@@ -99,7 +99,7 @@ class TimerManager {
     STOPPED
   };
 
-  virtual const STATE state() const;
+  virtual STATE state() const;
 
  private:
   boost::shared_ptr<const ThreadFactory> threadFactory_;
index ac2a460..af23449 100644 (file)
@@ -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)
index 18a221d..c6bd25e 100644 (file)
@@ -68,7 +68,7 @@ class Util {
     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 @@ class Util {
   /**
    * 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 @@ class Util {
   /**
    * 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 @@ class Util {
   /**
    * 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 @@ class Util {
   /**
    * 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 @@ class Util {
   /**
    * 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
index e4f98a9..c1dc89d 100644 (file)
@@ -308,6 +308,7 @@ public:
   };
 
   void foo(PosixThreadFactory *tf) {
+    (void) tf;
   }
 
   bool floodNTest(size_t loop=1, size_t count=100000) {
index 129a9a2..b6b5c3e 100644 (file)
@@ -235,7 +235,7 @@ public:
    * 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 {
index 076975b..9a9b672 100644 (file)
@@ -107,14 +107,18 @@ bool PeekProcessor::process(boost::shared_ptr<TProtocol> in,
 }
 
 void PeekProcessor::peekName(const std::string& fname) {
+  (void) fname;
 }
 
 void PeekProcessor::peekBuffer(uint8_t* buffer, uint32_t size) {
+  (void) buffer;
+  (void) size;
 }
 
 void PeekProcessor::peek(boost::shared_ptr<TProtocol> in,
                          TType ftype,
                          int16_t fid) {
+  (void) fid;
   in->skip(ftype);
 }
 
index 0f1c34a..3d93348 100644 (file)
@@ -54,6 +54,7 @@ uint32_t TBinaryProtocolT<Transport_>::writeMessageEnd() {
 
 template <class Transport_>
 uint32_t TBinaryProtocolT<Transport_>::writeStructBegin(const char* name) {
+  (void) name;
   return 0;
 }
 
@@ -66,6 +67,7 @@ template <class Transport_>
 uint32_t TBinaryProtocolT<Transport_>::writeFieldBegin(const char* name,
                                                        const TType fieldType,
                                                        const int16_t fieldId) {
+  (void) name;
   uint32_t wsize = 0;
   wsize += writeByte((int8_t)fieldType);
   wsize += writeI16(fieldId);
@@ -244,6 +246,7 @@ template <class Transport_>
 uint32_t TBinaryProtocolT<Transport_>::readFieldBegin(std::string& name,
                                                       TType& fieldType,
                                                       int16_t& fieldId) {
+  (void) name;
   uint32_t result = 0;
   int8_t type;
   result += readByte(type);
index ed9c281..55b784f 100644 (file)
@@ -131,6 +131,7 @@ uint32_t TCompactProtocolT<Transport_>::writeFieldStop() {
  */
 template <class Transport_>
 uint32_t TCompactProtocolT<Transport_>::writeStructBegin(const char* name) {
+  (void) name;
   lastField_.push(lastFieldId_);
   lastFieldId_ = 0;
   return 0;
@@ -286,6 +287,7 @@ int32_t TCompactProtocolT<Transport_>::writeFieldBeginInternal(
     const TType fieldType,
     const int16_t fieldId,
     int8_t typeOverride) {
+  (void) name;
   uint32_t wsize = 0;
 
   // if there's a type override, use that.
@@ -455,6 +457,7 @@ template <class Transport_>
 uint32_t TCompactProtocolT<Transport_>::readFieldBegin(std::string& name,
                                                        TType& fieldType,
                                                        int16_t& fieldId) {
+  (void) name;
   uint32_t rsize = 0;
   int8_t byte;
   int8_t type;
index ee82e71..28e175b 100644 (file)
@@ -148,6 +148,7 @@ uint32_t TDebugProtocol::writeItem(const std::string& str) {
 uint32_t TDebugProtocol::writeMessageBegin(const std::string& name,
                                            const TMessageType messageType,
                                            const int32_t seqid) {
+  (void) seqid;
   string mtype;
   switch (messageType) {
     case T_CALL      : mtype = "call"   ; break;
index b9a3d1f..86e5e28 100644 (file)
@@ -281,6 +281,7 @@ uint32_t TDenseProtocol::writeMessageEnd() {
 }
 
 uint32_t TDenseProtocol::writeStructBegin(const char* name) {
+  (void) name;
   uint32_t xfer = 0;
 
   // The TypeSpec stack should be empty if this is the top-level read/write.
@@ -314,6 +315,7 @@ uint32_t TDenseProtocol::writeStructEnd() {
 uint32_t TDenseProtocol::writeFieldBegin(const char* name,
                                          const TType fieldType,
                                          const int16_t fieldId) {
+  (void) name;
   uint32_t xfer = 0;
 
   // Skip over optional fields.
@@ -507,6 +509,7 @@ uint32_t TDenseProtocol::readMessageEnd() {
 }
 
 uint32_t TDenseProtocol::readStructBegin(string& name) {
+  (void) name;
   uint32_t xfer = 0;
 
   if (ts_stack_.empty()) {
@@ -544,6 +547,7 @@ uint32_t TDenseProtocol::readStructEnd() {
 uint32_t TDenseProtocol::readFieldBegin(string& name,
                                         TType& fieldType,
                                         int16_t& fieldId) {
+  (void) name;
   uint32_t xfer = 0;
 
   // For optional fields, check to see if they are there.
index 5b0b18d..d038df4 100644 (file)
@@ -255,6 +255,7 @@ class TJSONContext {
    * Write context data to the transport. Default is to do nothing.
    */
   virtual uint32_t write(TTransport &trans) {
+    (void) trans;
     return 0;
   };
 
@@ -262,6 +263,7 @@ class TJSONContext {
    * Read context data from the transport. Default is to do nothing.
    */
   virtual uint32_t read(TJSONProtocol::LookaheadReader &reader) {
+    (void) reader;
     return 0;
   };
 
@@ -561,6 +563,7 @@ uint32_t TJSONProtocol::writeMessageEnd() {
 }
 
 uint32_t TJSONProtocol::writeStructBegin(const char* name) {
+  (void) name;
   return writeJSONObjectStart();
 }
 
@@ -571,6 +574,7 @@ uint32_t TJSONProtocol::writeStructEnd() {
 uint32_t TJSONProtocol::writeFieldBegin(const char* name,
                                         const TType fieldType,
                                         const int16_t fieldId) {
+  (void) name;
   uint32_t result = writeJSONInteger(fieldId);
   result += writeJSONObjectStart();
   result += writeJSONString(getTypeNameForTypeID(fieldType));
@@ -874,6 +878,7 @@ uint32_t TJSONProtocol::readMessageEnd() {
 }
 
 uint32_t TJSONProtocol::readStructBegin(std::string& name) {
+  (void) name;
   return readJSONObjectStart();
 }
 
@@ -884,6 +889,7 @@ uint32_t TJSONProtocol::readStructEnd() {
 uint32_t TJSONProtocol::readFieldBegin(std::string& name,
                                        TType& fieldType,
                                        int16_t& fieldId) {
+  (void) name;
   uint32_t result = 0;
   // Check if we hit the end of the list
   uint8_t ch = reader_.peek();
index 9133dbe..6c7f519 100644 (file)
@@ -42,6 +42,9 @@ class TProtocolDefaults : public TProtocol {
   uint32_t readMessageBegin(std::string& name,
                             TMessageType& messageType,
                             int32_t& seqid) {
+    (void) name;
+    (void) messageType;
+    (void) seqid;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
@@ -52,6 +55,7 @@ class TProtocolDefaults : public TProtocol {
   }
 
   uint32_t readStructBegin(std::string& name) {
+    (void) name;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
@@ -64,6 +68,9 @@ class TProtocolDefaults : public TProtocol {
   uint32_t readFieldBegin(std::string& name,
                           TType& fieldType,
                           int16_t& fieldId) {
+    (void) name;
+    (void) fieldType;
+    (void) fieldId;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
@@ -74,6 +81,9 @@ class TProtocolDefaults : public TProtocol {
   }
 
   uint32_t readMapBegin(TType& keyType, TType& valType, uint32_t& size) {
+    (void) keyType;
+    (void) valType;
+    (void) size;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
@@ -84,6 +94,8 @@ class TProtocolDefaults : public TProtocol {
   }
 
   uint32_t readListBegin(TType& elemType, uint32_t& size) {
+    (void) elemType;
+    (void) size;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
@@ -94,6 +106,8 @@ class TProtocolDefaults : public TProtocol {
   }
 
   uint32_t readSetBegin(TType& elemType, uint32_t& size) {
+    (void) elemType;
+    (void) size;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
@@ -104,46 +118,55 @@ class TProtocolDefaults : public TProtocol {
   }
 
   uint32_t readBool(bool& value) {
+    (void) value;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
 
   uint32_t readBool(std::vector<bool>::reference value) {
+    (void) value;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
 
   uint32_t readByte(int8_t& byte) {
+    (void) byte;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
 
   uint32_t readI16(int16_t& i16) {
+    (void) i16;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
 
   uint32_t readI32(int32_t& i32) {
+    (void) i32;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
 
   uint32_t readI64(int64_t& i64) {
+    (void) i64;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
 
   uint32_t readDouble(double& dub) {
+    (void) dub;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
 
   uint32_t readString(std::string& str) {
+    (void) str;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
 
   uint32_t readBinary(std::string& str) {
+    (void) str;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support reading (yet).");
   }
@@ -151,6 +174,9 @@ class TProtocolDefaults : public TProtocol {
   uint32_t writeMessageBegin(const std::string& name,
                              const TMessageType messageType,
                              const int32_t seqid) {
+    (void) name;
+    (void) messageType;
+    (void) seqid;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support writing (yet).");
   }
@@ -162,6 +188,7 @@ class TProtocolDefaults : public TProtocol {
 
 
   uint32_t writeStructBegin(const char* name) {
+    (void) name;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support writing (yet).");
   }
@@ -174,6 +201,9 @@ class TProtocolDefaults : public TProtocol {
   uint32_t writeFieldBegin(const char* name,
                            const TType fieldType,
                            const int16_t fieldId) {
+    (void) name;
+    (void) fieldType;
+    (void) fieldId;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support writing (yet).");
   }
@@ -191,6 +221,9 @@ class TProtocolDefaults : public TProtocol {
   uint32_t writeMapBegin(const TType keyType,
                          const TType valType,
                          const uint32_t size) {
+    (void) keyType;
+    (void) valType;
+    (void) size;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support writing (yet).");
   }
@@ -201,6 +234,8 @@ class TProtocolDefaults : public TProtocol {
   }
 
   uint32_t writeListBegin(const TType elemType, const uint32_t size) {
+    (void) elemType;
+    (void) size;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support writing (yet).");
   }
@@ -211,6 +246,8 @@ class TProtocolDefaults : public TProtocol {
   }
 
   uint32_t writeSetBegin(const TType elemType, const uint32_t size) {
+    (void) elemType;
+    (void) size;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support writing (yet).");
   }
@@ -221,41 +258,49 @@ class TProtocolDefaults : public TProtocol {
   }
 
   uint32_t writeBool(const bool value) {
+    (void) value;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support writing (yet).");
   }
 
   uint32_t writeByte(const int8_t byte) {
+    (void) byte;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support writing (yet).");
   }
 
   uint32_t writeI16(const int16_t i16) {
+    (void) i16;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support writing (yet).");
   }
 
   uint32_t writeI32(const int32_t i32) {
+    (void) i32;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support writing (yet).");
   }
 
   uint32_t writeI64(const int64_t i64) {
+    (void) i64;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support writing (yet).");
   }
 
   uint32_t writeDouble(const double dub) {
+    (void) dub;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support writing (yet).");
   }
 
   uint32_t writeString(const std::string& str) {
+    (void) str;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support writing (yet).");
   }
 
   uint32_t writeBinary(const std::string& str) {
+    (void) str;
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
                              "this protocol does not support writing (yet).");
   }
index 8f5a9f3..69ae235 100644 (file)
@@ -602,6 +602,7 @@ void TNonblockingServer::returnConnection(TConnection* connection) {
  * connections on fd and assign TConnection objects to handle those requests.
  */
 void TNonblockingServer::handleEvent(int fd, short which) {
+  (void) which;
   // Make sure that libevent didn't mess up the socket handles
   assert(fd == serverSocket_);
 
index fa70531..52920c2 100644 (file)
@@ -109,6 +109,8 @@ void TBufferedTransport::writeSlow(const uint8_t* buf, uint32_t len) {
 }
 
 const uint8_t* TBufferedTransport::borrowSlow(uint8_t* buf, uint32_t* len) {
+  (void) buf;
+  (void) len;
   // Simply return NULL.  We don't know if there is actually data available on
   // the underlying transport, so calling read() might block.
   return NULL;
@@ -262,6 +264,8 @@ uint32_t TFramedTransport::writeEnd() {
 }
 
 const uint8_t* TFramedTransport::borrowSlow(uint8_t* buf, uint32_t* len) {
+  (void) buf;
+  (void) len;
   // Don't try to be clever with shifting buffers.
   // If the fast path failed let the protocol use its slow path.
   // Besides, who is going to try to borrow across messages?
@@ -364,6 +368,7 @@ void TMemoryBuffer::wroteBytes(uint32_t len) {
 }
 
 const uint8_t* TMemoryBuffer::borrowSlow(uint8_t* buf, uint32_t* len) {
+  (void) buf;
   rBound_ = wBase_;
   if (available_read() >= *len) {
     *len = available_read();
index 400597e..604df0d 100644 (file)
@@ -64,7 +64,7 @@ bool THttpClient::parseStatusLine(char* status) {
   }
 
   *code = '\0';
-  while (*(code++) == ' ');
+  while (*(code++) == ' ') {};
 
   char* msg = strchr(code, ' ');
   if (msg == NULL) {
index 3ed869a..166c0f6 100644 (file)
@@ -61,7 +61,7 @@ bool THttpServer::parseStatusLine(char* status) {
   }
 
   *path = '\0';
-  while (*(++path) == ' ');
+  while (*(++path) == ' ') {};
 
   char* http = strchr(path, ' ');
   if (http == NULL) {
index 881150d..be65288 100644 (file)
@@ -313,6 +313,7 @@ void TZlibTransport::flushToZlib(const uint8_t* buf, int len, int flush) {
 }
 
 const uint8_t* TZlibTransport::borrow(uint8_t* buf, uint32_t* len) {
+  (void) buf;
   // Don't try to be clever with shifting buffers.
   // If we have enough data, give a pointer to it,
   // otherwise let the protcol use its slow path.
index db29ccc..8fec7f5 100644 (file)
@@ -31,6 +31,8 @@ using namespace apache::thrift::transport;
 char errorMessage[ERR_LEN];
 
 int main(int argc, char** argv) {
+  (void) argc;
+  (void) argv;
   try {
     testProtocol<TBinaryProtocol>("TBinaryProtocol");
     testProtocol<TCompactProtocol>("TCompactProtocol");
index e68c544..c89db74 100644 (file)
@@ -25,6 +25,7 @@
 namespace thrift { namespace test { namespace debug {
 
 bool Empty::operator<(Empty const& other) const {
+  (void) other;
   // It is empty, so all are equal.
   return false;
 }
index 98fd18d..6260094 100644 (file)
@@ -70,6 +70,7 @@ class FsyncLog {
   FsyncLog() {}
 
   void fsync(int fd) {
+    (void) fd;
     FsyncCall call;
     gettimeofday(&call.time, NULL);
     calls_.push_back(call);
index 46a89a7..d12e384 100644 (file)
@@ -341,6 +341,7 @@ unsigned int numTriggersFired;
 void set_alarm();
 
 void alarm_handler(int signum) {
+  (void) signum;
   // The alarm timed out, which almost certainly means we're stuck
   // on a transport that is incorrectly blocked.
   ++numTriggersFired;