From 9d96158d7e4fac1ff5869f2804a41ccc571db795 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Mon, 21 Oct 2019 09:16:34 -0700 Subject: [PATCH] Remove unused-parameter warnings, round 2 (15 of 19) --- test/core/debug/stats_test.cc | 4 ++++ .../end2end/fixtures/http_proxy_fixture.cc | 10 ++++++---- test/core/end2end/fixtures/local_util.cc | 5 +++-- test/core/end2end/fixtures/proxy.cc | 20 ++++++++++--------- test/core/end2end/tests/cancel_with_status.cc | 2 +- .../core/end2end/tests/disappearing_server.cc | 2 +- test/core/end2end/tests/empty_batch.cc | 2 +- test/core/end2end/tests/high_initial_seqno.cc | 2 +- test/core/end2end/tests/hpack_size.cc | 2 +- test/core/end2end/tests/idempotent_request.cc | 2 +- 10 files changed, 30 insertions(+), 21 deletions(-) diff --git a/test/core/debug/stats_test.cc b/test/core/debug/stats_test.cc index 8e13898e2c3..f28133d1274 100644 --- a/test/core/debug/stats_test.cc +++ b/test/core/debug/stats_test.cc @@ -151,5 +151,9 @@ int main(int argc, char** argv) { int ret = RUN_ALL_TESTS(); grpc_shutdown(); return ret; +#else + // Avoid unused parameter warning for conditional parameters. + (void)argc; + (void)argv; #endif } diff --git a/test/core/end2end/fixtures/http_proxy_fixture.cc b/test/core/end2end/fixtures/http_proxy_fixture.cc index 8f8ddcc8a49..90e16dc43c8 100644 --- a/test/core/end2end/fixtures/http_proxy_fixture.cc +++ b/test/core/end2end/fixtures/http_proxy_fixture.cc @@ -119,12 +119,14 @@ typedef struct proxy_connection { grpc_http_request http_request; } proxy_connection; -static void proxy_connection_ref(proxy_connection* conn, const char* reason) { +static void proxy_connection_ref(proxy_connection* conn, + const char* /*reason*/) { gpr_ref(&conn->refcount); } // Helper function to destroy the proxy connection. -static void proxy_connection_unref(proxy_connection* conn, const char* reason) { +static void proxy_connection_unref(proxy_connection* conn, + const char* /*reason*/) { if (gpr_unref(&conn->refcount)) { gpr_log(GPR_DEBUG, "endpoints: %p %p", conn->client_endpoint, conn->server_endpoint); @@ -554,7 +556,7 @@ static void on_read_request_done(void* arg, grpc_error* error) { } static void on_accept(void* arg, grpc_endpoint* endpoint, - grpc_pollset* accepting_pollset, + grpc_pollset* /*accepting_pollset*/, grpc_tcp_server_acceptor* acceptor) { gpr_free(acceptor); grpc_end2end_http_proxy* proxy = static_cast(arg); @@ -639,7 +641,7 @@ grpc_end2end_http_proxy* grpc_end2end_http_proxy_create( return proxy; } -static void destroy_pollset(void* arg, grpc_error* error) { +static void destroy_pollset(void* arg, grpc_error* /*error*/) { grpc_pollset* pollset = static_cast(arg); grpc_pollset_destroy(pollset); gpr_free(pollset); diff --git a/test/core/end2end/fixtures/local_util.cc b/test/core/end2end/fixtures/local_util.cc index 767f3a28ef8..c1fd88b67b0 100644 --- a/test/core/end2end/fixtures/local_util.cc +++ b/test/core/end2end/fixtures/local_util.cc @@ -73,8 +73,9 @@ static bool fail_server_auth_check(grpc_channel_args* server_args) { return false; } -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); diff --git a/test/core/end2end/fixtures/proxy.cc b/test/core/end2end/fixtures/proxy.cc index 4ae7450b0df..3351eab2f3c 100644 --- a/test/core/end2end/fixtures/proxy.cc +++ b/test/core/end2end/fixtures/proxy.cc @@ -120,7 +120,7 @@ static closure* new_closure(void (*func)(void* arg, int success), void* arg) { return cl; } -static void shutdown_complete(void* arg, int success) { +static void shutdown_complete(void* arg, int /*success*/) { grpc_end2end_proxy* proxy = static_cast(arg); proxy->shutdown = 1; grpc_completion_queue_shutdown(proxy->cq); @@ -137,7 +137,7 @@ void grpc_end2end_proxy_destroy(grpc_end2end_proxy* proxy) { grpc_core::Delete(proxy); } -static void unrefpc(proxy_call* pc, const char* reason) { +static void unrefpc(proxy_call* pc, const char* /*reason*/) { if (gpr_unref(&pc->refs)) { grpc_call_unref(pc->c2p); grpc_call_unref(pc->p2s); @@ -149,14 +149,16 @@ static void unrefpc(proxy_call* pc, const char* reason) { } } -static void refpc(proxy_call* pc, const char* reason) { gpr_ref(&pc->refs); } +static void refpc(proxy_call* pc, const char* /*reason*/) { + gpr_ref(&pc->refs); +} -static void on_c2p_sent_initial_metadata(void* arg, int success) { +static void on_c2p_sent_initial_metadata(void* arg, int /*success*/) { proxy_call* pc = static_cast(arg); unrefpc(pc, "on_c2p_sent_initial_metadata"); } -static void on_p2s_recv_initial_metadata(void* arg, int success) { +static void on_p2s_recv_initial_metadata(void* arg, int /*success*/) { proxy_call* pc = static_cast(arg); grpc_op op; grpc_call_error err; @@ -178,7 +180,7 @@ static void on_p2s_recv_initial_metadata(void* arg, int success) { unrefpc(pc, "on_p2s_recv_initial_metadata"); } -static void on_p2s_sent_initial_metadata(void* arg, int success) { +static void on_p2s_sent_initial_metadata(void* arg, int /*success*/) { proxy_call* pc = static_cast(arg); unrefpc(pc, "on_p2s_sent_initial_metadata"); } @@ -205,7 +207,7 @@ static void on_p2s_sent_message(void* arg, int success) { unrefpc(pc, "on_p2s_sent_message"); } -static void on_p2s_sent_close(void* arg, int success) { +static void on_p2s_sent_close(void* arg, int /*success*/) { proxy_call* pc = static_cast(arg); unrefpc(pc, "on_p2s_sent_close"); } @@ -285,7 +287,7 @@ static void on_p2s_recv_msg(void* arg, int success) { unrefpc(pc, "on_p2s_recv_msg"); } -static void on_c2p_sent_status(void* arg, int success) { +static void on_c2p_sent_status(void* arg, int /*success*/) { proxy_call* pc = static_cast(arg); unrefpc(pc, "on_c2p_sent_status"); } @@ -315,7 +317,7 @@ static void on_p2s_status(void* arg, int success) { unrefpc(pc, "on_p2s_status"); } -static void on_c2p_closed(void* arg, int success) { +static void on_c2p_closed(void* arg, int /*success*/) { proxy_call* pc = static_cast(arg); unrefpc(pc, "on_c2p_closed"); } diff --git a/test/core/end2end/tests/cancel_with_status.cc b/test/core/end2end/tests/cancel_with_status.cc index 2fc9d2ff271..2d6ad771fcc 100644 --- a/test/core/end2end/tests/cancel_with_status.cc +++ b/test/core/end2end/tests/cancel_with_status.cc @@ -89,7 +89,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->shutdown_cq); } -static void simple_request_body(grpc_end2end_test_config config, +static void simple_request_body(grpc_end2end_test_config /*config*/, grpc_end2end_test_fixture f, size_t num_ops) { grpc_call* c; cq_verifier* cqv = cq_verifier_create(f.cq); diff --git a/test/core/end2end/tests/disappearing_server.cc b/test/core/end2end/tests/disappearing_server.cc index fdd780f117e..0858ce39597 100644 --- a/test/core/end2end/tests/disappearing_server.cc +++ b/test/core/end2end/tests/disappearing_server.cc @@ -68,7 +68,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->shutdown_cq); } -static void do_request_and_shutdown_server(grpc_end2end_test_config config, +static void do_request_and_shutdown_server(grpc_end2end_test_config /*config*/, grpc_end2end_test_fixture* f, cq_verifier* cqv) { grpc_call* c; diff --git a/test/core/end2end/tests/empty_batch.cc b/test/core/end2end/tests/empty_batch.cc index 317bb7aeb07..1144ebf1759 100644 --- a/test/core/end2end/tests/empty_batch.cc +++ b/test/core/end2end/tests/empty_batch.cc @@ -85,7 +85,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->shutdown_cq); } -static void empty_batch_body(grpc_end2end_test_config config, +static void empty_batch_body(grpc_end2end_test_config /*config*/, grpc_end2end_test_fixture f) { grpc_call* c; cq_verifier* cqv = cq_verifier_create(f.cq); diff --git a/test/core/end2end/tests/high_initial_seqno.cc b/test/core/end2end/tests/high_initial_seqno.cc index 18e6ee90ef5..ca6e883ee4d 100644 --- a/test/core/end2end/tests/high_initial_seqno.cc +++ b/test/core/end2end/tests/high_initial_seqno.cc @@ -87,7 +87,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->shutdown_cq); } -static void simple_request_body(grpc_end2end_test_config config, +static void simple_request_body(grpc_end2end_test_config /*config*/, grpc_end2end_test_fixture f) { grpc_call* c; grpc_call* s; diff --git a/test/core/end2end/tests/hpack_size.cc b/test/core/end2end/tests/hpack_size.cc index 7c51294e1cc..8f36868d98a 100644 --- a/test/core/end2end/tests/hpack_size.cc +++ b/test/core/end2end/tests/hpack_size.cc @@ -228,7 +228,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->shutdown_cq); } -static void simple_request_body(grpc_end2end_test_config config, +static void simple_request_body(grpc_end2end_test_config /*config*/, grpc_end2end_test_fixture f, size_t index) { grpc_call* c; grpc_call* s; diff --git a/test/core/end2end/tests/idempotent_request.cc b/test/core/end2end/tests/idempotent_request.cc index 80908d5210c..5fc087c9e64 100644 --- a/test/core/end2end/tests/idempotent_request.cc +++ b/test/core/end2end/tests/idempotent_request.cc @@ -86,7 +86,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->shutdown_cq); } -static void simple_request_body(grpc_end2end_test_config config, +static void simple_request_body(grpc_end2end_test_config /*config*/, grpc_end2end_test_fixture f) { grpc_call* c; grpc_call* s;