This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git
commit 0140cbf5674c5573d142c95c182f4ba98de99769 Author: cyy <cyye...@outlook.com> AuthorDate: Sun Jan 6 11:21:10 2019 +0800 remove unused variables --- compiler/cpp/src/thrift/generate/t_erl_generator.cc | 2 -- compiler/cpp/src/thrift/generate/t_go_generator.cc | 3 --- compiler/cpp/src/thrift/generate/t_hs_generator.cc | 4 ---- compiler/cpp/src/thrift/generate/t_py_generator.cc | 2 -- lib/c_glib/test/testbufferedtransport.c | 3 --- lib/c_glib/test/testframedtransport.c | 3 --- lib/c_glib/test/testtransportsocket.c | 3 --- lib/cpp/src/thrift/protocol/TJSONProtocol.cpp | 1 - 8 files changed, 21 deletions(-) diff --git a/compiler/cpp/src/thrift/generate/t_erl_generator.cc b/compiler/cpp/src/thrift/generate/t_erl_generator.cc index 587133f..12d91a7 100644 --- a/compiler/cpp/src/thrift/generate/t_erl_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_erl_generator.cc @@ -415,7 +415,6 @@ const std::string emit_double_as_string(const double value) { } void t_erl_generator::generate_type_metadata(std::string function_name, vector<string> names) { - vector<string>::iterator s_iter; size_t num_structs = names.size(); indent(f_types_file_) << function_name << "() ->\n"; @@ -947,7 +946,6 @@ void t_erl_generator::generate_service(t_service* tservice) { void t_erl_generator::generate_service_metadata(t_service* tservice) { export_string("function_names", 0); vector<t_function*> functions = tservice->get_functions(); - vector<t_function*>::iterator f_iter; size_t num_functions = functions.size(); indent(f_service_) << "function_names() -> " << endl; diff --git a/compiler/cpp/src/thrift/generate/t_go_generator.cc b/compiler/cpp/src/thrift/generate/t_go_generator.cc index 5ada4fa..ec16b87 100644 --- a/compiler/cpp/src/thrift/generate/t_go_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_go_generator.cc @@ -2153,7 +2153,6 @@ void t_go_generator::generate_service_remote(t_service* tservice) { << (*f_iter)->get_name() << "("; t_struct* arg_struct = (*f_iter)->get_arglist(); const std::vector<t_field*>& args = arg_struct->get_members(); - vector<t_field*>::const_iterator a_iter; std::vector<t_field*>::size_type num_args = args.size(); bool first = true; @@ -2308,7 +2307,6 @@ void t_go_generator::generate_service_remote(t_service* tservice) { for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) { t_struct* arg_struct = (*f_iter)->get_arglist(); const std::vector<t_field*>& args = arg_struct->get_members(); - vector<t_field*>::const_iterator a_iter; std::vector<t_field*>::size_type num_args = args.size(); string funcName((*f_iter)->get_name()); string pubName(publicize(funcName)); @@ -2693,7 +2691,6 @@ void t_go_generator::generate_process_function(t_service* tservice, t_function* // t_struct* xs = tfunction->get_xceptions(); // const std::vector<t_field*>& xceptions = xs->get_members(); - vector<t_field*>::const_iterator x_iter; f_types_ << indent() << "type " << processorName << " struct {" << endl; f_types_ << indent() << " handler " << publicize(tservice->get_name()) << endl; f_types_ << indent() << "}" << endl << endl; diff --git a/compiler/cpp/src/thrift/generate/t_hs_generator.cc b/compiler/cpp/src/thrift/generate/t_hs_generator.cc index ce7cd0c..8f6d4b0 100644 --- a/compiler/cpp/src/thrift/generate/t_hs_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_hs_generator.cc @@ -590,7 +590,6 @@ void t_hs_generator::generate_hs_struct_arbitrary(ostream& out, t_struct* tstruc string tname = type_name(tstruct); string name = tstruct->get_name(); const vector<t_field*>& members = tstruct->get_members(); - vector<t_field*>::const_iterator m_iter; indent(out) << "instance QC.Arbitrary " << tname << " where " << endl; indent_up(); @@ -654,7 +653,6 @@ void t_hs_generator::generate_hs_struct_arbitrary(ostream& out, t_struct* tstruc */ void t_hs_generator::generate_hs_struct_reader(ostream& out, t_struct* tstruct) { const vector<t_field*>& fields = tstruct->get_members(); - vector<t_field*>::const_iterator f_iter; string sname = type_name(tstruct); string id = tmp("_id"); @@ -725,7 +723,6 @@ void t_hs_generator::generate_hs_struct_reader(ostream& out, t_struct* tstruct) void t_hs_generator::generate_hs_struct_writer(ostream& out, t_struct* tstruct) { string name = type_name(tstruct); const vector<t_field*>& fields = tstruct->get_sorted_members(); - vector<t_field*>::const_iterator f_iter; string str = tmp("_str"); string f = tmp("_f"); string v = tmp("_v"); @@ -909,7 +906,6 @@ void t_hs_generator::generate_hs_function_helpers(t_function* tfunction) { void t_hs_generator::generate_hs_typemap(ostream& out, t_struct* tstruct) { string name = type_name(tstruct); const vector<t_field*>& fields = tstruct->get_sorted_members(); - vector<t_field*>::const_iterator f_iter; indent(out) << "typemap_" << name << " :: T.TypeMap" << endl; indent(out) << "typemap_" << name << " = Map.fromList ["; diff --git a/compiler/cpp/src/thrift/generate/t_py_generator.cc b/compiler/cpp/src/thrift/generate/t_py_generator.cc index f0a153c..e46207a 100644 --- a/compiler/cpp/src/thrift/generate/t_py_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_py_generator.cc @@ -1624,7 +1624,6 @@ void t_py_generator::generate_service_remote(t_service* tservice) { << (*f_iter)->get_name() << "("; t_struct* arg_struct = (*f_iter)->get_arglist(); const std::vector<t_field*>& args = arg_struct->get_members(); - vector<t_field*>::const_iterator a_iter; std::vector<t_field*>::size_type num_args = args.size(); bool first = true; for (std::vector<t_field*>::size_type i = 0; i < num_args; ++i) { @@ -1730,7 +1729,6 @@ void t_py_generator::generate_service_remote(t_service* tservice) { t_struct* arg_struct = (*f_iter)->get_arglist(); const std::vector<t_field*>& args = arg_struct->get_members(); - vector<t_field*>::const_iterator a_iter; std::vector<t_field*>::size_type num_args = args.size(); f_remote << "if cmd == '" << (*f_iter)->get_name() << "':" << endl; diff --git a/lib/c_glib/test/testbufferedtransport.c b/lib/c_glib/test/testbufferedtransport.c index c6e6b58..d01806d 100755 --- a/lib/c_glib/test/testbufferedtransport.c +++ b/lib/c_glib/test/testbufferedtransport.c @@ -175,11 +175,8 @@ test_read_and_write(void) static void thrift_socket_server_open (const int port, int times) { - int bytes = 0; ThriftServerTransport *transport = NULL; ThriftTransport *client = NULL; - guchar buf[10]; /* a buffer */ - guchar match[10] = TEST_DATA; int i; ThriftServerSocket *tsocket = g_object_new (THRIFT_TYPE_SERVER_SOCKET, "port", port, NULL); diff --git a/lib/c_glib/test/testframedtransport.c b/lib/c_glib/test/testframedtransport.c index 45397ce..008e61e 100755 --- a/lib/c_glib/test/testframedtransport.c +++ b/lib/c_glib/test/testframedtransport.c @@ -249,11 +249,8 @@ test_read_after_peer_close(void) static void thrift_socket_server_open (const int port, int times) { - int bytes = 0; ThriftServerTransport *transport = NULL; ThriftTransport *client = NULL; - guchar buf[10]; /* a buffer */ - guchar match[10] = TEST_DATA; int i; ThriftServerSocket *tsocket = g_object_new (THRIFT_TYPE_SERVER_SOCKET, diff --git a/lib/c_glib/test/testtransportsocket.c b/lib/c_glib/test/testtransportsocket.c index fedbad6..89c61b9 100755 --- a/lib/c_glib/test/testtransportsocket.c +++ b/lib/c_glib/test/testtransportsocket.c @@ -291,11 +291,8 @@ test_peek(void) static void thrift_socket_server_open (const int port, int times) { - int bytes = 0; ThriftServerTransport *transport = NULL; ThriftTransport *client = NULL; - guchar buf[10]; /* a buffer */ - guchar match[10] = TEST_DATA; int i; ThriftServerSocket *tsocket = g_object_new (THRIFT_TYPE_SERVER_SOCKET, "port", port, NULL); diff --git a/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp index 40eb7ad..4576fa1 100644 --- a/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp +++ b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp @@ -49,7 +49,6 @@ static const uint8_t kJSONPairSeparator = ':'; static const uint8_t kJSONElemSeparator = ','; static const uint8_t kJSONBackslash = '\\'; static const uint8_t kJSONStringDelimiter = '"'; -static const uint8_t kJSONZeroChar = '0'; static const uint8_t kJSONEscapeChar = 'u'; static const std::string kJSONEscapePrefix("\\u00");