Remove unused-parameter warnings, round 2 (2 of 19)

pull/20720/head
Vijay Pai 5 years ago
parent 2d80e830c0
commit f5859343bb
  1. 14
      src/core/ext/filters/client_channel/http_proxy.cc
  2. 6
      src/core/ext/filters/client_channel/lb_policy.cc
  3. 10
      src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
  4. 10
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
  5. 2
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
  6. 4
      src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
  7. 4
      src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
  8. 5
      src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
  9. 4
      src/core/ext/filters/client_channel/lb_policy/xds/xds.cc
  10. 10
      src/core/ext/filters/client_channel/local_subchannel_pool.cc

@ -99,7 +99,7 @@ bool http_proxy_enabled(const grpc_channel_args* args) {
return grpc_channel_arg_get_bool(arg, true); return grpc_channel_arg_get_bool(arg, true);
} }
static bool proxy_mapper_map_name(grpc_proxy_mapper* mapper, static bool proxy_mapper_map_name(grpc_proxy_mapper* /*mapper*/,
const char* server_uri, const char* server_uri,
const grpc_channel_args* args, const grpc_channel_args* args,
char** name_to_resolve, char** name_to_resolve,
@ -195,15 +195,15 @@ no_use_proxy:
return false; return false;
} }
static bool proxy_mapper_map_address(grpc_proxy_mapper* mapper, static bool proxy_mapper_map_address(grpc_proxy_mapper* /*mapper*/,
const grpc_resolved_address* address, const grpc_resolved_address* /*address*/,
const grpc_channel_args* args, const grpc_channel_args* /*args*/,
grpc_resolved_address** new_address, grpc_resolved_address** /*new_address*/,
grpc_channel_args** new_args) { grpc_channel_args** /*new_args*/) {
return false; return false;
} }
static void proxy_mapper_destroy(grpc_proxy_mapper* mapper) {} static void proxy_mapper_destroy(grpc_proxy_mapper* /*mapper*/) {}
static const grpc_proxy_mapper_vtable proxy_mapper_vtable = { static const grpc_proxy_mapper_vtable proxy_mapper_vtable = {
proxy_mapper_map_name, proxy_mapper_map_address, proxy_mapper_destroy}; proxy_mapper_map_name, proxy_mapper_map_address, proxy_mapper_destroy};

