Remove unused parameter warning (1 of 20)

pull/20660/head
Vijay Pai 5 years ago
parent a0ad4081cb
commit 5a88028c89
  1. 2
      src/core/lib/iomgr/executor/threadpool.h
  2. 2
      src/cpp/client/secure_credentials.cc
  3. 16
      src/cpp/common/channel_filter.h
  4. 10
      src/cpp/common/tls_credentials_options_util.cc
  5. 10
      src/cpp/ext/proto_server_reflection.cc
  6. 4
      src/cpp/ext/proto_server_reflection_plugin.cc
  7. 17
      src/cpp/server/channelz/channelz_service.cc
  8. 5
      src/cpp/server/channelz/channelz_service_plugin.cc
  9. 4
      src/cpp/server/health/default_health_check_service.h
  10. 23
      src/cpp/server/server_cc.cc

@ -62,7 +62,7 @@ class ThreadPoolInterface {
// NULL closure.
class ThreadPoolWorker {
public:
ThreadPoolWorker(const char* thd_name, ThreadPoolInterface* pool,
ThreadPoolWorker(const char* thd_name, ThreadPoolInterface* /*pool*/,
MPMCQueueInterface* queue, Thread::Options& options,
int index)
: queue_(queue), thd_name_(thd_name), index_(index) {

@ -382,7 +382,7 @@ std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin(
namespace grpc {
namespace {
void DeleteWrapper(void* wrapper, grpc_error* ignored) {
void DeleteWrapper(void* wrapper, grpc_error* /*ignored*/) {
MetadataCredentialsPluginWrapper* w =
static_cast<MetadataCredentialsPluginWrapper*>(wrapper);
delete w;

@ -236,13 +236,13 @@ class ChannelData {
// TODO(roth): Come up with a more C++-like API for the channel element.
/// Initializes the channel data.
virtual grpc_error* Init(grpc_channel_element* elem,
grpc_channel_element_args* args) {
virtual grpc_error* Init(grpc_channel_element* /*elem*/,
grpc_channel_element_args* /*args*/) {
return GRPC_ERROR_NONE;
}
// Called before destruction.
virtual void Destroy(grpc_channel_element* elem) {}
virtual void Destroy(grpc_channel_element* /*elem*/) {}
virtual void StartTransportOp(grpc_channel_element* elem, TransportOp* op);
@ -259,15 +259,15 @@ class CallData {
// TODO(roth): Come up with a more C++-like API for the call element.
/// Initializes the call data.
virtual grpc_error* Init(grpc_call_element* elem,
const grpc_call_element_args* args) {
virtual grpc_error* Init(grpc_call_element* /*elem*/,
const grpc_call_element_args* /*args*/) {
return GRPC_ERROR_NONE;
}
// Called before destruction.
virtual void Destroy(grpc_call_element* elem,
const grpc_call_final_info* final_info,
grpc_closure* then_call_closure) {}
virtual void Destroy(grpc_call_element* /*elem*/,
const grpc_call_final_info* /*final_info*/,
grpc_closure* /*then_call_closure*/) {}
/// Starts a new stream operation.
virtual void StartTransportStreamOpBatch(grpc_call_element* elem,

@ -57,7 +57,7 @@ grpc_tls_key_materials_config* ConvertToCKeyMaterialsConfig(
/** The C schedule and cancel functions for the credential reload config.
* They populate a C credential reload arg with the result of a C++ credential
* reload schedule/cancel API. **/
int TlsCredentialReloadConfigCSchedule(void* config_user_data,
int TlsCredentialReloadConfigCSchedule(void* /*config_user_data*/,
grpc_tls_credential_reload_arg* arg) {
if (arg == nullptr || arg->config == nullptr ||
arg->config->context() == nullptr) {
@ -71,7 +71,7 @@ int TlsCredentialReloadConfigCSchedule(void* config_user_data,
return schedule_result;
}
void TlsCredentialReloadConfigCCancel(void* config_user_data,
void TlsCredentialReloadConfigCCancel(void* /*config_user_data*/,
grpc_tls_credential_reload_arg* arg) {
if (arg == nullptr || arg->config == nullptr ||
arg->config->context() == nullptr) {
@ -101,7 +101,8 @@ void TlsCredentialReloadArgDestroyContext(void* context) {
* config. They populate a C server authorization check arg with the result
* of a C++ server authorization check schedule/cancel API. **/
int TlsServerAuthorizationCheckConfigCSchedule(
void* config_user_data, grpc_tls_server_authorization_check_arg* arg) {
void* /*config_user_data*/,
grpc_tls_server_authorization_check_arg* arg) {
if (arg == nullptr || arg->config == nullptr ||
arg->config->context() == nullptr) {
gpr_log(GPR_ERROR,
@ -117,7 +118,8 @@ int TlsServerAuthorizationCheckConfigCSchedule(
}
void TlsServerAuthorizationCheckConfigCCancel(
void* config_user_data, grpc_tls_server_authorization_check_arg* arg) {
void* /*config_user_data*/,
grpc_tls_server_authorization_check_arg* arg) {
if (arg == nullptr || arg->config == nullptr ||
arg->config->context() == nullptr) {
gpr_log(GPR_ERROR,

@ -97,7 +97,7 @@ void ProtoServerReflection::FillErrorResponse(const Status& status,
error_response->set_error_message(status.error_message());
}
Status ProtoServerReflection::ListService(ServerContext* context,
Status ProtoServerReflection::ListService(ServerContext* /*context*/,
ListServiceResponse* response) {
if (services_ == nullptr) {
return Status(StatusCode::NOT_FOUND, "Services not found.");
@ -110,7 +110,7 @@ Status ProtoServerReflection::ListService(ServerContext* context,
}
Status ProtoServerReflection::GetFileByName(
ServerContext* context, const grpc::string& filename,
ServerContext* /*context*/, const grpc::string& filename,
ServerReflectionResponse* response) {
if (descriptor_pool_ == nullptr) {
return Status::CANCELLED;
@ -127,7 +127,7 @@ Status ProtoServerReflection::GetFileByName(
}
Status ProtoServerReflection::GetFileContainingSymbol(
ServerContext* context, const grpc::string& symbol,
ServerContext* /*context*/, const grpc::string& symbol,
ServerReflectionResponse* response) {
if (descriptor_pool_ == nullptr) {
return Status::CANCELLED;
@ -144,7 +144,7 @@ Status ProtoServerReflection::GetFileContainingSymbol(
}
Status ProtoServerReflection::GetFileContainingExtension(
ServerContext* context, const ExtensionRequest* request,
ServerContext* /*context*/, const ExtensionRequest* request,
ServerReflectionResponse* response) {
if (descriptor_pool_ == nullptr) {
return Status::CANCELLED;
@ -168,7 +168,7 @@ Status ProtoServerReflection::GetFileContainingExtension(
}
Status ProtoServerReflection::GetAllExtensionNumbers(
ServerContext* context, const grpc::string& type,
ServerContext* /*context*/, const grpc::string& type,
ExtensionNumberResponse* response) {
if (descriptor_pool_ == nullptr) {
return Status::CANCELLED;

@ -41,8 +41,8 @@ void ProtoServerReflectionPlugin::Finish(grpc::ServerInitializer* si) {
reflection_service_->SetServiceList(si->GetServiceList());
}
void ProtoServerReflectionPlugin::ChangeArguments(const grpc::string& name,
void* value) {}
void ProtoServerReflectionPlugin::ChangeArguments(
const grpc::string& /*name*/, void* /*value*/) {}
bool ProtoServerReflectionPlugin::has_sync_methods() const {
if (reflection_service_) {

@ -32,7 +32,8 @@ grpc::protobuf::util::Status ParseJson(const char* json_str,
}
Status ChannelzService::GetTopChannels(
ServerContext* unused, const channelz::v1::GetTopChannelsRequest* request,
ServerContext* /*unused*/,
const channelz::v1::GetTopChannelsRequest* request,
channelz::v1::GetTopChannelsResponse* response) {
char* json_str = grpc_channelz_get_top_channels(request->start_channel_id());
if (json_str == nullptr) {
@ -48,7 +49,7 @@ Status ChannelzService::GetTopChannels(
}
Status ChannelzService::GetServers(
ServerContext* unused, const channelz::v1::GetServersRequest* request,
ServerContext* /*unused*/, const channelz::v1::GetServersRequest* request,
channelz::v1::GetServersResponse* response) {
char* json_str = grpc_channelz_get_servers(request->start_server_id());
if (json_str == nullptr) {
@ -63,7 +64,7 @@ Status ChannelzService::GetServers(
return Status::OK;
}
Status ChannelzService::GetServer(ServerContext* unused,
Status ChannelzService::GetServer(ServerContext* /*unused*/,
const channelz::v1::GetServerRequest* request,
channelz::v1::GetServerResponse* response) {
char* json_str = grpc_channelz_get_server(request->server_id());
@ -80,7 +81,8 @@ Status ChannelzService::GetServer(ServerContext* unused,
}
Status ChannelzService::GetServerSockets(
ServerContext* unused, const channelz::v1::GetServerSocketsRequest* request,
ServerContext* /*unused*/,
const channelz::v1::GetServerSocketsRequest* request,
channelz::v1::GetServerSocketsResponse* response) {
char* json_str = grpc_channelz_get_server_sockets(
request->server_id(), request->start_socket_id(), request->max_results());
@ -97,7 +99,7 @@ Status ChannelzService::GetServerSockets(
}
Status ChannelzService::GetChannel(
ServerContext* unused, const channelz::v1::GetChannelRequest* request,
ServerContext* /*unused*/, const channelz::v1::GetChannelRequest* request,
channelz::v1::GetChannelResponse* response) {
char* json_str = grpc_channelz_get_channel(request->channel_id());
if (json_str == nullptr) {
@ -112,7 +114,8 @@ Status ChannelzService::GetChannel(
}
Status ChannelzService::GetSubchannel(
ServerContext* unused, const channelz::v1::GetSubchannelRequest* request,
ServerContext* /*unused*/,
const channelz::v1::GetSubchannelRequest* request,
channelz::v1::GetSubchannelResponse* response) {
char* json_str = grpc_channelz_get_subchannel(request->subchannel_id());
if (json_str == nullptr) {
@ -127,7 +130,7 @@ Status ChannelzService::GetSubchannel(
return Status::OK;
}
Status ChannelzService::GetSocket(ServerContext* unused,
Status ChannelzService::GetSocket(ServerContext* /*unused*/,
const channelz::v1::GetSocketRequest* request,
channelz::v1::GetSocketResponse* response) {
char* json_str = grpc_channelz_get_socket(request->socket_id());

@ -39,9 +39,10 @@ class ChannelzServicePlugin : public ::grpc::ServerBuilderPlugin {
si->RegisterService(channelz_service_);
}
void Finish(grpc::ServerInitializer* si) override {}
void Finish(grpc::ServerInitializer* /*si*/) override {}
void ChangeArguments(const grpc::string& name, void* value) override {}
void ChangeArguments(const grpc::string& /*name*/,
void* /*value*/) override {}
bool has_sync_methods() const override {
if (channelz_service_) {

@ -120,8 +120,8 @@ class DefaultHealthCheckService final : public HealthCheckServiceInterface {
HealthCheckServiceImpl* service);
// Not used for Check.
void SendHealth(std::shared_ptr<CallHandler> self,
ServingStatus status) override {}
void SendHealth(std::shared_ptr<CallHandler> /*self*/,
ServingStatus /*status*/) override {}
private:
// Called when we receive a call.

@ -75,8 +75,8 @@ namespace {
class DefaultGlobalCallbacks final : public Server::GlobalCallbacks {
public:
~DefaultGlobalCallbacks() override {}
void PreSynchronousRequest(ServerContext* context) override {}
void PostSynchronousRequest(ServerContext* context) override {}
void PreSynchronousRequest(ServerContext* /*context*/) override {}
void PostSynchronousRequest(ServerContext* /*context*/) override {}
};
std::shared_ptr<Server::GlobalCallbacks> g_callbacks = nullptr;
@ -90,12 +90,12 @@ void InitGlobalCallbacks() {
class ShutdownTag : public internal::CompletionQueueTag {
public:
bool FinalizeResult(void** tag, bool* status) { return false; }
bool FinalizeResult(void** /*tag*/, bool* /*status*/) { return false; }
};
class DummyTag : public internal::CompletionQueueTag {
public:
bool FinalizeResult(void** tag, bool* status) { return true; }
bool FinalizeResult(void** /*tag*/, bool* /*status*/) { return true; }
};
class UnimplementedAsyncRequestContext {
@ -185,10 +185,11 @@ void ServerInterface::BaseAsyncRequest::
// Queue a tag which will be returned immediately
grpc_core::ExecCtx exec_ctx;
grpc_cq_begin_op(notification_cq_->cq(), this);
grpc_cq_end_op(
notification_cq_->cq(), this, GRPC_ERROR_NONE,
[](void* arg, grpc_cq_completion* completion) { delete completion; },
nullptr, new grpc_cq_completion());
grpc_cq_end_op(notification_cq_->cq(), this, GRPC_ERROR_NONE,
[](void* /*arg*/, grpc_cq_completion* completion) {
delete completion;
},
nullptr, new grpc_cq_completion());
}
ServerInterface::RegisteredAsyncRequest::RegisteredAsyncRequest(
@ -395,7 +396,7 @@ class Server::SyncRequest final : public grpc::internal::CompletionQueueTag {
}
}
bool FinalizeResult(void** tag, bool* status) override {
bool FinalizeResult(void** /*tag*/, bool* status) override {
if (!*status) {
grpc_completion_queue_destroy(cq_);
cq_ = nullptr;
@ -785,13 +786,13 @@ class Server::CallbackRequest final : public Server::CallbackRequestBase {
template <>
bool Server::CallbackRequest<grpc::ServerContext>::FinalizeResult(
void** tag, bool* status) {
void** /*tag*/, bool* /*status*/) {
return false;
}
template <>
bool Server::CallbackRequest<grpc::GenericServerContext>::FinalizeResult(
void** tag, bool* status) {
void** /*tag*/, bool* status) {
if (*status) {
// TODO(yangg) remove the copy here
ctx_.method_ = grpc::StringFromCopiedSlice(call_details_->method);

Loading…
Cancel
Save