From be82e64b3debcdb1d9ec6a149fc85af0d46bfb7e Mon Sep 17 00:00:00 2001 From: Noah Eisen Date: Fri, 9 Feb 2018 09:16:55 -0800 Subject: Autofix c casts to c++ casts --- src/core/lib/security/context/security_context.cc | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/core/lib/security/context') diff --git a/src/core/lib/security/context/security_context.cc b/src/core/lib/security/context/security_context.cc index 63ec42cf86..cd8fabea28 100644 --- a/src/core/lib/security/context/security_context.cc +++ b/src/core/lib/security/context/security_context.cc @@ -44,8 +44,8 @@ grpc_call_error grpc_call_set_credentials(grpc_call* call, gpr_log(GPR_ERROR, "Method is client-side only."); return GRPC_CALL_ERROR_NOT_ON_SERVER; } - ctx = (grpc_client_security_context*)grpc_call_context_get( - call, GRPC_CONTEXT_SECURITY); + ctx = static_cast(grpc_call_context_get( + call, GRPC_CONTEXT_SECURITY)); if (ctx == nullptr) { ctx = grpc_client_security_context_create(); ctx->creds = grpc_call_credentials_ref(creds); @@ -80,13 +80,13 @@ void grpc_auth_context_release(grpc_auth_context* context) { /* --- grpc_client_security_context --- */ grpc_client_security_context* grpc_client_security_context_create(void) { - return (grpc_client_security_context*)gpr_zalloc( - sizeof(grpc_client_security_context)); + return static_cast(gpr_zalloc( + sizeof(grpc_client_security_context))); } void grpc_client_security_context_destroy(void* ctx) { grpc_core::ExecCtx exec_ctx; - grpc_client_security_context* c = (grpc_client_security_context*)ctx; + grpc_client_security_context* c = static_cast(ctx); grpc_call_credentials_unref(c->creds); GRPC_AUTH_CONTEXT_UNREF(c->auth_context, "client_security_context"); if (c->extension.instance != nullptr && c->extension.destroy != nullptr) { @@ -98,12 +98,12 @@ void grpc_client_security_context_destroy(void* ctx) { /* --- grpc_server_security_context --- */ grpc_server_security_context* grpc_server_security_context_create(void) { - return (grpc_server_security_context*)gpr_zalloc( - sizeof(grpc_server_security_context)); + return static_cast(gpr_zalloc( + sizeof(grpc_server_security_context))); } void grpc_server_security_context_destroy(void* ctx) { - grpc_server_security_context* c = (grpc_server_security_context*)ctx; + grpc_server_security_context* c = static_cast(ctx); GRPC_AUTH_CONTEXT_UNREF(c->auth_context, "server_security_context"); if (c->extension.instance != nullptr && c->extension.destroy != nullptr) { c->extension.destroy(c->extension.instance); @@ -117,7 +117,7 @@ static grpc_auth_property_iterator empty_iterator = {nullptr, 0, nullptr}; grpc_auth_context* grpc_auth_context_create(grpc_auth_context* chained) { grpc_auth_context* ctx = - (grpc_auth_context*)gpr_zalloc(sizeof(grpc_auth_context)); + static_cast(gpr_zalloc(sizeof(grpc_auth_context))); gpr_ref_init(&ctx->refcount, 1); if (chained != nullptr) { ctx->chained = GRPC_AUTH_CONTEXT_REF(chained, "chained"); @@ -258,9 +258,9 @@ static void ensure_auth_context_capacity(grpc_auth_context* ctx) { if (ctx->properties.count == ctx->properties.capacity) { ctx->properties.capacity = GPR_MAX(ctx->properties.capacity + 8, ctx->properties.capacity * 2); - ctx->properties.array = (grpc_auth_property*)gpr_realloc( + ctx->properties.array = static_cast(gpr_realloc( ctx->properties.array, - ctx->properties.capacity * sizeof(grpc_auth_property)); + ctx->properties.capacity * sizeof(grpc_auth_property))); } } @@ -276,7 +276,7 @@ void grpc_auth_context_add_property(grpc_auth_context* ctx, const char* name, ensure_auth_context_capacity(ctx); prop = &ctx->properties.array[ctx->properties.count++]; prop->name = gpr_strdup(name); - prop->value = (char*)gpr_malloc(value_length + 1); + prop->value = static_cast(gpr_malloc(value_length + 1)); memcpy(prop->value, value, value_length); prop->value[value_length] = '\0'; prop->value_length = value_length; @@ -329,7 +329,7 @@ grpc_auth_context* grpc_auth_context_from_arg(const grpc_arg* arg) { GRPC_AUTH_CONTEXT_ARG); return nullptr; } - return (grpc_auth_context*)arg->value.pointer.p; + return static_cast(arg->value.pointer.p); } grpc_auth_context* grpc_find_auth_context_in_args( -- cgit v1.2.3