Merge pull request #20650 from vjpai/remove_warn_11

Remove unused parameter warnings (11 of 20)
reviewable/pr20542/r3
Vijay Pai 5 years ago committed by GitHub
commit be6911d1d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      test/core/iomgr/threadpool_test.cc
  2. 8
      test/core/iomgr/udp_server_test.cc
  3. 2
      test/core/memory_usage/memory_usage_test.cc
  4. 2
      test/core/memory_usage/server.cc
  5. 5
      test/core/nanopb/fuzzer_response.cc
  6. 5
      test/core/nanopb/fuzzer_serverlist.cc
  7. 2
      test/core/security/alts_credentials_fuzzer.cc
  8. 2
      test/core/security/alts_security_connector_test.cc
  9. 60
      test/core/security/credentials_test.cc
  10. 23
      test/core/security/jwt_verifier_test.cc

@ -55,7 +55,7 @@ class SimpleFunctorForAdd : public grpc_experimental_completion_queue_functor {
}
~SimpleFunctorForAdd() {}
static void Run(struct grpc_experimental_completion_queue_functor* cb,
int ok) {
int /*ok*/) {
auto* callback = static_cast<SimpleFunctorForAdd*>(cb);
callback->count_.FetchAdd(1, grpc_core::MemoryOrder::RELAXED);
}
@ -147,7 +147,7 @@ class SimpleFunctorCheckForAdd
}
~SimpleFunctorCheckForAdd() {}
static void Run(struct grpc_experimental_completion_queue_functor* cb,
int ok) {
int /*ok*/) {
auto* callback = static_cast<SimpleFunctorCheckForAdd*>(cb);
(*callback->count_)++;
GPR_ASSERT(*callback->count_ == callback->internal_success);

@ -85,8 +85,8 @@ class TestGrpcUdpHandler : public GrpcUdpHandler {
return false;
}
void OnCanWrite(void* user_data,
grpc_closure* notify_on_write_closure) override {
void OnCanWrite(void* /*user_data*/,
grpc_closure* /*notify_on_write_closure*/) override {
gpr_mu_lock(g_mu);
g_number_of_writes++;
@ -96,7 +96,7 @@ class TestGrpcUdpHandler : public GrpcUdpHandler {
}
void OnFdAboutToOrphan(grpc_closure* orphan_fd_closure,
void* user_data) override {
void* /*user_data*/) override {
gpr_log(GPR_INFO, "gRPC FD about to be orphaned: %d",
grpc_fd_wrapped_fd(emfd()));
GRPC_CLOSURE_SCHED(orphan_fd_closure, GRPC_ERROR_NONE);
@ -170,7 +170,7 @@ static test_socket_factory* test_socket_factory_create(void) {
return factory;
}
static void destroy_pollset(void* p, grpc_error* error) {
static void destroy_pollset(void* p, grpc_error* /*error*/) {
grpc_pollset_destroy(static_cast<grpc_pollset*>(p));
}

@ -27,7 +27,7 @@
#include "test/core/util/port.h"
#include "test/core/util/subprocess.h"
int main(int argc, char** argv) {
int main(int /*argc*/, char** argv) {
char* me = argv[0];
char* lslash = strrchr(me, '/');
char root[1024];

@ -144,7 +144,7 @@ static void send_snapshot(void* tag, struct grpc_memory_counters* snapshot) {
}
/* We have some sort of deadlock, so let's not exit gracefully for now.
When that is resolved, please remove the #include <unistd.h> above. */
static void sigint_handler(int x) { _exit(0); }
static void sigint_handler(int /*x*/) { _exit(0); }
int main(int argc, char** argv) {
grpc_memory_counters_init();

@ -27,9 +27,10 @@
bool squelch = true;
bool leak_check = true;
static void dont_log(gpr_log_func_args* args) {}
static void dont_log(gpr_log_func_args* /*args*/) {}
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* /*data*/,
size_t /*size*/) {
grpc_init();
if (squelch) gpr_set_log_function(dont_log);
// TODO(veblush): Convert this to upb.

@ -27,9 +27,10 @@
bool squelch = true;
bool leak_check = true;
static void dont_log(gpr_log_func_args* args) {}
static void dont_log(gpr_log_func_args* /*args*/) {}
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* /*data*/,
size_t /*size*/) {
grpc_init();
if (squelch) gpr_set_log_function(dont_log);
// TODO(veblush): Convert this to upb.

@ -40,7 +40,7 @@ using grpc_core::testing::input_stream;
bool squelch = true;
bool leak_check = true;
static void dont_log(gpr_log_func_args* args) {}
static void dont_log(gpr_log_func_args* /*args*/) {}
// Add a random number of target service accounts to client options.
static void read_target_service_accounts(

@ -146,7 +146,7 @@ static void test_alts_peer_to_auth_context_success() {
tsi_peer_destruct(&peer);
}
int main(int argc, char** argv) {
int main(int /*argc*/, char** /*argv*/) {
/* Test. */
test_invalid_input_failure();
test_empty_certificate_type_failure();

@ -428,8 +428,8 @@ class check_channel_oauth2 final : public grpc_channel_credentials {
grpc_core::RefCountedPtr<grpc_channel_security_connector>
create_security_connector(
grpc_core::RefCountedPtr<grpc_call_credentials> call_creds,
const char* target, const grpc_channel_args* args,
grpc_channel_args** new_args) override {
const char* /*target*/, const grpc_channel_args* /*args*/,
grpc_channel_args** /*new_args*/) override {
GPR_ASSERT(strcmp(type(), "mock") == 0);
GPR_ASSERT(call_creds != nullptr);
GPR_ASSERT(strcmp(call_creds->type(), GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) ==
@ -501,8 +501,8 @@ class check_channel_oauth2_google_iam final : public grpc_channel_credentials {
grpc_core::RefCountedPtr<grpc_channel_security_connector>
create_security_connector(
grpc_core::RefCountedPtr<grpc_call_credentials> call_creds,
const char* target, const grpc_channel_args* args,
grpc_channel_args** new_args) override {
const char* /*target*/, const grpc_channel_args* /*args*/,
grpc_channel_args** /*new_args*/) override {
GPR_ASSERT(strcmp(type(), "mock") == 0);
GPR_ASSERT(call_creds != nullptr);
GPR_ASSERT(
@ -560,7 +560,7 @@ static void validate_compute_engine_http_request(
}
static int compute_engine_httpcli_get_success_override(
const grpc_httpcli_request* request, grpc_millis deadline,
const grpc_httpcli_request* request, grpc_millis /*deadline*/,
grpc_closure* on_done, grpc_httpcli_response* response) {
validate_compute_engine_http_request(request);
*response = http_response(200, valid_oauth2_json_response);
@ -569,7 +569,7 @@ static int compute_engine_httpcli_get_success_override(
}
static int compute_engine_httpcli_get_failure_override(
const grpc_httpcli_request* request, grpc_millis deadline,
const grpc_httpcli_request* request, grpc_millis /*deadline*/,
grpc_closure* on_done, grpc_httpcli_response* response) {
validate_compute_engine_http_request(request);
*response = http_response(403, "Not Authorized.");
@ -578,17 +578,16 @@ static int compute_engine_httpcli_get_failure_override(
}
static int httpcli_post_should_not_be_called(
const grpc_httpcli_request* request, const char* body_bytes,
size_t body_size, grpc_millis deadline, grpc_closure* on_done,
grpc_httpcli_response* response) {
const grpc_httpcli_request* /*request*/, const char* /*body_bytes*/,
size_t /*body_size*/, grpc_millis /*deadline*/, grpc_closure* /*on_done*/,
grpc_httpcli_response* /*response*/) {
GPR_ASSERT("HTTP POST should not be called" == nullptr);
return 1;
}
static int httpcli_get_should_not_be_called(const grpc_httpcli_request* request,
grpc_millis deadline,
grpc_closure* on_done,
grpc_httpcli_response* response) {
static int httpcli_get_should_not_be_called(
const grpc_httpcli_request* /*request*/, grpc_millis /*deadline*/,
grpc_closure* /*on_done*/, grpc_httpcli_response* /*response*/) {
GPR_ASSERT("HTTP GET should not be called" == nullptr);
return 1;
}
@ -664,7 +663,7 @@ static void validate_refresh_token_http_request(
static int refresh_token_httpcli_post_success(
const grpc_httpcli_request* request, const char* body, size_t body_size,
grpc_millis deadline, grpc_closure* on_done,
grpc_millis /*deadline*/, grpc_closure* on_done,
grpc_httpcli_response* response) {
validate_refresh_token_http_request(request, body, body_size);
*response = http_response(200, valid_oauth2_json_response);
@ -672,9 +671,10 @@ static int refresh_token_httpcli_post_success(
return 1;
}
static int token_httpcli_post_failure(const grpc_httpcli_request* request,
const char* body, size_t body_size,
grpc_millis deadline,
static int token_httpcli_post_failure(const grpc_httpcli_request* /*request*/,
const char* /*body*/,
size_t /*body_size*/,
grpc_millis /*deadline*/,
grpc_closure* on_done,
grpc_httpcli_response* response) {
*response = http_response(403, "Not Authorized.");
@ -876,7 +876,7 @@ static void validate_sts_token_http_request(const grpc_httpcli_request* request,
static int sts_token_httpcli_post_success(const grpc_httpcli_request* request,
const char* body, size_t body_size,
grpc_millis deadline,
grpc_millis /*deadline*/,
grpc_closure* on_done,
grpc_httpcli_response* response) {
validate_sts_token_http_request(request, body, body_size);
@ -1021,7 +1021,7 @@ static void validate_jwt_encode_and_sign_params(
}
static char* encode_and_sign_jwt_success(const grpc_auth_json_key* json_key,
const char* audience,
const char* /*audience*/,
gpr_timespec token_lifetime,
const char* scope) {
validate_jwt_encode_and_sign_params(json_key, scope, token_lifetime);
@ -1029,7 +1029,7 @@ static char* encode_and_sign_jwt_success(const grpc_auth_json_key* json_key,
}
static char* encode_and_sign_jwt_failure(const grpc_auth_json_key* json_key,
const char* audience,
const char* /*audience*/,
gpr_timespec token_lifetime,
const char* scope) {
validate_jwt_encode_and_sign_params(json_key, scope, token_lifetime);
@ -1037,8 +1037,8 @@ static char* encode_and_sign_jwt_failure(const grpc_auth_json_key* json_key,
}
static char* encode_and_sign_jwt_should_not_be_called(
const grpc_auth_json_key* json_key, const char* audience,
gpr_timespec token_lifetime, const char* scope) {
const grpc_auth_json_key* /*json_key*/, const char* /*audience*/,
gpr_timespec /*token_lifetime*/, const char* /*scope*/) {
GPR_ASSERT("grpc_jwt_encode_and_sign should not be called" == nullptr);
return nullptr;
}
@ -1204,7 +1204,7 @@ static void test_google_default_creds_refresh_token(void) {
}
static int default_creds_metadata_server_detection_httpcli_get_success_override(
const grpc_httpcli_request* request, grpc_millis deadline,
const grpc_httpcli_request* request, grpc_millis /*deadline*/,
grpc_closure* on_done, grpc_httpcli_response* response) {
*response = http_response(200, "");
grpc_http_header* headers =
@ -1300,7 +1300,7 @@ static void test_google_default_creds_non_gce(void) {
}
static int default_creds_gce_detection_httpcli_get_failure_override(
const grpc_httpcli_request* request, grpc_millis deadline,
const grpc_httpcli_request* request, grpc_millis /*deadline*/,
grpc_closure* on_done, grpc_httpcli_response* response) {
/* No magic header. */
GPR_ASSERT(strcmp(request->http.path, "/") == 0);
@ -1342,10 +1342,10 @@ static const expected_md plugin_md[] = {{"foo", "bar"}, {"hi", "there"}};
static int plugin_get_metadata_success(
void* state, grpc_auth_metadata_context context,
grpc_credentials_plugin_metadata_cb cb, void* user_data,
grpc_credentials_plugin_metadata_cb /*cb*/, void* /*user_data*/,
grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
size_t* num_creds_md, grpc_status_code* status,
const char** error_details) {
size_t* num_creds_md, grpc_status_code* /*status*/,
const char** /*error_details*/) {
GPR_ASSERT(strcmp(context.service_url, test_service_url) == 0);
GPR_ASSERT(strcmp(context.method_name, test_method) == 0);
GPR_ASSERT(context.channel_auth_context == nullptr);
@ -1367,9 +1367,9 @@ static const char* plugin_error_details = "Could not get metadata for plugin.";
static int plugin_get_metadata_failure(
void* state, grpc_auth_metadata_context context,
grpc_credentials_plugin_metadata_cb cb, void* user_data,
grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
size_t* num_creds_md, grpc_status_code* status,
grpc_credentials_plugin_metadata_cb /*cb*/, void* /*user_data*/,
grpc_metadata /*creds_md*/[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
size_t* /*num_creds_md*/, grpc_status_code* status,
const char** error_details) {
GPR_ASSERT(strcmp(context.service_url, test_service_url) == 0);
GPR_ASSERT(strcmp(context.method_name, test_method) == 0);

@ -318,15 +318,15 @@ static grpc_httpcli_response http_response(int status, char* body) {
}
static int httpcli_post_should_not_be_called(
const grpc_httpcli_request* request, const char* body_bytes,
size_t body_size, grpc_millis deadline, grpc_closure* on_done,
grpc_httpcli_response* response) {
const grpc_httpcli_request* /*request*/, const char* /*body_bytes*/,
size_t /*body_size*/, grpc_millis /*deadline*/, grpc_closure* /*on_done*/,
grpc_httpcli_response* /*response*/) {
GPR_ASSERT("HTTP POST should not be called" == nullptr);
return 1;
}
static int httpcli_get_google_keys_for_email(
const grpc_httpcli_request* request, grpc_millis deadline,
const grpc_httpcli_request* request, grpc_millis /*deadline*/,
grpc_closure* on_done, grpc_httpcli_response* response) {
*response = http_response(200, good_google_email_keys());
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
@ -372,7 +372,7 @@ static void test_jwt_verifier_google_email_issuer_success(void) {
}
static int httpcli_get_custom_keys_for_email(
const grpc_httpcli_request* request, grpc_millis deadline,
const grpc_httpcli_request* request, grpc_millis /*deadline*/,
grpc_closure* on_done, grpc_httpcli_response* response) {
*response = http_response(200, gpr_strdup(good_jwk_set));
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
@ -405,7 +405,7 @@ static void test_jwt_verifier_custom_email_issuer_success(void) {
}
static int httpcli_get_jwk_set(const grpc_httpcli_request* request,
grpc_millis deadline, grpc_closure* on_done,
grpc_millis /*deadline*/, grpc_closure* on_done,
grpc_httpcli_response* response) {
*response = http_response(200, gpr_strdup(good_jwk_set));
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
@ -416,7 +416,7 @@ static int httpcli_get_jwk_set(const grpc_httpcli_request* request,
}
static int httpcli_get_openid_config(const grpc_httpcli_request* request,
grpc_millis deadline,
grpc_millis /*deadline*/,
grpc_closure* on_done,
grpc_httpcli_response* response) {
*response = http_response(200, gpr_strdup(good_openid_config));
@ -460,7 +460,7 @@ static void on_verification_key_retrieval_error(void* user_data,
}
static int httpcli_get_bad_json(const grpc_httpcli_request* request,
grpc_millis deadline, grpc_closure* on_done,
grpc_millis /*deadline*/, grpc_closure* on_done,
grpc_httpcli_response* response) {
*response = http_response(200, gpr_strdup("{\"bad\": \"stuff\"}"));
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
@ -566,10 +566,9 @@ static void test_jwt_verifier_bad_signature(void) {
grpc_httpcli_set_override(nullptr, nullptr);
}
static int httpcli_get_should_not_be_called(const grpc_httpcli_request* request,
grpc_millis deadline,
grpc_closure* on_done,
grpc_httpcli_response* response) {
static int httpcli_get_should_not_be_called(
const grpc_httpcli_request* /*request*/, grpc_millis /*deadline*/,
grpc_closure* /*on_done*/, grpc_httpcli_response* /*response*/) {
GPR_ASSERT(0);
return 1;
}

Loading…
Cancel
Save