summaryrefslogtreecommitdiff
path: root/compiler/cpp
diff options
context:
space:
mode:
authorRoger Meier <roger@apache.org>2011-07-17 18:55:59 +0000
committerRoger Meier <roger@apache.org>2011-07-17 18:55:59 +0000
commita8cef6e55bcbcf7045adbc3ccca5e59e7c504f6b (patch)
treec8d2031ab3cf019f162d681c64ea6483b494bab4 /compiler/cpp
parent1e20e9f589f7a79b1e355c75fb66b44cdf512fc4 (diff)
downloadthrift-a8cef6e55bcbcf7045adbc3ccca5e59e7c504f6b.tar.gz
THRIFT-916 gcc warnings in c++ header files
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1147700 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'compiler/cpp')
-rw-r--r--compiler/cpp/src/generate/t_as3_generator.cc1
-rwxr-xr-xcompiler/cpp/src/generate/t_cpp_generator.cc8
-rwxr-xr-x[-rw-r--r--]compiler/cpp/src/generate/t_go_generator.cc13
-rw-r--r--compiler/cpp/src/generate/t_java_generator.cc1
4 files changed, 20 insertions, 3 deletions
diff --git a/compiler/cpp/src/generate/t_as3_generator.cc b/compiler/cpp/src/generate/t_as3_generator.cc
index cebb07840..05514f152 100644
--- a/compiler/cpp/src/generate/t_as3_generator.cc
+++ b/compiler/cpp/src/generate/t_as3_generator.cc
@@ -769,7 +769,6 @@ void t_as3_generator::generate_as3_struct_definition(ofstream &out,
"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;
diff --git a/compiler/cpp/src/generate/t_cpp_generator.cc b/compiler/cpp/src/generate/t_cpp_generator.cc
index 389bbf900..6b1f60774 100755
--- a/compiler/cpp/src/generate/t_cpp_generator.cc
+++ b/compiler/cpp/src/generate/t_cpp_generator.cc
@@ -3007,6 +3007,12 @@ void t_cpp_generator::generate_process_function(t_service* tservice,
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_signature(t_function* tfunction,
? "()"
: ("(" + 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";
diff --git a/compiler/cpp/src/generate/t_go_generator.cc b/compiler/cpp/src/generate/t_go_generator.cc
index fe34bb757..6b2efc8ac 100644..100755
--- a/compiler/cpp/src/generate/t_go_generator.cc
+++ b/compiler/cpp/src/generate/t_go_generator.cc
@@ -46,6 +46,8 @@ class t_go_generator : public t_generator {
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_definition(ofstream& out,
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_reader(ofstream& out,
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_deserialize_field(ofstream &out,
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_deserialize_struct(ofstream &out,
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_deserialize_map_element(ofstream &out,
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_deserialize_set_element(ofstream &out,
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_deserialize_list_element(ofstream &out,
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(t_type* ttype) {
}
-THRIFT_REGISTER_GENERATOR(go, "Go", "");
+THRIFT_REGISTER_GENERATOR(go, "Go", "")
diff --git a/compiler/cpp/src/generate/t_java_generator.cc b/compiler/cpp/src/generate/t_java_generator.cc
index 04aaa4063..1b5517261 100644
--- a/compiler/cpp/src/generate/t_java_generator.cc
+++ b/compiler/cpp/src/generate/t_java_generator.cc
@@ -3875,6 +3875,7 @@ void t_java_generator::generate_java_struct_clear(std::ofstream& out, t_struct*
// 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;