@ -90,7 +90,7 @@ LoadBalancingPolicy::UpdateArgs& LoadBalancingPolicy::UpdateArgs::operator=(
// //
LoadBalancingPolicy::PickResult LoadBalancingPolicy::QueuePicker::Pick( LoadBalancingPolicy::PickResult LoadBalancingPolicy::QueuePicker::Pick(
PickArgs args) { PickArgs /*args*/) {
// We invoke the parent's ExitIdleLocked() via a closure instead // We invoke the parent's ExitIdleLocked() via a closure instead
// of doing it directly here, for two reasons: // of doing it directly here, for two reasons:
// 1. ExitIdleLocked() may cause the policy's state to change and // 1. ExitIdleLocked() may cause the policy's state to change and
@ -115,7 +115,7 @@ LoadBalancingPolicy::PickResult LoadBalancingPolicy::QueuePicker::Pick(
} }
void LoadBalancingPolicy::QueuePicker::CallExitIdle(void* arg, void LoadBalancingPolicy::QueuePicker::CallExitIdle(void* arg,
grpc_error* error) { grpc_error* /*error*/) {
LoadBalancingPolicy* parent = static_cast<LoadBalancingPolicy*>(arg); LoadBalancingPolicy* parent = static_cast<LoadBalancingPolicy*>(arg);
parent->ExitIdleLocked(); parent->ExitIdleLocked();
parent->Unref(); parent->Unref();
@ -126,7 +126,7 @@ void LoadBalancingPolicy::QueuePicker::CallExitIdle(void* arg,
// //
LoadBalancingPolicy::PickResult LoadBalancingPolicy::PickResult
LoadBalancingPolicy::TransientFailurePicker::Pick(PickArgs args) { LoadBalancingPolicy::TransientFailurePicker::Pick(PickArgs /*args*/) {
PickResult result; PickResult result;
result.type = PickResult::PICK_FAILED; result.type = PickResult::PICK_FAILED;
result.error = GRPC_ERROR_REF(error_); result.error = GRPC_ERROR_REF(error_);

@ -30,12 +30,12 @@
#include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/error.h"
#include "src/core/lib/profiling/timers.h" #include "src/core/lib/profiling/timers.h"
static grpc_error* clr_init_channel_elem(grpc_channel_element* elem, static grpc_error* clr_init_channel_elem(grpc_channel_element* /*elem*/,
grpc_channel_element_args* args) { grpc_channel_element_args* /*args*/) {
return GRPC_ERROR_NONE; return GRPC_ERROR_NONE;
} }
static void clr_destroy_channel_elem(grpc_channel_element* elem) {} static void clr_destroy_channel_elem(grpc_channel_element* /*elem*/) {}
namespace { namespace {
@ -79,8 +79,8 @@ static grpc_error* clr_init_call_elem(grpc_call_element* elem,
} }
static void clr_destroy_call_elem(grpc_call_element* elem, static void clr_destroy_call_elem(grpc_call_element* elem,
const grpc_call_final_info* final_info, const grpc_call_final_info* /*final_info*/,
grpc_closure* ignored) { grpc_closure* /*ignored*/) {
call_data* calld = static_cast<call_data*>(elem->call_data); call_data* calld = static_cast<call_data*>(elem->call_data);
if (calld->client_stats != nullptr) { if (calld->client_stats != nullptr) {
// Record call finished, optionally setting client_failed_to_send and // Record call finished, optionally setting client_failed_to_send and

@ -468,7 +468,7 @@ void client_stats_destroy(void* p) {
GrpcLbClientStats* client_stats = static_cast<GrpcLbClientStats*>(p); GrpcLbClientStats* client_stats = static_cast<GrpcLbClientStats*>(p);
client_stats->Unref(); client_stats->Unref();
} }
int equal_cmp(void* p1, void* p2) { int equal_cmp(void* /*p1*/, void* /*p2*/) {
// Always indicate a match, since we don't want this channel arg to // Always indicate a match, since we don't want this channel arg to
// affect the subchannel's key in the index. // affect the subchannel's key in the index.
// TODO(roth): Is this right? This does prevent us from needlessly // TODO(roth): Is this right? This does prevent us from needlessly
@ -1025,8 +1025,8 @@ void GrpcLb::BalancerCallState::OnInitialRequestSent(void* arg,
GRPC_ERROR_REF(error)); GRPC_ERROR_REF(error));
} }
void GrpcLb::BalancerCallState::OnInitialRequestSentLocked(void* arg, void GrpcLb::BalancerCallState::OnInitialRequestSentLocked(
grpc_error* error) { void* arg, grpc_error* /*error*/) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg); BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
grpc_byte_buffer_destroy(lb_calld->send_message_payload_); grpc_byte_buffer_destroy(lb_calld->send_message_payload_);
lb_calld->send_message_payload_ = nullptr; lb_calld->send_message_payload_ = nullptr;
@ -1050,7 +1050,7 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceived(void* arg,
} }
void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked( void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked(
void* arg, grpc_error* error) { void* arg, grpc_error* /*error*/) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg); BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
GrpcLb* grpclb_policy = lb_calld->grpclb_policy(); GrpcLb* grpclb_policy = lb_calld->grpclb_policy();
// Null payload means the LB call was cancelled. // Null payload means the LB call was cancelled.
@ -1547,7 +1547,7 @@ void GrpcLb::OnBalancerChannelConnectivityChanged(void* arg,
} }
void GrpcLb::OnBalancerChannelConnectivityChangedLocked(void* arg, void GrpcLb::OnBalancerChannelConnectivityChangedLocked(void* arg,
grpc_error* error) { grpc_error* /*error*/) {
GrpcLb* self = static_cast<GrpcLb*>(arg); GrpcLb* self = static_cast<GrpcLb*>(arg);
if (!self->shutting_down_ && self->fallback_at_startup_checks_pending_) { if (!self->shutting_down_ && self->fallback_at_startup_checks_pending_) {
if (self->lb_channel_connectivity_ != GRPC_CHANNEL_TRANSIENT_FAILURE) { if (self->lb_channel_connectivity_ != GRPC_CHANNEL_TRANSIENT_FAILURE) {

@ -25,7 +25,7 @@
namespace grpc_core { namespace grpc_core {
grpc_channel_args* ModifyGrpclbBalancerChannelArgs( grpc_channel_args* ModifyGrpclbBalancerChannelArgs(
const ServerAddressList& addresses, grpc_channel_args* args) { const ServerAddressList& /*addresses*/, grpc_channel_args* args) {
return args; return args;
} }

@ -112,7 +112,7 @@ class PickFirst : public LoadBalancingPolicy {
explicit Picker(RefCountedPtr<SubchannelInterface> subchannel) explicit Picker(RefCountedPtr<SubchannelInterface> subchannel)
: subchannel_(std::move(subchannel)) {} : subchannel_(std::move(subchannel)) {}
PickResult Pick(PickArgs args) override { PickResult Pick(PickArgs /*args*/) override {
PickResult result; PickResult result;
result.type = PickResult::PICK_COMPLETE; result.type = PickResult::PICK_COMPLETE;
result.subchannel = subchannel_; result.subchannel = subchannel_;
@ -490,7 +490,7 @@ class PickFirstFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kPickFirst; } const char* name() const override { return kPickFirst; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig( RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
const grpc_json* json, grpc_error** error) const override { const grpc_json* json, grpc_error** /*error*/) const override {
if (json != nullptr) { if (json != nullptr) {
GPR_DEBUG_ASSERT(strcmp(json->key, name()) == 0); GPR_DEBUG_ASSERT(strcmp(json->key, name()) == 0);
} }

@ -204,7 +204,7 @@ RoundRobin::Picker::Picker(RoundRobin* parent,
} }
} }
RoundRobin::PickResult RoundRobin::Picker::Pick(PickArgs args) { RoundRobin::PickResult RoundRobin::Picker::Pick(PickArgs /*args*/) {
last_picked_index_ = (last_picked_index_ + 1) % subchannels_.size(); last_picked_index_ = (last_picked_index_ + 1) % subchannels_.size();
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
gpr_log(GPR_INFO, gpr_log(GPR_INFO,
@ -486,7 +486,7 @@ class RoundRobinFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kRoundRobin; } const char* name() const override { return kRoundRobin; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig( RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
const grpc_json* json, grpc_error** error) const override { const grpc_json* json, grpc_error** /*error*/) const override {
if (json != nullptr) { if (json != nullptr) {
GPR_DEBUG_ASSERT(strcmp(json->key, name()) == 0); GPR_DEBUG_ASSERT(strcmp(json->key, name()) == 0);
} }

@ -267,7 +267,8 @@ void SubchannelData<SubchannelListType, SubchannelDataType>::Watcher::
template <typename SubchannelListType, typename SubchannelDataType> template <typename SubchannelListType, typename SubchannelDataType>
SubchannelData<SubchannelListType, SubchannelDataType>::SubchannelData( SubchannelData<SubchannelListType, SubchannelDataType>::SubchannelData(
SubchannelList<SubchannelListType, SubchannelDataType>* subchannel_list, SubchannelList<SubchannelListType, SubchannelDataType>* subchannel_list,
const ServerAddress& address, RefCountedPtr<SubchannelInterface> subchannel) const ServerAddress& /*address*/,
RefCountedPtr<SubchannelInterface> subchannel)
: subchannel_list_(subchannel_list), : subchannel_list_(subchannel_list),
subchannel_(std::move(subchannel)), subchannel_(std::move(subchannel)),
// We assume that the current state is IDLE. If not, we'll get a // We assume that the current state is IDLE. If not, we'll get a
@ -281,7 +282,7 @@ SubchannelData<SubchannelListType, SubchannelDataType>::~SubchannelData() {
template <typename SubchannelListType, typename SubchannelDataType> template <typename SubchannelListType, typename SubchannelDataType>
void SubchannelData<SubchannelListType, SubchannelDataType>:: void SubchannelData<SubchannelListType, SubchannelDataType>::
UnrefSubchannelLocked(const char* reason) { UnrefSubchannelLocked(const char* /*reason*/) {
if (subchannel_ != nullptr) { if (subchannel_ != nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(*subchannel_list_->tracer())) { if (GRPC_TRACE_FLAG_ENABLED(*subchannel_list_->tracer())) {
gpr_log(GPR_INFO, gpr_log(GPR_INFO,

@ -479,8 +479,8 @@ LoadBalancingPolicy::PickResult XdsLb::EndpointPickerWrapper::Pick(
result.recv_trailing_metadata_ready = result.recv_trailing_metadata_ready =
// Note: This callback does not run in either the control plane // Note: This callback does not run in either the control plane
// combiner or in the data plane mutex. // combiner or in the data plane mutex.
[locality_stats](grpc_error* error, MetadataInterface* metadata, [locality_stats](grpc_error* error, MetadataInterface* /*metadata*/,
CallState* call_state) { CallState* /*call_state*/) {
const bool call_failed = error != GRPC_ERROR_NONE; const bool call_failed = error != GRPC_ERROR_NONE;
locality_stats->AddCallFinished(call_failed); locality_stats->AddCallFinished(call_failed);
locality_stats->Unref(DEBUG_LOCATION, "LocalityStats+call"); locality_stats->Unref(DEBUG_LOCATION, "LocalityStats+call");

@ -62,26 +62,26 @@ Subchannel* LocalSubchannelPool::FindSubchannel(SubchannelKey* key) {
namespace { namespace {
void sck_avl_destroy(void* p, void* user_data) { void sck_avl_destroy(void* p, void* /*user_data*/) {
SubchannelKey* key = static_cast<SubchannelKey*>(p); SubchannelKey* key = static_cast<SubchannelKey*>(p);
Delete(key); Delete(key);
} }
void* sck_avl_copy(void* p, void* unused) { void* sck_avl_copy(void* p, void* /*unused*/) {
const SubchannelKey* key = static_cast<const SubchannelKey*>(p); const SubchannelKey* key = static_cast<const SubchannelKey*>(p);
auto new_key = New<SubchannelKey>(*key); auto new_key = New<SubchannelKey>(*key);
return static_cast<void*>(new_key); return static_cast<void*>(new_key);
} }
long sck_avl_compare(void* a, void* b, void* unused) { long sck_avl_compare(void* a, void* b, void* /*unused*/) {
const SubchannelKey* key_a = static_cast<const SubchannelKey*>(a); const SubchannelKey* key_a = static_cast<const SubchannelKey*>(a);
const SubchannelKey* key_b = static_cast<const SubchannelKey*>(b); const SubchannelKey* key_b = static_cast<const SubchannelKey*>(b);
return key_a->Cmp(*key_b); return key_a->Cmp(*key_b);
} }
void scv_avl_destroy(void* p, void* user_data) {} void scv_avl_destroy(void* /*p*/, void* /*user_data*/) {}
void* scv_avl_copy(void* p, void* unused) { return p; } void* scv_avl_copy(void* p, void* /*unused*/) { return p; }
} // namespace } // namespace

Loading…
Cancel
Save