diff options
author | Noah Eisen <ncteisen@gmail.com> | 2018-02-10 08:58:46 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-10 08:58:46 -0800 |
commit | 10a9e4e4fb5fb6aaacf2d02f10dc7690b98197e7 (patch) | |
tree | ad77e09e79127aaf26911001f884b7ca8c92edc7 /src/core/lib/http/format_request.cc | |
parent | 2650c9730f6b6288a57c5126f629f1e42c2a282c (diff) | |
parent | e1bec40dfb8ff7562fc6a6dafb6d0369294e852f (diff) |
Merge pull request #14150 from ncteisen/more-clang-tidy
Remove and Prohibit C Style Casts
Diffstat (limited to 'src/core/lib/http/format_request.cc')
-rw-r--r-- | src/core/lib/http/format_request.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/lib/http/format_request.cc b/src/core/lib/http/format_request.cc index 884a70e550..6581bef7cd 100644 --- a/src/core/lib/http/format_request.cc +++ b/src/core/lib/http/format_request.cc @@ -89,7 +89,8 @@ grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request* request, if (!has_content_type) { gpr_strvec_add(&out, gpr_strdup("Content-Type: text/plain\r\n")); } - gpr_asprintf(&tmp, "Content-Length: %lu\r\n", (unsigned long)body_size); + gpr_asprintf(&tmp, "Content-Length: %lu\r\n", + static_cast<unsigned long>(body_size)); gpr_strvec_add(&out, tmp); } gpr_strvec_add(&out, gpr_strdup("\r\n")); @@ -97,7 +98,7 @@ grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request* request, gpr_strvec_destroy(&out); if (body_bytes) { - tmp = (char*)gpr_realloc(tmp, out_len + body_size); + tmp = static_cast<char*>(gpr_realloc(tmp, out_len + body_size)); memcpy(tmp + out_len, body_bytes, body_size); out_len += body_size; } |