Merge pull request #20644 from vjpai/remove_warn_17

Remove unused parameter warnings (17 of 20)
reviewable/pr20542/r3
Vijay Pai 5 years ago committed by GitHub
commit e8f78e7a5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      test/cpp/interop/client_helper.cc
  2. 5
      test/cpp/interop/grpclb_fallback_test.cc
  3. 2
      test/cpp/interop/http2_client.cc
  4. 7
      test/cpp/interop/interop_client.cc
  5. 9
      test/cpp/interop/interop_server.cc
  6. 2
      test/cpp/interop/interop_server_bootstrap.cc
  7. 2
      test/cpp/interop/metrics_client.cc
  8. 8
      test/cpp/interop/reconnect_interop_server.cc
  9. 90
      test/cpp/microbenchmarks/bm_call_create.cc
  10. 4
      test/cpp/microbenchmarks/bm_chttp2_hpack.cc

@ -76,7 +76,7 @@ grpc::string GetOauth2AccessToken() {
}
void UpdateActions(
std::unordered_map<grpc::string, std::function<bool()>>* actions) {}
std::unordered_map<grpc::string, std::function<bool()>>* /*actions*/) {}
std::shared_ptr<Channel> CreateChannelForTestCase(
const grpc::string& test_case,

@ -120,7 +120,7 @@ GrpclbRouteType DoWaitForReadyRPCAndGetPath(TestService::Stub* stub,
return DoRPCAndGetPath(stub, deadline_seconds, WaitForReady);
}
bool TcpUserTimeoutMutateFd(int fd, grpc_socket_mutator* mutator) {
bool TcpUserTimeoutMutateFd(int fd, grpc_socket_mutator* /*mutator*/) {
int timeout = 20000; // 20 seconds
gpr_log(GPR_INFO, "Setting socket option TCP_USER_TIMEOUT on fd: %d", fd);
if (0 != setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &timeout,
@ -138,7 +138,8 @@ bool TcpUserTimeoutMutateFd(int fd, grpc_socket_mutator* mutator) {
return true;
}
int TcpUserTimeoutCompare(grpc_socket_mutator* a, grpc_socket_mutator* b) {
int TcpUserTimeoutCompare(grpc_socket_mutator* /*a*/,
grpc_socket_mutator* /*b*/) {
return 0;
}

@ -141,7 +141,7 @@ bool Http2Client::DoPing() {
}
void Http2Client::MaxStreamsWorker(
const std::shared_ptr<grpc::Channel>& channel) {
const std::shared_ptr<grpc::Channel>& /*channel*/) {
SimpleResponse response;
AssertStatusCode(SendUnaryCall(&response), grpc::StatusCode::OK);
GPR_ASSERT(response.payload().body() ==

@ -50,12 +50,13 @@ const int kReceiveDelayMilliSeconds = 20;
const int kLargeRequestSize = 271828;
const int kLargeResponseSize = 314159;
void NoopChecks(const InteropClientContextInspector& inspector,
const SimpleRequest* request, const SimpleResponse* response) {}
void NoopChecks(const InteropClientContextInspector& /*inspector*/,
const SimpleRequest* /*request*/,
const SimpleResponse* /*response*/) {}
void UnaryCompressionChecks(const InteropClientContextInspector& inspector,
const SimpleRequest* request,
const SimpleResponse* response) {
const SimpleResponse* /*response*/) {
const grpc_compression_algorithm received_compression =
inspector.GetCallCompressionAlgorithm();
if (request->response_compressed().value()) {

@ -138,15 +138,16 @@ bool CheckExpectedCompression(const ServerContext& context,
class TestServiceImpl : public TestService::Service {
public:
Status EmptyCall(ServerContext* context, const grpc::testing::Empty* request,
grpc::testing::Empty* response) {
Status EmptyCall(ServerContext* context,
const grpc::testing::Empty* /*request*/,
grpc::testing::Empty* /*response*/) {
MaybeEchoMetadata(context);
return Status::OK;
}
// Response contains current timestamp. We ignore everything in the request.
Status CacheableUnaryCall(ServerContext* context,
const SimpleRequest* request,
const SimpleRequest* /*request*/,
SimpleResponse* response) {
gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE);
std::string timestamp = std::to_string((long long unsigned)ts.tv_nsec);
@ -287,7 +288,7 @@ class TestServiceImpl : public TestService::Service {
}
Status HalfDuplexCall(
ServerContext* context,
ServerContext* /*context*/,
ServerReaderWriter<StreamingOutputCallResponse,
StreamingOutputCallRequest>* stream) {
std::vector<StreamingOutputCallRequest> requests;

@ -23,7 +23,7 @@
gpr_atm grpc::testing::interop::g_got_sigint;
static void sigint_handler(int x) {
static void sigint_handler(int /*x*/) {
gpr_atm_no_barrier_store(&grpc::testing::interop::g_got_sigint, true);
}

@ -43,7 +43,7 @@ using grpc::testing::MetricsService;
using grpc::testing::MetricsServiceImpl;
// Do not log anything
void BlackholeLogger(gpr_log_func_args* args) {}
void BlackholeLogger(gpr_log_func_args* /*args*/) {}
// Prints the values of all Gauges (unless total_only is set to 'true' in which
// case this only prints the sum of all gauge values).

@ -77,8 +77,8 @@ class ReconnectServiceImpl : public ReconnectService::Service {
void Poll(int seconds) { reconnect_server_poll(&tcp_server_, seconds); }
Status Start(ServerContext* context, const ReconnectParams* request,
Empty* response) {
Status Start(ServerContext* /*context*/, const ReconnectParams* request,
Empty* /*response*/) {
bool start_server = true;
std::unique_lock<std::mutex> lock(mu_);
while (serving_ && !shutdown_) {
@ -105,7 +105,7 @@ class ReconnectServiceImpl : public ReconnectService::Service {
return Status::OK;
}
Status Stop(ServerContext* context, const Empty* request,
Status Stop(ServerContext* /*context*/, const Empty* /*request*/,
ReconnectInfo* response) {
// extract timestamps and set response
Verify(response);
@ -176,7 +176,7 @@ void RunServer() {
service.Shutdown();
}
static void sigint_handler(int x) { got_sigint = true; }
static void sigint_handler(int /*x*/) { got_sigint = true; }
int main(int argc, char** argv) {
grpc::testing::InitTest(&argc, &argv, true);

@ -153,7 +153,7 @@ static void BM_LameChannelCallCreateCpp(benchmark::State& state) {
}
BENCHMARK(BM_LameChannelCallCreateCpp);
static void do_nothing(void* ignored) {}
static void do_nothing(void* /*ignored*/) {}
static void BM_LameChannelCallCreateCore(benchmark::State& state) {
TrackCounters track_counters;
@ -312,14 +312,14 @@ static void BM_LameChannelCallCreateCoreSeparateBatch(benchmark::State& state) {
}
BENCHMARK(BM_LameChannelCallCreateCoreSeparateBatch);
static void FilterDestroy(void* arg, grpc_error* error) { gpr_free(arg); }
static void FilterDestroy(void* arg, grpc_error* /*error*/) { gpr_free(arg); }
static void DoNothing(void* arg, grpc_error* error) {}
static void DoNothing(void* /*arg*/, grpc_error* /*error*/) {}
class FakeClientChannelFactory : public grpc_core::ClientChannelFactory {
public:
grpc_core::Subchannel* CreateSubchannel(
const grpc_channel_args* args) override {
const grpc_channel_args* /*args*/) override {
return nullptr;
}
};
@ -345,33 +345,33 @@ struct Fixture {
namespace dummy_filter {
static void StartTransportStreamOp(grpc_call_element* elem,
grpc_transport_stream_op_batch* op) {}
static void StartTransportStreamOp(grpc_call_element* /*elem*/,
grpc_transport_stream_op_batch* /*op*/) {}
static void StartTransportOp(grpc_channel_element* elem,
grpc_transport_op* op) {}
static void StartTransportOp(grpc_channel_element* /*elem*/,
grpc_transport_op* /*op*/) {}
static grpc_error* InitCallElem(grpc_call_element* elem,
const grpc_call_element_args* args) {
static grpc_error* InitCallElem(grpc_call_element* /*elem*/,
const grpc_call_element_args* /*args*/) {
return GRPC_ERROR_NONE;
}
static void SetPollsetOrPollsetSet(grpc_call_element* elem,
grpc_polling_entity* pollent) {}
static void SetPollsetOrPollsetSet(grpc_call_element* /*elem*/,
grpc_polling_entity* /*pollent*/) {}
static void DestroyCallElem(grpc_call_element* elem,
const grpc_call_final_info* final_info,
grpc_closure* then_sched_closure) {}
static void DestroyCallElem(grpc_call_element* /*elem*/,
const grpc_call_final_info* /*final_info*/,
grpc_closure* /*then_sched_closure*/) {}
grpc_error* InitChannelElem(grpc_channel_element* elem,
grpc_channel_element_args* args) {
grpc_error* InitChannelElem(grpc_channel_element* /*elem*/,
grpc_channel_element_args* /*args*/) {
return GRPC_ERROR_NONE;
}
void DestroyChannelElem(grpc_channel_element* elem) {}
void DestroyChannelElem(grpc_channel_element* /*elem*/) {}
void GetChannelInfo(grpc_channel_element* elem,
const grpc_channel_info* channel_info) {}
void GetChannelInfo(grpc_channel_element* /*elem*/,
const grpc_channel_info* /*channel_info*/) {}
static const grpc_channel_filter dummy_filter = {StartTransportStreamOp,
StartTransportOp,
@ -397,38 +397,38 @@ size_t sizeof_stream; /* = sizeof(transport stream) */
const char* name;
/* implementation of grpc_transport_init_stream */
int InitStream(grpc_transport* self, grpc_stream* stream,
grpc_stream_refcount* refcount, const void* server_data,
grpc_core::Arena* arena) {
int InitStream(grpc_transport* /*self*/, grpc_stream* /*stream*/,
grpc_stream_refcount* /*refcount*/, const void* /*server_data*/,
grpc_core::Arena* /*arena*/) {
return 0;
}
/* implementation of grpc_transport_set_pollset */
void SetPollset(grpc_transport* self, grpc_stream* stream,
grpc_pollset* pollset) {}
void SetPollset(grpc_transport* /*self*/, grpc_stream* /*stream*/,
grpc_pollset* /*pollset*/) {}
/* implementation of grpc_transport_set_pollset */
void SetPollsetSet(grpc_transport* self, grpc_stream* stream,
grpc_pollset_set* pollset_set) {}
void SetPollsetSet(grpc_transport* /*self*/, grpc_stream* /*stream*/,
grpc_pollset_set* /*pollset_set*/) {}
/* implementation of grpc_transport_perform_stream_op */
void PerformStreamOp(grpc_transport* self, grpc_stream* stream,
void PerformStreamOp(grpc_transport* /*self*/, grpc_stream* /*stream*/,
grpc_transport_stream_op_batch* op) {
GRPC_CLOSURE_SCHED(op->on_complete, GRPC_ERROR_NONE);
}
/* implementation of grpc_transport_perform_op */
void PerformOp(grpc_transport* self, grpc_transport_op* op) {}
void PerformOp(grpc_transport* /*self*/, grpc_transport_op* /*op*/) {}
/* implementation of grpc_transport_destroy_stream */
void DestroyStream(grpc_transport* self, grpc_stream* stream,
grpc_closure* then_sched_closure) {}
void DestroyStream(grpc_transport* /*self*/, grpc_stream* /*stream*/,
grpc_closure* /*then_sched_closure*/) {}
/* implementation of grpc_transport_destroy */
void Destroy(grpc_transport* self) {}
void Destroy(grpc_transport* /*self*/) {}
/* implementation of grpc_transport_get_endpoint */
grpc_endpoint* GetEndpoint(grpc_transport* self) { return nullptr; }
grpc_endpoint* GetEndpoint(grpc_transport* /*self*/) { return nullptr; }
static const grpc_transport_vtable dummy_transport_vtable = {
0, "dummy_http2", InitStream,
@ -444,7 +444,7 @@ class NoOp {
public:
class Op {
public:
Op(NoOp* p, grpc_call_stack* s) {}
Op(NoOp* /*p*/, grpc_call_stack* /*s*/) {}
void Finish() {}
};
};
@ -461,7 +461,7 @@ class SendEmptyMetadata {
class Op {
public:
Op(SendEmptyMetadata* p, grpc_call_stack* s) {
Op(SendEmptyMetadata* p, grpc_call_stack* /*s*/) {
grpc_metadata_batch_init(&batch_);
p->op_payload_.send_initial_metadata.send_initial_metadata = &batch_;
}
@ -631,7 +631,7 @@ static void StartTransportStreamOp(grpc_call_element* elem,
closures.RunClosures(calld->call_combiner);
}
static void StartTransportOp(grpc_channel_element* elem,
static void StartTransportOp(grpc_channel_element* /*elem*/,
grpc_transport_op* op) {
if (op->disconnect_with_error != GRPC_ERROR_NONE) {
GRPC_ERROR_UNREF(op->disconnect_with_error);
@ -646,24 +646,24 @@ static grpc_error* InitCallElem(grpc_call_element* elem,
return GRPC_ERROR_NONE;
}
static void SetPollsetOrPollsetSet(grpc_call_element* elem,
grpc_polling_entity* pollent) {}
static void SetPollsetOrPollsetSet(grpc_call_element* /*elem*/,
grpc_polling_entity* /*pollent*/) {}
static void DestroyCallElem(grpc_call_element* elem,
const grpc_call_final_info* final_info,
static void DestroyCallElem(grpc_call_element* /*elem*/,
const grpc_call_final_info* /*final_info*/,
grpc_closure* then_sched_closure) {
GRPC_CLOSURE_SCHED(then_sched_closure, GRPC_ERROR_NONE);
}
grpc_error* InitChannelElem(grpc_channel_element* elem,
grpc_channel_element_args* args) {
grpc_error* InitChannelElem(grpc_channel_element* /*elem*/,
grpc_channel_element_args* /*args*/) {
return GRPC_ERROR_NONE;
}
void DestroyChannelElem(grpc_channel_element* elem) {}
void DestroyChannelElem(grpc_channel_element* /*elem*/) {}
void GetChannelInfo(grpc_channel_element* elem,
const grpc_channel_info* channel_info) {}
void GetChannelInfo(grpc_channel_element* /*elem*/,
const grpc_channel_info* /*channel_info*/) {}
static const grpc_channel_filter isolated_call_filter = {
StartTransportStreamOp,

@ -451,7 +451,7 @@ static void BM_HpackParserInitDestroy(benchmark::State& state) {
}
BENCHMARK(BM_HpackParserInitDestroy);
static grpc_error* UnrefHeader(void* user_data, grpc_mdelem md) {
static grpc_error* UnrefHeader(void* /*user_data*/, grpc_mdelem md) {
GRPC_MDELEM_UNREF(md);
return GRPC_ERROR_NONE;
}
@ -833,7 +833,7 @@ static grpc_error* OnInitialHeader(void* user_data, grpc_mdelem md) {
}
// Benchmark timeout handling
static grpc_error* OnHeaderTimeout(void* user_data, grpc_mdelem md) {
static grpc_error* OnHeaderTimeout(void* /*user_data*/, grpc_mdelem md) {
if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_GRPC_TIMEOUT)) {
grpc_millis* cached_timeout =
static_cast<grpc_millis*>(grpc_mdelem_get_user_data(md, free_timeout));

Loading…
Cancel
Save