THRIFT-1165 Missing parameter names for C++ oneway stubs
authorRoger Meier <roger@apache.org>
Tue, 31 May 2011 20:33:51 +0000 (20:33 +0000)
committerRoger Meier <roger@apache.org>
Tue, 31 May 2011 20:33:51 +0000 (20:33 +0000)
Patch: David Nadlinger

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1129907 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_cpp_generator.cc

index 298dd8c..8fb3e64 100644 (file)
@@ -929,7 +929,7 @@ void t_cpp_generator::generate_struct_definition(ofstream& out,
         indent() <<
         indent() << "__isset." << (*m_iter)->get_name() << " = true;" << endl;
     }
-    out << 
+    out <<
       indent()<< "}" << endl;
   }
   out << endl;
@@ -2827,13 +2827,15 @@ void t_cpp_generator::generate_process_function(t_service* tservice,
       out <<
         indent() << "template <class Protocol_>" << endl;
     }
+    const bool unnamed_oprot_seqid = tfunction->is_oneway() &&
+      !(gen_templates_ && !specialized);
     out <<
       "void " << tservice->get_name() << "Processor" << class_suffix << "::" <<
       "process_" << tfunction->get_name() << "(" <<
-      "int32_t" << (tfunction->is_oneway() ? ", " : " seqid, ") <<
+      "int32_t" << (unnamed_oprot_seqid ? ", " : " seqid, ") <<
       prot_type << "* iprot, " <<
-      prot_type << "*" << (tfunction->is_oneway() ? ", " : " oprot, ")
-      << "void* callContext)" << endl;
+      prot_type << "*" << (unnamed_oprot_seqid ? ", " : " oprot, ") <<
+      "void* callContext)" << endl;
     scope_up(out);
 
     if (gen_templates_ && !specialized) {