aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/security/json_token_test.cc
diff options
context:
space:
mode:
authorGravatar Noah Eisen <ncteisen@google.com>2018-02-09 09:16:55 -0800
committerGravatar Noah Eisen <ncteisen@google.com>2018-02-09 09:16:55 -0800
commitbe82e64b3debcdb1d9ec6a149fc85af0d46bfb7e (patch)
treecc5e1234073eb250a2c319b5a4db2919fce060ea /test/core/security/json_token_test.cc
parent194436342137924b4fb7429bede037a4b5ec7edb (diff)
Autofix c casts to c++ casts
Diffstat (limited to 'test/core/security/json_token_test.cc')
-rw-r--r--test/core/security/json_token_test.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/core/security/json_token_test.cc b/test/core/security/json_token_test.cc
index aac9cc0029..80bfe45ab3 100644
--- a/test/core/security/json_token_test.cc
+++ b/test/core/security/json_token_test.cc
@@ -218,7 +218,7 @@ static grpc_json* parse_json_part_from_jwt(const char* str, size_t len,
slice = grpc_base64_decode(b64, 1);
GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(slice));
decoded = static_cast<char*>(gpr_malloc(GRPC_SLICE_LENGTH(slice) + 1));
- strncpy(decoded, (const char*)GRPC_SLICE_START_PTR(slice),
+ strncpy(decoded, reinterpret_cast<const char*>GRPC_SLICE_START_PTR(slice),
GRPC_SLICE_LENGTH(slice));
decoded[GRPC_SLICE_LENGTH(slice)] = '\0';
json = grpc_json_parse_string(decoded);
@@ -386,20 +386,20 @@ static void test_jwt_encode_and_sign(
const char* dot = strchr(jwt, '.');
GPR_ASSERT(dot != nullptr);
parsed_header =
- parse_json_part_from_jwt(jwt, (size_t)(dot - jwt), &scratchpad);
+ parse_json_part_from_jwt(jwt, static_cast<size_t>(dot - jwt), &scratchpad);
GPR_ASSERT(parsed_header != nullptr);
check_jwt_header(parsed_header);
- offset = (size_t)(dot - jwt) + 1;
+ offset = static_cast<size_t>(dot - jwt) + 1;
grpc_json_destroy(parsed_header);
gpr_free(scratchpad);
dot = strchr(jwt + offset, '.');
GPR_ASSERT(dot != nullptr);
parsed_claim = parse_json_part_from_jwt(
- jwt + offset, (size_t)(dot - (jwt + offset)), &scratchpad);
+ jwt + offset, static_cast<size_t>(dot - (jwt + offset)), &scratchpad);
GPR_ASSERT(parsed_claim != nullptr);
check_jwt_claim_func(parsed_claim);
- offset = (size_t)(dot - jwt) + 1;
+ offset = static_cast<size_t>(dot - jwt) + 1;
grpc_json_destroy(parsed_claim);
gpr_free(scratchpad);