From 3c7b035ca6cbc35204a138941f3e877e543d8027 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Thu, 17 Oct 2019 08:50:54 -0700 Subject: [PATCH 1/2] Remove unused parameter warning (4 of 20) --- test/core/client_channel/resolvers/fake_resolver_test.cc | 2 +- .../client_channel/resolvers/sockaddr_resolver_test.cc | 2 +- test/core/client_channel/service_config_test.cc | 4 ++-- test/core/compression/compression_test.cc | 2 +- test/core/compression/stream_compression_test.cc | 2 +- test/core/end2end/bad_server_response_test.cc | 6 +++--- test/core/end2end/dualstack_socket_test.cc | 2 +- test/core/end2end/fixtures/h2_census.cc | 3 ++- test/core/end2end/fixtures/h2_compress.cc | 3 ++- test/core/end2end/fixtures/h2_fakesec.cc | 8 +++++--- 10 files changed, 19 insertions(+), 15 deletions(-) diff --git a/test/core/client_channel/resolvers/fake_resolver_test.cc b/test/core/client_channel/resolvers/fake_resolver_test.cc index 0d34a0b8f2c..20103348b80 100644 --- a/test/core/client_channel/resolvers/fake_resolver_test.cc +++ b/test/core/client_channel/resolvers/fake_resolver_test.cc @@ -55,7 +55,7 @@ class ResultHandler : public grpc_core::Resolver::ResultHandler { ev_ = nullptr; } - void ReturnError(grpc_error* error) override {} + void ReturnError(grpc_error* /*error*/) override {} private: grpc_core::Resolver::Result expected_; diff --git a/test/core/client_channel/resolvers/sockaddr_resolver_test.cc b/test/core/client_channel/resolvers/sockaddr_resolver_test.cc index 8cbacaca999..0d83f0ec5bf 100644 --- a/test/core/client_channel/resolvers/sockaddr_resolver_test.cc +++ b/test/core/client_channel/resolvers/sockaddr_resolver_test.cc @@ -32,7 +32,7 @@ static grpc_combiner* g_combiner; class ResultHandler : public grpc_core::Resolver::ResultHandler { public: - void ReturnResult(grpc_core::Resolver::Result result) override {} + void ReturnResult(grpc_core::Resolver::Result /*result*/) override {} void ReturnError(grpc_error* error) override { GRPC_ERROR_UNREF(error); } }; diff --git a/test/core/client_channel/service_config_test.cc b/test/core/client_channel/service_config_test.cc index 8617c5058b2..7b94ea21b02 100644 --- a/test/core/client_channel/service_config_test.cc +++ b/test/core/client_channel/service_config_test.cc @@ -116,14 +116,14 @@ class TestParser2 : public ServiceConfig::Parser { class ErrorParser : public ServiceConfig::Parser { public: UniquePtr ParsePerMethodParams( - const grpc_json* json, grpc_error** error) override { + const grpc_json* /*json*/, grpc_error** error) override { GPR_DEBUG_ASSERT(error != nullptr); *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(MethodError()); return nullptr; } UniquePtr ParseGlobalParams( - const grpc_json* json, grpc_error** error) override { + const grpc_json* /*json*/, grpc_error** error) override { GPR_DEBUG_ASSERT(error != nullptr); *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(GlobalError()); return nullptr; diff --git a/test/core/compression/compression_test.cc b/test/core/compression/compression_test.cc index aa54241135c..0a265afb50f 100644 --- a/test/core/compression/compression_test.cc +++ b/test/core/compression/compression_test.cc @@ -335,7 +335,7 @@ static void test_channel_args_compression_algorithm_states(void) { grpc_channel_args_destroy(ch_args); } -int main(int argc, char** argv) { +int main(int /*argc*/, char** /*argv*/) { grpc_init(); test_compression_algorithm_parse(); test_compression_algorithm_name(); diff --git a/test/core/compression/stream_compression_test.cc b/test/core/compression/stream_compression_test.cc index 0b843661988..d8670d2595d 100644 --- a/test/core/compression/stream_compression_test.cc +++ b/test/core/compression/stream_compression_test.cc @@ -287,7 +287,7 @@ static void test_stream_compression_sync_flush() { grpc_slice_buffer_destroy(&sink); } -int main(int argc, char** argv) { +int main(int /*argc*/, char** /*argv*/) { grpc_init(); test_stream_compression_simple_compress_decompress(); test_stream_compression_simple_compress_decompress_with_output_size_constraint(); diff --git a/test/core/end2end/bad_server_response_test.cc b/test/core/end2end/bad_server_response_test.cc index db480463b68..6bc13d675f6 100644 --- a/test/core/end2end/bad_server_response_test.cc +++ b/test/core/end2end/bad_server_response_test.cc @@ -92,7 +92,7 @@ static grpc_closure on_write; static void* tag(intptr_t t) { return (void*)t; } -static void done_write(void* arg, grpc_error* error) { +static void done_write(void* /*arg*/, grpc_error* error) { GPR_ASSERT(error == GRPC_ERROR_NONE); gpr_atm_rel_store(&state.done_atm, 1); @@ -107,7 +107,7 @@ static void handle_write() { grpc_endpoint_write(state.tcp, &state.outgoing_buffer, &on_write, nullptr); } -static void handle_read(void* arg, grpc_error* error) { +static void handle_read(void* /*arg*/, grpc_error* error) { GPR_ASSERT(error == GRPC_ERROR_NONE); state.incoming_data_length += state.temp_incoming_buffer.length; @@ -132,7 +132,7 @@ static void handle_read(void* arg, grpc_error* error) { } static void on_connect(void* arg, grpc_endpoint* tcp, - grpc_pollset* accepting_pollset, + grpc_pollset* /*accepting_pollset*/, grpc_tcp_server_acceptor* acceptor) { gpr_free(acceptor); test_tcp_server* server = static_cast(arg); diff --git a/test/core/end2end/dualstack_socket_test.cc b/test/core/end2end/dualstack_socket_test.cc index cb49e0030b4..efc691dd43f 100644 --- a/test/core/end2end/dualstack_socket_test.cc +++ b/test/core/end2end/dualstack_socket_test.cc @@ -51,7 +51,7 @@ static void drain_cq(grpc_completion_queue* cq) { } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void do_nothing(void* ignored) {} +static void do_nothing(void* /*ignored*/) {} static void log_resolved_addrs(const char* label, const char* hostname) { grpc_resolved_addresses* res = nullptr; diff --git a/test/core/end2end/fixtures/h2_census.cc b/test/core/end2end/fixtures/h2_census.cc index 72cb96138e1..31ecb9888e3 100644 --- a/test/core/end2end/fixtures/h2_census.cc +++ b/test/core/end2end/fixtures/h2_census.cc @@ -40,7 +40,8 @@ struct fullstack_fixture_data { }; static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( - grpc_channel_args* client_args, grpc_channel_args* server_args) { + grpc_channel_args* /*client_args*/, + grpc_channel_args* /*server_args*/) { grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); fullstack_fixture_data* ffd = grpc_core::New(); diff --git a/test/core/end2end/fixtures/h2_compress.cc b/test/core/end2end/fixtures/h2_compress.cc index dd0c1fe0201..6fda2b55eee 100644 --- a/test/core/end2end/fixtures/h2_compress.cc +++ b/test/core/end2end/fixtures/h2_compress.cc @@ -47,7 +47,8 @@ struct fullstack_compression_fixture_data { }; static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression( - grpc_channel_args* client_args, grpc_channel_args* server_args) { + grpc_channel_args* /*client_args*/, + grpc_channel_args* /*server_args*/) { grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); fullstack_compression_fixture_data* ffd = diff --git a/test/core/end2end/fixtures/h2_fakesec.cc b/test/core/end2end/fixtures/h2_fakesec.cc index 1375549ed6c..1a4f062150b 100644 --- a/test/core/end2end/fixtures/h2_fakesec.cc +++ b/test/core/end2end/fixtures/h2_fakesec.cc @@ -36,7 +36,8 @@ struct fullstack_secure_fixture_data { }; static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( - grpc_channel_args* client_args, grpc_channel_args* server_args) { + grpc_channel_args* /*client_args*/, + grpc_channel_args* /*server_args*/) { grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); fullstack_secure_fixture_data* ffd = @@ -51,8 +52,9 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( return f; } -static void process_auth_failure(void* state, grpc_auth_context* ctx, - const grpc_metadata* md, size_t md_count, +static void process_auth_failure(void* state, grpc_auth_context* /*ctx*/, + const grpc_metadata* /*md*/, + size_t /*md_count*/, grpc_process_auth_metadata_done_cb cb, void* user_data) { GPR_ASSERT(state == nullptr); From 3828cb0f8f0f9e3a1bb8a8661e38412006db554c Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Thu, 17 Oct 2019 09:04:35 -0700 Subject: [PATCH 2/2] clang-format --- test/core/end2end/fixtures/h2_census.cc | 3 +-- test/core/end2end/fixtures/h2_compress.cc | 3 +-- test/core/end2end/fixtures/h2_fakesec.cc | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/test/core/end2end/fixtures/h2_census.cc b/test/core/end2end/fixtures/h2_census.cc index 31ecb9888e3..69f11c593df 100644 --- a/test/core/end2end/fixtures/h2_census.cc +++ b/test/core/end2end/fixtures/h2_census.cc @@ -40,8 +40,7 @@ struct fullstack_fixture_data { }; static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( - grpc_channel_args* /*client_args*/, - grpc_channel_args* /*server_args*/) { + grpc_channel_args* /*client_args*/, grpc_channel_args* /*server_args*/) { grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); fullstack_fixture_data* ffd = grpc_core::New(); diff --git a/test/core/end2end/fixtures/h2_compress.cc b/test/core/end2end/fixtures/h2_compress.cc index 6fda2b55eee..8492cba87cd 100644 --- a/test/core/end2end/fixtures/h2_compress.cc +++ b/test/core/end2end/fixtures/h2_compress.cc @@ -47,8 +47,7 @@ struct fullstack_compression_fixture_data { }; static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression( - grpc_channel_args* /*client_args*/, - grpc_channel_args* /*server_args*/) { + grpc_channel_args* /*client_args*/, grpc_channel_args* /*server_args*/) { grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); fullstack_compression_fixture_data* ffd = diff --git a/test/core/end2end/fixtures/h2_fakesec.cc b/test/core/end2end/fixtures/h2_fakesec.cc index 1a4f062150b..130c04bb151 100644 --- a/test/core/end2end/fixtures/h2_fakesec.cc +++ b/test/core/end2end/fixtures/h2_fakesec.cc @@ -36,8 +36,7 @@ struct fullstack_secure_fixture_data { }; static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( - grpc_channel_args* /*client_args*/, - grpc_channel_args* /*server_args*/) { + grpc_channel_args* /*client_args*/, grpc_channel_args* /*server_args*/) { grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); fullstack_secure_fixture_data* ffd =