From d41a4a720f76c6555b80f82ee771071e09d55e03 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 26 Oct 2016 16:16:06 -0700 Subject: s/gpr_slice/grpc_slice, and move around tests, impls --- test/core/http/format_request_test.c | 24 ++++++++++++------------ test/core/http/parser_test.c | 32 ++++++++++++++++---------------- test/core/http/request_fuzzer.c | 4 ++-- test/core/http/response_fuzzer.c | 4 ++-- 4 files changed, 32 insertions(+), 32 deletions(-) (limited to 'test/core/http') diff --git a/test/core/http/format_request_test.c b/test/core/http/format_request_test.c index 0d21e1200b..bd31e5e8ab 100644 --- a/test/core/http/format_request_test.c +++ b/test/core/http/format_request_test.c @@ -41,7 +41,7 @@ static void test_format_get_request(void) { grpc_http_header hdr = {"x-yz", "abc"}; grpc_httpcli_request req; - gpr_slice slice; + grpc_slice slice; memset(&req, 0, sizeof(req)); req.host = "example.com"; @@ -51,7 +51,7 @@ static void test_format_get_request(void) { slice = grpc_httpcli_format_get_request(&req); - GPR_ASSERT(0 == gpr_slice_str_cmp(slice, + GPR_ASSERT(0 == grpc_slice_str_cmp(slice, "GET /index.html HTTP/1.0\r\n" "Host: example.com\r\n" "Connection: close\r\n" @@ -60,13 +60,13 @@ static void test_format_get_request(void) { "x-yz: abc\r\n" "\r\n")); - gpr_slice_unref(slice); + grpc_slice_unref(slice); } static void test_format_post_request(void) { grpc_http_header hdr = {"x-yz", "abc"}; grpc_httpcli_request req; - gpr_slice slice; + grpc_slice slice; char body_bytes[] = "fake body"; size_t body_len = 9; @@ -78,7 +78,7 @@ static void test_format_post_request(void) { slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len); - GPR_ASSERT(0 == gpr_slice_str_cmp(slice, + GPR_ASSERT(0 == grpc_slice_str_cmp(slice, "POST /index.html HTTP/1.0\r\n" "Host: example.com\r\n" "Connection: close\r\n" @@ -90,13 +90,13 @@ static void test_format_post_request(void) { "\r\n" "fake body")); - gpr_slice_unref(slice); + grpc_slice_unref(slice); } static void test_format_post_request_no_body(void) { grpc_http_header hdr = {"x-yz", "abc"}; grpc_httpcli_request req; - gpr_slice slice; + grpc_slice slice; memset(&req, 0, sizeof(req)); req.host = "example.com"; @@ -106,7 +106,7 @@ static void test_format_post_request_no_body(void) { slice = grpc_httpcli_format_post_request(&req, NULL, 0); - GPR_ASSERT(0 == gpr_slice_str_cmp(slice, + GPR_ASSERT(0 == grpc_slice_str_cmp(slice, "POST /index.html HTTP/1.0\r\n" "Host: example.com\r\n" "Connection: close\r\n" @@ -115,13 +115,13 @@ static void test_format_post_request_no_body(void) { "x-yz: abc\r\n" "\r\n")); - gpr_slice_unref(slice); + grpc_slice_unref(slice); } static void test_format_post_request_content_type_override(void) { grpc_http_header hdrs[2]; grpc_httpcli_request req; - gpr_slice slice; + grpc_slice slice; char body_bytes[] = "fake%20body"; size_t body_len = 11; @@ -137,7 +137,7 @@ static void test_format_post_request_content_type_override(void) { slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len); - GPR_ASSERT(0 == gpr_slice_str_cmp( + GPR_ASSERT(0 == grpc_slice_str_cmp( slice, "POST /index.html HTTP/1.0\r\n" "Host: example.com\r\n" @@ -149,7 +149,7 @@ static void test_format_post_request_content_type_override(void) { "\r\n" "fake%20body")); - gpr_slice_unref(slice); + grpc_slice_unref(slice); } int main(int argc, char **argv) { diff --git a/test/core/http/parser_test.c b/test/core/http/parser_test.c index 2fc354d9ee..4f1445d3f1 100644 --- a/test/core/http/parser_test.c +++ b/test/core/http/parser_test.c @@ -48,23 +48,23 @@ static void test_request_succeeds(grpc_slice_split_mode split_mode, grpc_http_version expect_version, char *expect_path, char *expect_body, ...) { grpc_http_parser parser; - gpr_slice input_slice = gpr_slice_from_copied_string(request_text); + grpc_slice input_slice = grpc_slice_from_copied_string(request_text); size_t num_slices; size_t i; - gpr_slice *slices; + grpc_slice *slices; va_list args; grpc_http_request request; memset(&request, 0, sizeof(request)); grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices); - gpr_slice_unref(input_slice); + grpc_slice_unref(input_slice); grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request); for (i = 0; i < num_slices; i++) { GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i], NULL) == GRPC_ERROR_NONE); - gpr_slice_unref(slices[i]); + grpc_slice_unref(slices[i]); } GPR_ASSERT(grpc_http_parser_eof(&parser) == GRPC_ERROR_NONE); @@ -105,23 +105,23 @@ static void test_request_succeeds(grpc_slice_split_mode split_mode, static void test_succeeds(grpc_slice_split_mode split_mode, char *response_text, int expect_status, char *expect_body, ...) { grpc_http_parser parser; - gpr_slice input_slice = gpr_slice_from_copied_string(response_text); + grpc_slice input_slice = grpc_slice_from_copied_string(response_text); size_t num_slices; size_t i; - gpr_slice *slices; + grpc_slice *slices; va_list args; grpc_http_response response; memset(&response, 0, sizeof(response)); grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices); - gpr_slice_unref(input_slice); + grpc_slice_unref(input_slice); grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response); for (i = 0; i < num_slices; i++) { GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i], NULL) == GRPC_ERROR_NONE); - gpr_slice_unref(slices[i]); + grpc_slice_unref(slices[i]); } GPR_ASSERT(grpc_http_parser_eof(&parser) == GRPC_ERROR_NONE); @@ -158,16 +158,16 @@ static void test_succeeds(grpc_slice_split_mode split_mode, char *response_text, static void test_fails(grpc_slice_split_mode split_mode, char *response_text) { grpc_http_parser parser; - gpr_slice input_slice = gpr_slice_from_copied_string(response_text); + grpc_slice input_slice = grpc_slice_from_copied_string(response_text); size_t num_slices; size_t i; - gpr_slice *slices; + grpc_slice *slices; grpc_error *error = GRPC_ERROR_NONE; grpc_http_response response; memset(&response, 0, sizeof(response)); grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices); - gpr_slice_unref(input_slice); + grpc_slice_unref(input_slice); grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response); @@ -175,7 +175,7 @@ static void test_fails(grpc_slice_split_mode split_mode, char *response_text) { if (GRPC_ERROR_NONE == error) { error = grpc_http_parser_parse(&parser, slices[i], NULL); } - gpr_slice_unref(slices[i]); + grpc_slice_unref(slices[i]); } if (GRPC_ERROR_NONE == error) { error = grpc_http_parser_eof(&parser); @@ -191,16 +191,16 @@ static void test_fails(grpc_slice_split_mode split_mode, char *response_text) { static void test_request_fails(grpc_slice_split_mode split_mode, char *request_text) { grpc_http_parser parser; - gpr_slice input_slice = gpr_slice_from_copied_string(request_text); + grpc_slice input_slice = grpc_slice_from_copied_string(request_text); size_t num_slices; size_t i; - gpr_slice *slices; + grpc_slice *slices; grpc_error *error = GRPC_ERROR_NONE; grpc_http_request request; memset(&request, 0, sizeof(request)); grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices); - gpr_slice_unref(input_slice); + grpc_slice_unref(input_slice); grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request); @@ -208,7 +208,7 @@ static void test_request_fails(grpc_slice_split_mode split_mode, if (error == GRPC_ERROR_NONE) { error = grpc_http_parser_parse(&parser, slices[i], NULL); } - gpr_slice_unref(slices[i]); + grpc_slice_unref(slices[i]); } if (error == GRPC_ERROR_NONE) { error = grpc_http_parser_eof(&parser); diff --git a/test/core/http/request_fuzzer.c b/test/core/http/request_fuzzer.c index bb6cb92c0c..98e2c9680d 100644 --- a/test/core/http/request_fuzzer.c +++ b/test/core/http/request_fuzzer.c @@ -47,10 +47,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_http_request request; memset(&request, 0, sizeof(request)); grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request); - gpr_slice slice = gpr_slice_from_copied_buffer((const char *)data, size); + grpc_slice slice = grpc_slice_from_copied_buffer((const char *)data, size); GRPC_ERROR_UNREF(grpc_http_parser_parse(&parser, slice, NULL)); GRPC_ERROR_UNREF(grpc_http_parser_eof(&parser)); - gpr_slice_unref(slice); + grpc_slice_unref(slice); grpc_http_parser_destroy(&parser); grpc_http_request_destroy(&request); return 0; diff --git a/test/core/http/response_fuzzer.c b/test/core/http/response_fuzzer.c index 4393840484..fff04117b2 100644 --- a/test/core/http/response_fuzzer.c +++ b/test/core/http/response_fuzzer.c @@ -46,10 +46,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_http_response response; memset(&response, 0, sizeof(response)); grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response); - gpr_slice slice = gpr_slice_from_copied_buffer((const char *)data, size); + grpc_slice slice = grpc_slice_from_copied_buffer((const char *)data, size); GRPC_ERROR_UNREF(grpc_http_parser_parse(&parser, slice, NULL)); GRPC_ERROR_UNREF(grpc_http_parser_eof(&parser)); - gpr_slice_unref(slice); + grpc_slice_unref(slice); grpc_http_parser_destroy(&parser); grpc_http_response_destroy(&response); return 0; -- cgit v1.2.3 From 28b72428a84ae7d23c106fb282478fa94951c9c0 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 26 Oct 2016 21:15:29 -0700 Subject: clang-format --- include/grpc++/impl/codegen/core_codegen.h | 2 +- .../grpc++/impl/codegen/core_codegen_interface.h | 3 +- include/grpc/slice_buffer.h | 10 ++--- src/core/ext/census/grpc_filter.c | 2 +- .../ext/client_channel/http_connect_handshaker.c | 8 ++-- .../ext/transport/chttp2/transport/bin_decoder.h | 2 +- .../ext/transport/chttp2/transport/bin_encoder.c | 9 ++-- .../ext/transport/chttp2/transport/bin_encoder.h | 3 +- src/core/ext/transport/chttp2/transport/frame.h | 2 +- .../ext/transport/chttp2/transport/frame_goaway.h | 2 +- .../ext/transport/chttp2/transport/frame_ping.c | 2 +- .../transport/chttp2/transport/frame_rst_stream.c | 2 +- .../transport/chttp2/transport/frame_rst_stream.h | 2 +- .../transport/chttp2/transport/frame_settings.c | 2 +- .../transport/chttp2/transport/frame_settings.h | 4 +- .../chttp2/transport/frame_window_update.h | 4 +- .../ext/transport/chttp2/transport/hpack_encoder.c | 5 ++- .../ext/transport/chttp2/transport/hpack_encoder.h | 2 +- .../ext/transport/chttp2/transport/hpack_parser.c | 6 +-- .../ext/transport/chttp2/transport/hpack_table.h | 2 +- src/core/ext/transport/chttp2/transport/internal.h | 3 +- src/core/ext/transport/chttp2/transport/parsing.c | 18 ++++---- src/core/ext/transport/chttp2/transport/writing.c | 10 ++--- .../transport/cronet/transport/cronet_transport.c | 4 +- src/core/lib/channel/compress_filter.c | 2 +- src/core/lib/channel/connected_channel.c | 2 +- src/core/lib/channel/handshaker.c | 4 +- src/core/lib/channel/http_server_filter.c | 2 +- src/core/lib/http/format_request.c | 9 ++-- src/core/lib/http/format_request.h | 4 +- src/core/lib/http/parser.h | 2 +- src/core/lib/iomgr/resource_quota.c | 2 +- src/core/lib/iomgr/tcp_client_windows.c | 2 +- src/core/lib/iomgr/tcp_windows.c | 2 +- src/core/lib/security/transport/handshake.c | 2 +- .../lib/security/transport/security_connector.c | 2 +- src/core/lib/security/util/b64.c | 2 +- src/core/lib/security/util/b64.h | 2 +- src/core/lib/slice/slice.c | 10 ++--- src/core/lib/slice/slice_buffer.c | 12 +++--- src/core/lib/surface/byte_buffer.c | 3 +- src/core/lib/surface/byte_buffer_reader.c | 2 +- src/core/lib/transport/metadata_batch.h | 2 +- src/cpp/client/channel_cc.cc | 2 +- src/cpp/common/core_codegen.cc | 11 +++-- test/core/compression/message_compress_test.c | 14 +++---- test/core/end2end/cq_verifier.c | 3 +- test/core/end2end/invalid_call_argument_test.c | 3 +- test/core/end2end/tests/binary_metadata.c | 6 ++- test/core/end2end/tests/call_creds.c | 9 ++-- test/core/end2end/tests/cancel_after_accept.c | 6 ++- test/core/end2end/tests/cancel_after_client_done.c | 6 ++- test/core/end2end/tests/cancel_after_invoke.c | 3 +- test/core/end2end/tests/cancel_before_invoke.c | 3 +- test/core/end2end/tests/compressed_payload.c | 3 +- test/core/end2end/tests/filter_call_init_fails.c | 3 +- test/core/end2end/tests/filter_causes_close.c | 3 +- test/core/end2end/tests/large_metadata.c | 3 +- test/core/end2end/tests/load_reporting_hook.c | 3 +- test/core/end2end/tests/max_message_length.c | 3 +- test/core/end2end/tests/network_status_change.c | 3 +- test/core/end2end/tests/payload.c | 3 +- test/core/end2end/tests/ping_pong_streaming.c | 6 ++- test/core/end2end/tests/request_with_flags.c | 3 +- test/core/end2end/tests/request_with_payload.c | 3 +- test/core/end2end/tests/resource_quota_server.c | 3 +- test/core/end2end/tests/simple_cacheable_request.c | 6 ++- test/core/end2end/tests/simple_metadata.c | 6 ++- test/core/end2end/tests/trailing_metadata.c | 6 ++- test/core/http/format_request_test.c | 48 +++++++++++----------- test/core/iomgr/endpoint_tests.c | 6 +-- test/core/iomgr/load_file_test.c | 2 +- test/core/iomgr/tcp_posix_test.c | 4 +- test/core/security/b64_test.c | 2 +- test/core/security/create_jwt.c | 2 +- test/core/security/credentials_test.c | 7 ++-- test/core/security/fetch_oauth2.c | 2 +- test/core/security/json_token_test.c | 2 +- test/core/security/jwt_verifier_test.c | 6 +-- test/core/security/oauth2_utils.c | 2 +- .../security/print_google_default_creds_token.c | 2 +- test/core/security/verify_jwt.c | 2 +- test/core/slice/slice_buffer_test.c | 2 +- test/core/slice/slice_test.c | 11 ++--- test/core/transport/chttp2/hpack_parser_test.c | 2 +- test/core/transport/chttp2/varint_test.c | 5 ++- test/core/util/mock_endpoint.h | 3 +- test/core/util/one_corpus_entry_fuzzer.c | 3 +- test/cpp/grpclb/grpclb_test.cc | 3 +- test/cpp/util/cli_call.cc | 2 +- 90 files changed, 235 insertions(+), 183 deletions(-) (limited to 'test/core/http') diff --git a/include/grpc++/impl/codegen/core_codegen.h b/include/grpc++/impl/codegen/core_codegen.h index c2127a771a..6ab0e17db9 100644 --- a/include/grpc++/impl/codegen/core_codegen.h +++ b/include/grpc++/impl/codegen/core_codegen.h @@ -82,7 +82,7 @@ class CoreCodegen : public CoreCodegenInterface { void grpc_slice_unref(grpc_slice slice) GRPC_OVERRIDE; grpc_slice grpc_slice_split_tail(grpc_slice* s, size_t split) GRPC_OVERRIDE; void grpc_slice_buffer_add(grpc_slice_buffer* sb, - grpc_slice slice) GRPC_OVERRIDE; + grpc_slice slice) GRPC_OVERRIDE; void grpc_slice_buffer_pop(grpc_slice_buffer* sb) GRPC_OVERRIDE; void grpc_metadata_array_init(grpc_metadata_array* array) GRPC_OVERRIDE; diff --git a/include/grpc++/impl/codegen/core_codegen_interface.h b/include/grpc++/impl/codegen/core_codegen_interface.h index 743f528373..4783a43454 100644 --- a/include/grpc++/impl/codegen/core_codegen_interface.h +++ b/include/grpc++/impl/codegen/core_codegen_interface.h @@ -96,7 +96,8 @@ class CoreCodegenInterface { virtual grpc_slice grpc_slice_malloc(size_t length) = 0; virtual void grpc_slice_unref(grpc_slice slice) = 0; virtual grpc_slice grpc_slice_split_tail(grpc_slice* s, size_t split) = 0; - virtual void grpc_slice_buffer_add(grpc_slice_buffer* sb, grpc_slice slice) = 0; + virtual void grpc_slice_buffer_add(grpc_slice_buffer* sb, + grpc_slice slice) = 0; virtual void grpc_slice_buffer_pop(grpc_slice_buffer* sb) = 0; virtual void grpc_metadata_array_init(grpc_metadata_array* array) = 0; diff --git a/include/grpc/slice_buffer.h b/include/grpc/slice_buffer.h index 44876f5a30..f1de653af4 100644 --- a/include/grpc/slice_buffer.h +++ b/include/grpc/slice_buffer.h @@ -56,9 +56,9 @@ GPRAPI void grpc_slice_buffer_add(grpc_slice_buffer *sb, grpc_slice slice); The implementation MAY decide to concatenate data at the end of a small slice added in this fashion. */ GPRAPI size_t grpc_slice_buffer_add_indexed(grpc_slice_buffer *sb, - grpc_slice slice); + grpc_slice slice); GPRAPI void grpc_slice_buffer_addn(grpc_slice_buffer *sb, grpc_slice *slices, - size_t n); + size_t n); /* add a very small (less than 8 bytes) amount of data to the end of a slice buffer: returns a pointer into which to add the data */ GPRAPI uint8_t *grpc_slice_buffer_tiny_add(grpc_slice_buffer *sb, size_t len); @@ -70,13 +70,13 @@ GPRAPI void grpc_slice_buffer_reset_and_unref(grpc_slice_buffer *sb); GPRAPI void grpc_slice_buffer_swap(grpc_slice_buffer *a, grpc_slice_buffer *b); /* move all of the elements of src into dst */ GPRAPI void grpc_slice_buffer_move_into(grpc_slice_buffer *src, - grpc_slice_buffer *dst); + grpc_slice_buffer *dst); /* remove n bytes from the end of a slice buffer */ GPRAPI void grpc_slice_buffer_trim_end(grpc_slice_buffer *src, size_t n, - grpc_slice_buffer *garbage); + grpc_slice_buffer *garbage); /* move the first n bytes of src into dst */ GPRAPI void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n, - grpc_slice_buffer *dst); + grpc_slice_buffer *dst); /* take the first slice in the slice buffer */ GPRAPI grpc_slice grpc_slice_buffer_take_first(grpc_slice_buffer *src); diff --git a/src/core/ext/census/grpc_filter.c b/src/core/ext/census/grpc_filter.c index aa6d24e076..5a283de468 100644 --- a/src/core/ext/census/grpc_filter.c +++ b/src/core/ext/census/grpc_filter.c @@ -37,9 +37,9 @@ #include #include +#include #include #include -#include #include #include "src/core/ext/census/census_interface.h" diff --git a/src/core/ext/client_channel/http_connect_handshaker.c b/src/core/ext/client_channel/http_connect_handshaker.c index 6f1956add9..82042897b2 100644 --- a/src/core/ext/client_channel/http_connect_handshaker.c +++ b/src/core/ext/client_channel/http_connect_handshaker.c @@ -35,9 +35,9 @@ #include +#include #include #include -#include #include #include "src/core/ext/client_channel/uri_parser.h" @@ -136,11 +136,11 @@ static void on_read_done(grpc_exec_ctx* exec_ctx, void* arg, grpc_slice_buffer_add( &tmp_buffer, grpc_slice_split_tail(&handshaker->read_buffer->slices[i], - body_start_offset)); + body_start_offset)); } grpc_slice_buffer_addn(&tmp_buffer, - &handshaker->read_buffer->slices[i + 1], - handshaker->read_buffer->count - i - 1); + &handshaker->read_buffer->slices[i + 1], + handshaker->read_buffer->count - i - 1); grpc_slice_buffer_swap(handshaker->read_buffer, &tmp_buffer); grpc_slice_buffer_destroy(&tmp_buffer); break; diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.h b/src/core/ext/transport/chttp2/transport/bin_decoder.h index 5e00fd8143..83a90be519 100644 --- a/src/core/ext/transport/chttp2/transport/bin_decoder.h +++ b/src/core/ext/transport/chttp2/transport/bin_decoder.h @@ -61,6 +61,6 @@ grpc_slice grpc_chttp2_base64_decode(grpc_slice input); slice, does not take ownership of the input. Returns an empty slice if decoding is failed. */ grpc_slice grpc_chttp2_base64_decode_with_length(grpc_slice input, - size_t output_length); + size_t output_length); #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H */ diff --git a/src/core/ext/transport/chttp2/transport/bin_encoder.c b/src/core/ext/transport/chttp2/transport/bin_encoder.c index 2baa1dc97b..af25a4352a 100644 --- a/src/core/ext/transport/chttp2/transport/bin_encoder.c +++ b/src/core/ext/transport/chttp2/transport/bin_encoder.c @@ -114,13 +114,15 @@ grpc_slice grpc_chttp2_huffman_compress(grpc_slice input) { uint32_t temp_length = 0; nbits = 0; - for (in = GRPC_SLICE_START_PTR(input); in != GRPC_SLICE_END_PTR(input); ++in) { + for (in = GRPC_SLICE_START_PTR(input); in != GRPC_SLICE_END_PTR(input); + ++in) { nbits += grpc_chttp2_huffsyms[*in].length; } output = grpc_slice_malloc(nbits / 8 + (nbits % 8 != 0)); out = GRPC_SLICE_START_PTR(output); - for (in = GRPC_SLICE_START_PTR(input); in != GRPC_SLICE_END_PTR(input); ++in) { + for (in = GRPC_SLICE_START_PTR(input); in != GRPC_SLICE_END_PTR(input); + ++in) { int sym = *in; temp <<= grpc_chttp2_huffsyms[sym].length; temp |= grpc_chttp2_huffsyms[sym].bits; @@ -175,7 +177,8 @@ static void enc_add1(huff_out *out, uint8_t a) { enc_flush_some(out); } -grpc_slice grpc_chttp2_base64_encode_and_huffman_compress_impl(grpc_slice input) { +grpc_slice grpc_chttp2_base64_encode_and_huffman_compress_impl( + grpc_slice input) { size_t input_length = GRPC_SLICE_LENGTH(input); size_t input_triplets = input_length / 3; size_t tail_case = input_length % 3; diff --git a/src/core/ext/transport/chttp2/transport/bin_encoder.h b/src/core/ext/transport/chttp2/transport/bin_encoder.h index 3d86a41a11..9e143b46e2 100644 --- a/src/core/ext/transport/chttp2/transport/bin_encoder.h +++ b/src/core/ext/transport/chttp2/transport/bin_encoder.h @@ -49,6 +49,7 @@ grpc_slice grpc_chttp2_huffman_compress(grpc_slice input); grpc_slice y = grpc_chttp2_huffman_compress(x); grpc_slice_unref(x); return y; */ -grpc_slice grpc_chttp2_base64_encode_and_huffman_compress_impl(grpc_slice input); +grpc_slice grpc_chttp2_base64_encode_and_huffman_compress_impl( + grpc_slice input); #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H */ diff --git a/src/core/ext/transport/chttp2/transport/frame.h b/src/core/ext/transport/chttp2/transport/frame.h index 0b3842b4a1..ffd4d9669b 100644 --- a/src/core/ext/transport/chttp2/transport/frame.h +++ b/src/core/ext/transport/chttp2/transport/frame.h @@ -34,8 +34,8 @@ #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_H -#include #include +#include #include "src/core/lib/iomgr/error.h" diff --git a/src/core/ext/transport/chttp2/transport/frame_goaway.h b/src/core/ext/transport/chttp2/transport/frame_goaway.h index 927b7fbd48..21fe819488 100644 --- a/src/core/ext/transport/chttp2/transport/frame_goaway.h +++ b/src/core/ext/transport/chttp2/transport/frame_goaway.h @@ -34,9 +34,9 @@ #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H -#include #include #include +#include #include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/lib/iomgr/exec_ctx.h" diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.c b/src/core/ext/transport/chttp2/transport/frame_ping.c index 18ecb4d1e9..7de5f6362d 100644 --- a/src/core/ext/transport/chttp2/transport/frame_ping.c +++ b/src/core/ext/transport/chttp2/transport/frame_ping.c @@ -94,7 +94,7 @@ grpc_error *grpc_chttp2_ping_parser_parse(grpc_exec_ctx *exec_ctx, void *parser, grpc_chttp2_ack_ping(exec_ctx, t, p->opaque_8bytes); } else { grpc_slice_buffer_add(&t->qbuf, - grpc_chttp2_ping_create(1, p->opaque_8bytes)); + grpc_chttp2_ping_create(1, p->opaque_8bytes)); grpc_chttp2_initiate_write(exec_ctx, t, false, "ping response"); } } diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.c b/src/core/ext/transport/chttp2/transport/frame_rst_stream.c index 75e4101035..b4c5ed769b 100644 --- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.c +++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.c @@ -43,7 +43,7 @@ #include "src/core/ext/transport/chttp2/transport/status_conversion.h" grpc_slice grpc_chttp2_rst_stream_create(uint32_t id, uint32_t code, - grpc_transport_one_way_stats *stats) { + grpc_transport_one_way_stats *stats) { static const size_t frame_size = 13; grpc_slice slice = grpc_slice_malloc(frame_size); stats->framing_bytes += frame_size; diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h index f39002a3e9..779507a617 100644 --- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h @@ -45,7 +45,7 @@ typedef struct { } grpc_chttp2_rst_stream_parser; grpc_slice grpc_chttp2_rst_stream_create(uint32_t stream_id, uint32_t code, - grpc_transport_one_way_stats *stats); + grpc_transport_one_way_stats *stats); grpc_error *grpc_chttp2_rst_stream_parser_begin_frame( grpc_chttp2_rst_stream_parser *parser, uint32_t length, uint8_t flags); diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.c b/src/core/ext/transport/chttp2/transport/frame_settings.c index d3b235183b..98facae87f 100644 --- a/src/core/ext/transport/chttp2/transport/frame_settings.c +++ b/src/core/ext/transport/chttp2/transport/frame_settings.c @@ -83,7 +83,7 @@ static uint8_t *fill_header(uint8_t *out, uint32_t length, uint8_t flags) { } grpc_slice grpc_chttp2_settings_create(uint32_t *old, const uint32_t *new, - uint32_t force_mask, size_t count) { + uint32_t force_mask, size_t count) { size_t i; uint32_t n = 0; grpc_slice output; diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.h b/src/core/ext/transport/chttp2/transport/frame_settings.h index bbbecec518..a29dc82106 100644 --- a/src/core/ext/transport/chttp2/transport/frame_settings.h +++ b/src/core/ext/transport/chttp2/transport/frame_settings.h @@ -34,8 +34,8 @@ #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H -#include #include +#include #include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/lib/iomgr/exec_ctx.h" @@ -88,7 +88,7 @@ extern const grpc_chttp2_setting_parameters /* Create a settings frame by diffing old & new, and updating old to be new */ grpc_slice grpc_chttp2_settings_create(uint32_t *old, const uint32_t *new, - uint32_t force_mask, size_t count); + uint32_t force_mask, size_t count); /* Create an ack settings frame */ grpc_slice grpc_chttp2_settings_ack_create(void); diff --git a/src/core/ext/transport/chttp2/transport/frame_window_update.h b/src/core/ext/transport/chttp2/transport/frame_window_update.h index b5f40335a4..f75dfb3d87 100644 --- a/src/core/ext/transport/chttp2/transport/frame_window_update.h +++ b/src/core/ext/transport/chttp2/transport/frame_window_update.h @@ -45,8 +45,8 @@ typedef struct { uint32_t amount; } grpc_chttp2_window_update_parser; -grpc_slice grpc_chttp2_window_update_create(uint32_t id, uint32_t window_delta, - grpc_transport_one_way_stats *stats); +grpc_slice grpc_chttp2_window_update_create( + uint32_t id, uint32_t window_delta, grpc_transport_one_way_stats *stats); grpc_error *grpc_chttp2_window_update_parser_begin_frame( grpc_chttp2_window_update_parser *parser, uint32_t length, uint8_t flags); diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.c b/src/core/ext/transport/chttp2/transport/hpack_encoder.c index 3c5bcd3412..eb68fe3138 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.c +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.c @@ -269,8 +269,9 @@ static void emit_indexed(grpc_chttp2_hpack_compressor *c, uint32_t elem_index, } static grpc_slice get_wire_value(grpc_mdelem *elem, uint8_t *huffman_prefix) { - if (grpc_is_binary_header((const char *)GRPC_SLICE_START_PTR(elem->key->slice), - GRPC_SLICE_LENGTH(elem->key->slice))) { + if (grpc_is_binary_header( + (const char *)GRPC_SLICE_START_PTR(elem->key->slice), + GRPC_SLICE_LENGTH(elem->key->slice))) { *huffman_prefix = 0x80; return grpc_mdstr_as_base64_encoded_and_huffman_compressed(elem->value); } diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.h b/src/core/ext/transport/chttp2/transport/hpack_encoder.h index 9188d9c6c5..bcbd675ca2 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.h +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.h @@ -34,9 +34,9 @@ #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H -#include #include #include +#include #include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/lib/transport/metadata.h" #include "src/core/lib/transport/metadata_batch.h" diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.c b/src/core/ext/transport/chttp2/transport/hpack_parser.c index 3c1c6ba5a6..1046c31dda 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser.c +++ b/src/core/ext/transport/chttp2/transport/hpack_parser.c @@ -1501,9 +1501,9 @@ static grpc_error *is_binary_indexed_header(grpc_chttp2_hpack_parser *p, GRPC_ERROR_INT_INDEX, (intptr_t)p->index), GRPC_ERROR_INT_SIZE, (intptr_t)p->table.num_ents); } - *is = - grpc_is_binary_header((const char *)GRPC_SLICE_START_PTR(elem->key->slice), - GRPC_SLICE_LENGTH(elem->key->slice)); + *is = grpc_is_binary_header( + (const char *)GRPC_SLICE_START_PTR(elem->key->slice), + GRPC_SLICE_LENGTH(elem->key->slice)); return GRPC_ERROR_NONE; } diff --git a/src/core/ext/transport/chttp2/transport/hpack_table.h b/src/core/ext/transport/chttp2/transport/hpack_table.h index bc5a2d2463..2ca130e64b 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_table.h +++ b/src/core/ext/transport/chttp2/transport/hpack_table.h @@ -34,8 +34,8 @@ #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_TABLE_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_TABLE_H -#include #include +#include #include "src/core/lib/iomgr/error.h" #include "src/core/lib/transport/metadata.h" diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 18fa2b4890..b74233d992 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -466,7 +466,8 @@ void grpc_chttp2_end_write(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, /** Process one slice of incoming data; return 1 if the connection is still viable after reading, or 0 if the connection should be torn down */ grpc_error *grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx, - grpc_chttp2_transport *t, grpc_slice slice); + grpc_chttp2_transport *t, + grpc_slice slice); bool grpc_chttp2_list_add_writable_stream(grpc_chttp2_transport *t, grpc_chttp2_stream *s); diff --git a/src/core/ext/transport/chttp2/transport/parsing.c b/src/core/ext/transport/chttp2/transport/parsing.c index cb88fd5baf..b9c405158f 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.c +++ b/src/core/ext/transport/chttp2/transport/parsing.c @@ -229,10 +229,10 @@ grpc_error *grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx, case GRPC_DTS_FRAME: GPR_ASSERT(cur < end); if ((uint32_t)(end - cur) == t->incoming_frame_size) { - err = parse_frame_slice(exec_ctx, t, - grpc_slice_sub_no_ref(slice, (size_t)(cur - beg), - (size_t)(end - beg)), - 1); + err = parse_frame_slice( + exec_ctx, t, grpc_slice_sub_no_ref(slice, (size_t)(cur - beg), + (size_t)(end - beg)), + 1); if (err != GRPC_ERROR_NONE) { return err; } @@ -244,7 +244,7 @@ grpc_error *grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx, err = parse_frame_slice( exec_ctx, t, grpc_slice_sub_no_ref(slice, cur_offset, - cur_offset + t->incoming_frame_size), + cur_offset + t->incoming_frame_size), 1); if (err != GRPC_ERROR_NONE) { return err; @@ -253,10 +253,10 @@ grpc_error *grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx, t->incoming_stream = NULL; goto dts_fh_0; /* loop */ } else { - err = parse_frame_slice(exec_ctx, t, - grpc_slice_sub_no_ref(slice, (size_t)(cur - beg), - (size_t)(end - beg)), - 0); + err = parse_frame_slice( + exec_ctx, t, grpc_slice_sub_no_ref(slice, (size_t)(cur - beg), + (size_t)(end - beg)), + 0); if (err != GRPC_ERROR_NONE) { return err; } diff --git a/src/core/ext/transport/chttp2/transport/writing.c b/src/core/ext/transport/chttp2/transport/writing.c index 1486a7edb4..139e7387c4 100644 --- a/src/core/ext/transport/chttp2/transport/writing.c +++ b/src/core/ext/transport/chttp2/transport/writing.c @@ -131,8 +131,8 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, if (s->announce_window > 0) { uint32_t announce = s->announce_window; grpc_slice_buffer_add(&t->outbuf, - grpc_chttp2_window_update_create( - s->id, s->announce_window, &s->stats.outgoing)); + grpc_chttp2_window_update_create( + s->id, s->announce_window, &s->stats.outgoing)); GRPC_CHTTP2_FLOW_DEBIT_STREAM("write", t, s, announce_window, announce); } if (sent_initial_metadata) { @@ -163,8 +163,8 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, s->sent_trailing_metadata = true; if (!t->is_client && !s->read_closed) { grpc_slice_buffer_add(&t->outbuf, grpc_chttp2_rst_stream_create( - s->id, GRPC_CHTTP2_NO_ERROR, - &s->stats.outgoing)); + s->id, GRPC_CHTTP2_NO_ERROR, + &s->stats.outgoing)); } } s->sending_bytes += send_bytes; @@ -221,7 +221,7 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, announced); grpc_transport_one_way_stats throwaway_stats; grpc_slice_buffer_add(&t->outbuf, grpc_chttp2_window_update_create( - 0, announced, &throwaway_stats)); + 0, announced, &throwaway_stats)); } GPR_TIMER_END("grpc_chttp2_begin_write", 0); diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 73fda07ee1..1e5377c2b4 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -34,10 +34,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -926,7 +926,7 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx, free_read_buffer(s); grpc_slice_buffer_init(&stream_state->rs.read_slice_buffer); grpc_slice_buffer_add(&stream_state->rs.read_slice_buffer, - read_data_slice); + read_data_slice); grpc_slice_buffer_stream_init(&stream_state->rs.sbs, &stream_state->rs.read_slice_buffer, 0); *((grpc_byte_buffer **)stream_op->recv_message) = diff --git a/src/core/lib/channel/compress_filter.c b/src/core/lib/channel/compress_filter.c index c42a81b3b5..de71bcc22b 100644 --- a/src/core/lib/channel/compress_filter.c +++ b/src/core/lib/channel/compress_filter.c @@ -35,9 +35,9 @@ #include #include +#include #include #include -#include #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/compress_filter.h" diff --git a/src/core/lib/channel/connected_channel.c b/src/core/lib/channel/connected_channel.c index 2ae86f5507..0e62d58475 100644 --- a/src/core/lib/channel/connected_channel.c +++ b/src/core/lib/channel/connected_channel.c @@ -38,9 +38,9 @@ #include #include +#include #include #include -#include #include "src/core/lib/profiling/timers.h" #include "src/core/lib/support/string.h" #include "src/core/lib/transport/transport.h" diff --git a/src/core/lib/channel/handshaker.c b/src/core/lib/channel/handshaker.c index 00d39764d7..a45a39981c 100644 --- a/src/core/lib/channel/handshaker.c +++ b/src/core/lib/channel/handshaker.c @@ -146,8 +146,8 @@ void grpc_handshake_manager_shutdown(grpc_exec_ctx* exec_ctx, static void call_next_handshaker(grpc_exec_ctx* exec_ctx, grpc_endpoint* endpoint, grpc_channel_args* args, - grpc_slice_buffer* read_buffer, void* user_data, - grpc_error* error) { + grpc_slice_buffer* read_buffer, + void* user_data, grpc_error* error) { grpc_handshake_manager* mgr = user_data; GPR_ASSERT(mgr->state != NULL); GPR_ASSERT(mgr->state->index < mgr->count); diff --git a/src/core/lib/channel/http_server_filter.c b/src/core/lib/channel/http_server_filter.c index 1a73a07b81..10631850cd 100644 --- a/src/core/lib/channel/http_server_filter.c +++ b/src/core/lib/channel/http_server_filter.c @@ -164,7 +164,7 @@ static grpc_mdelem *server_filter(void *user_data, grpc_mdelem *md) { calld->seen_payload_bin = 1; grpc_slice_buffer_init(&calld->read_slice_buffer); grpc_slice_buffer_add(&calld->read_slice_buffer, - grpc_slice_ref(md->value->slice)); + grpc_slice_ref(md->value->slice)); grpc_slice_buffer_stream_init(&calld->read_stream, &calld->read_slice_buffer, 0); return NULL; diff --git a/src/core/lib/http/format_request.c b/src/core/lib/http/format_request.c index 59ff28f67f..024664b6ee 100644 --- a/src/core/lib/http/format_request.c +++ b/src/core/lib/http/format_request.c @@ -37,8 +37,8 @@ #include #include -#include #include +#include #include #include #include "src/core/lib/support/string.h" @@ -65,7 +65,8 @@ static void fill_common_header(const grpc_httpcli_request *request, } } -grpc_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request) { +grpc_slice grpc_httpcli_format_get_request( + const grpc_httpcli_request *request) { gpr_strvec out; char *flat; size_t flat_len; @@ -82,8 +83,8 @@ grpc_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request) } grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request, - const char *body_bytes, - size_t body_size) { + const char *body_bytes, + size_t body_size) { gpr_strvec out; char *tmp; size_t out_len; diff --git a/src/core/lib/http/format_request.h b/src/core/lib/http/format_request.h index ad51701bbb..1c8e3f68c5 100644 --- a/src/core/lib/http/format_request.h +++ b/src/core/lib/http/format_request.h @@ -39,8 +39,8 @@ grpc_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request); grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request, - const char *body_bytes, - size_t body_size); + const char *body_bytes, + size_t body_size); grpc_slice grpc_httpcli_format_connect_request( const grpc_httpcli_request *request); diff --git a/src/core/lib/http/parser.h b/src/core/lib/http/parser.h index 6d003cd68c..a68011dd43 100644 --- a/src/core/lib/http/parser.h +++ b/src/core/lib/http/parser.h @@ -34,8 +34,8 @@ #ifndef GRPC_CORE_LIB_HTTP_PARSER_H #define GRPC_CORE_LIB_HTTP_PARSER_H -#include #include +#include #include "src/core/lib/iomgr/error.h" /* Maximum length of a header string of the form 'Key: Value\r\n' */ diff --git a/src/core/lib/iomgr/resource_quota.c b/src/core/lib/iomgr/resource_quota.c index f047f45b43..6d7e549bb7 100644 --- a/src/core/lib/iomgr/resource_quota.c +++ b/src/core/lib/iomgr/resource_quota.c @@ -300,7 +300,7 @@ static void ru_slice_unref(void *p) { } static grpc_slice ru_slice_create(grpc_resource_user *resource_user, - size_t size) { + size_t size) { ru_slice_refcount *rc = gpr_malloc(sizeof(ru_slice_refcount) + size); rc->base.ref = ru_slice_ref; rc->base.unref = ru_slice_unref; diff --git a/src/core/lib/iomgr/tcp_client_windows.c b/src/core/lib/iomgr/tcp_client_windows.c index 9f28c056d9..598c012589 100644 --- a/src/core/lib/iomgr/tcp_client_windows.c +++ b/src/core/lib/iomgr/tcp_client_windows.c @@ -37,10 +37,10 @@ #include "src/core/lib/iomgr/sockaddr_windows.h" +#include #include #include #include -#include #include #include "src/core/lib/iomgr/iocp_windows.h" diff --git a/src/core/lib/iomgr/tcp_windows.c b/src/core/lib/iomgr/tcp_windows.c index 9fe7662e96..bc1b91e109 100644 --- a/src/core/lib/iomgr/tcp_windows.c +++ b/src/core/lib/iomgr/tcp_windows.c @@ -40,10 +40,10 @@ #include "src/core/lib/iomgr/network_status_tracker.h" #include "src/core/lib/iomgr/sockaddr_windows.h" +#include #include #include #include -#include #include #include diff --git a/src/core/lib/security/transport/handshake.c b/src/core/lib/security/transport/handshake.c index 07f16df51f..01e7fab773 100644 --- a/src/core/lib/security/transport/handshake.c +++ b/src/core/lib/security/transport/handshake.c @@ -36,9 +36,9 @@ #include #include +#include #include #include -#include #include "src/core/lib/iomgr/timer.h" #include "src/core/lib/security/context/security_context.h" #include "src/core/lib/security/transport/secure_endpoint.h" diff --git a/src/core/lib/security/transport/security_connector.c b/src/core/lib/security/transport/security_connector.c index 3d39cf5dda..f7e3264bda 100644 --- a/src/core/lib/security/transport/security_connector.c +++ b/src/core/lib/security/transport/security_connector.c @@ -36,10 +36,10 @@ #include #include +#include #include #include #include -#include #include #include "src/core/ext/transport/chttp2/alpn/alpn.h" diff --git a/src/core/lib/security/util/b64.c b/src/core/lib/security/util/b64.c index 6270277914..4892e8e621 100644 --- a/src/core/lib/security/util/b64.c +++ b/src/core/lib/security/util/b64.c @@ -183,7 +183,7 @@ static int decode_group(const unsigned char *codes, size_t num_codes, } grpc_slice grpc_base64_decode_with_len(const char *b64, size_t b64_len, - int url_safe) { + int url_safe) { grpc_slice result = grpc_slice_malloc(b64_len); unsigned char *current = GRPC_SLICE_START_PTR(result); size_t result_size = 0; diff --git a/src/core/lib/security/util/b64.h b/src/core/lib/security/util/b64.h index f3218b9c4f..6ea0b5365b 100644 --- a/src/core/lib/security/util/b64.h +++ b/src/core/lib/security/util/b64.h @@ -47,6 +47,6 @@ grpc_slice grpc_base64_decode(const char *b64, int url_safe); /* Same as above except that the length is provided by the caller. */ grpc_slice grpc_base64_decode_with_len(const char *b64, size_t b64_len, - int url_safe); + int url_safe); #endif /* GRPC_CORE_LIB_SECURITY_UTIL_B64_H */ diff --git a/src/core/lib/slice/slice.c b/src/core/lib/slice/slice.c index 54ff6f6baa..3dac18df61 100644 --- a/src/core/lib/slice/slice.c +++ b/src/core/lib/slice/slice.c @@ -31,9 +31,9 @@ * */ +#include #include #include -#include #include @@ -62,7 +62,7 @@ void grpc_slice_unref(grpc_slice slice) { static void noop_ref_or_unref(void *unused) {} static grpc_slice_refcount noop_refcount = {noop_ref_or_unref, - noop_ref_or_unref}; + noop_ref_or_unref}; grpc_slice grpc_slice_from_static_string(const char *s) { grpc_slice slice; @@ -95,8 +95,8 @@ static void new_slice_unref(void *p) { } grpc_slice grpc_slice_new_with_user_data(void *p, size_t len, - void (*destroy)(void *), - void *user_data) { + void (*destroy)(void *), + void *user_data) { grpc_slice slice; new_slice_refcount *rc = gpr_malloc(sizeof(new_slice_refcount)); gpr_ref_init(&rc->refs, 1); @@ -140,7 +140,7 @@ static void new_with_len_unref(void *p) { } grpc_slice grpc_slice_new_with_len(void *p, size_t len, - void (*destroy)(void *, size_t)) { + void (*destroy)(void *, size_t)) { grpc_slice slice; new_with_len_slice_refcount *rc = gpr_malloc(sizeof(new_with_len_slice_refcount)); diff --git a/src/core/lib/slice/slice_buffer.c b/src/core/lib/slice/slice_buffer.c index 8416237631..990ef128bd 100644 --- a/src/core/lib/slice/slice_buffer.c +++ b/src/core/lib/slice/slice_buffer.c @@ -31,8 +31,8 @@ * */ -#include #include +#include #include @@ -112,7 +112,8 @@ void grpc_slice_buffer_add(grpc_slice_buffer *sb, grpc_slice s) { writes */ if (!s.refcount && n) { grpc_slice *back = &sb->slices[n - 1]; - if (!back->refcount && back->data.inlined.length < GRPC_SLICE_INLINED_SIZE) { + if (!back->refcount && + back->data.inlined.length < GRPC_SLICE_INLINED_SIZE) { if (s.data.inlined.length + back->data.inlined.length <= GRPC_SLICE_INLINED_SIZE) { memcpy(back->data.inlined.bytes + back->data.inlined.length, @@ -193,7 +194,8 @@ void grpc_slice_buffer_swap(grpc_slice_buffer *a, grpc_slice_buffer *b) { } } -void grpc_slice_buffer_move_into(grpc_slice_buffer *src, grpc_slice_buffer *dst) { +void grpc_slice_buffer_move_into(grpc_slice_buffer *src, + grpc_slice_buffer *dst) { /* anything to move? */ if (src->count == 0) { return; @@ -210,7 +212,7 @@ void grpc_slice_buffer_move_into(grpc_slice_buffer *src, grpc_slice_buffer *dst) } void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n, - grpc_slice_buffer *dst) { + grpc_slice_buffer *dst) { size_t src_idx; size_t output_len = dst->length + n; size_t new_input_len = src->length - n; @@ -248,7 +250,7 @@ void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n, } void grpc_slice_buffer_trim_end(grpc_slice_buffer *sb, size_t n, - grpc_slice_buffer *garbage) { + grpc_slice_buffer *garbage) { GPR_ASSERT(n <= sb->length); sb->length -= n; for (;;) { diff --git a/src/core/lib/surface/byte_buffer.c b/src/core/lib/surface/byte_buffer.c index 5ae7e3264b..d646591a65 100644 --- a/src/core/lib/surface/byte_buffer.c +++ b/src/core/lib/surface/byte_buffer.c @@ -42,7 +42,8 @@ grpc_byte_buffer *grpc_raw_byte_buffer_create(grpc_slice *slices, } grpc_byte_buffer *grpc_raw_compressed_byte_buffer_create( - grpc_slice *slices, size_t nslices, grpc_compression_algorithm compression) { + grpc_slice *slices, size_t nslices, + grpc_compression_algorithm compression) { size_t i; grpc_byte_buffer *bb = gpr_malloc(sizeof(grpc_byte_buffer)); bb->type = GRPC_BB_RAW; diff --git a/src/core/lib/surface/byte_buffer_reader.c b/src/core/lib/surface/byte_buffer_reader.c index 6a1ef2ba2d..0089959fbb 100644 --- a/src/core/lib/surface/byte_buffer_reader.c +++ b/src/core/lib/surface/byte_buffer_reader.c @@ -37,9 +37,9 @@ #include #include #include +#include #include #include -#include #include "src/core/lib/compression/message_compress.h" diff --git a/src/core/lib/transport/metadata_batch.h b/src/core/lib/transport/metadata_batch.h index 1b5525e631..7a9ccb4bc8 100644 --- a/src/core/lib/transport/metadata_batch.h +++ b/src/core/lib/transport/metadata_batch.h @@ -37,8 +37,8 @@ #include #include -#include #include +#include #include #include "src/core/lib/transport/metadata.h" diff --git a/src/cpp/client/channel_cc.cc b/src/cpp/client/channel_cc.cc index e18f9f527c..d4afb1f00e 100644 --- a/src/cpp/client/channel_cc.cc +++ b/src/cpp/client/channel_cc.cc @@ -47,8 +47,8 @@ #include #include #include -#include #include +#include #include "src/core/lib/profiling/timers.h" namespace grpc { diff --git a/src/cpp/common/core_codegen.cc b/src/cpp/common/core_codegen.cc index fef8cc3d22..a07ad54376 100644 --- a/src/cpp/common/core_codegen.cc +++ b/src/cpp/common/core_codegen.cc @@ -39,11 +39,11 @@ #include #include #include +#include +#include #include #include #include -#include -#include #include #include "src/core/lib/profiling/timers.h" @@ -115,13 +115,16 @@ grpc_slice CoreCodegen::grpc_slice_malloc(size_t length) { return ::grpc_slice_malloc(length); } -void CoreCodegen::grpc_slice_unref(grpc_slice slice) { ::grpc_slice_unref(slice); } +void CoreCodegen::grpc_slice_unref(grpc_slice slice) { + ::grpc_slice_unref(slice); +} grpc_slice CoreCodegen::grpc_slice_split_tail(grpc_slice* s, size_t split) { return ::grpc_slice_split_tail(s, split); } -void CoreCodegen::grpc_slice_buffer_add(grpc_slice_buffer* sb, grpc_slice slice) { +void CoreCodegen::grpc_slice_buffer_add(grpc_slice_buffer* sb, + grpc_slice slice) { ::grpc_slice_buffer_add(sb, slice); } diff --git a/test/core/compression/message_compress_test.c b/test/core/compression/message_compress_test.c index 680850af33..fc53cd9d36 100644 --- a/test/core/compression/message_compress_test.c +++ b/test/core/compression/message_compress_test.c @@ -70,8 +70,8 @@ static void assert_passthrough(grpc_slice value, GPR_INFO, "assert_passthrough: value_length=%" PRIuPTR " value_hash=0x%08x " "algorithm='%s' uncompressed_split='%s' compressed_split='%s'", - GRPC_SLICE_LENGTH(value), - gpr_murmur_hash3(GRPC_SLICE_START_PTR(value), GRPC_SLICE_LENGTH(value), 0), + GRPC_SLICE_LENGTH(value), gpr_murmur_hash3(GRPC_SLICE_START_PTR(value), + GRPC_SLICE_LENGTH(value), 0), algorithm_name, grpc_slice_split_mode_name(uncompressed_split_mode), grpc_slice_split_mode_name(compressed_split_mode)); @@ -221,7 +221,7 @@ static void test_bad_decompression_data_stream(void) { grpc_slice_buffer_init(&input); grpc_slice_buffer_init(&output); grpc_slice_buffer_add(&input, - grpc_slice_from_copied_buffer("\x78\xda\xff\xff", 4)); + grpc_slice_from_copied_buffer("\x78\xda\xff\xff", 4)); /* try (and fail) to decompress the invalid compresed buffer */ GPR_ASSERT(0 == grpc_msg_decompress(GRPC_COMPRESS_DEFLATE, &input, &output)); @@ -237,8 +237,8 @@ static void test_bad_compression_algorithm(void) { grpc_slice_buffer_init(&input); grpc_slice_buffer_init(&output); - grpc_slice_buffer_add(&input, - grpc_slice_from_copied_string("Never gonna give you up")); + grpc_slice_buffer_add( + &input, grpc_slice_from_copied_string("Never gonna give you up")); was_compressed = grpc_msg_compress(GRPC_COMPRESS_ALGORITHMS_COUNT, &input, &output); GPR_ASSERT(0 == was_compressed); @@ -259,8 +259,8 @@ static void test_bad_decompression_algorithm(void) { grpc_slice_buffer_init(&input); grpc_slice_buffer_init(&output); grpc_slice_buffer_add(&input, - grpc_slice_from_copied_string( - "I'm not really compressed but it doesn't matter")); + grpc_slice_from_copied_string( + "I'm not really compressed but it doesn't matter")); was_decompressed = grpc_msg_decompress(GRPC_COMPRESS_ALGORITHMS_COUNT, &input, &output); GPR_ASSERT(0 == was_decompressed); diff --git a/test/core/end2end/cq_verifier.c b/test/core/end2end/cq_verifier.c index 4fb89eb96e..57373970c4 100644 --- a/test/core/end2end/cq_verifier.c +++ b/test/core/end2end/cq_verifier.c @@ -119,7 +119,8 @@ static grpc_slice merge_slices(grpc_slice *slices, size_t nslices) { cursor = GRPC_SLICE_START_PTR(out); for (i = 0; i < nslices; i++) { - memcpy(cursor, GRPC_SLICE_START_PTR(slices[i]), GRPC_SLICE_LENGTH(slices[i])); + memcpy(cursor, GRPC_SLICE_START_PTR(slices[i]), + GRPC_SLICE_LENGTH(slices[i])); cursor += GRPC_SLICE_LENGTH(slices[i]); } diff --git a/test/core/end2end/invalid_call_argument_test.c b/test/core/end2end/invalid_call_argument_test.c index 6cc7d28489..765b6ad1be 100644 --- a/test/core/end2end/invalid_call_argument_test.c +++ b/test/core/end2end/invalid_call_argument_test.c @@ -251,7 +251,8 @@ static void test_send_messages_at_the_same_time() { gpr_log(GPR_INFO, "test_send_messages_at_the_same_time"); grpc_op *op; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); prepare_test(1); diff --git a/test/core/end2end/tests/binary_metadata.c b/test/core/end2end/tests/binary_metadata.c index 317ca3110b..b0d18191e0 100644 --- a/test/core/end2end/tests/binary_metadata.c +++ b/test/core/end2end/tests/binary_metadata.c @@ -100,8 +100,10 @@ static void test_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *response_payload = diff --git a/test/core/end2end/tests/call_creds.c b/test/core/end2end/tests/call_creds.c index 8f8b7d5119..05a379cf1b 100644 --- a/test/core/end2end/tests/call_creds.c +++ b/test/core/end2end/tests/call_creds.c @@ -135,8 +135,10 @@ static void request_response_with_payload_and_call_creds( override_mode mode) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *response_payload = @@ -389,7 +391,8 @@ static void test_request_with_server_rejecting_client_creds( char *details = NULL; size_t details_capacity = 0; grpc_byte_buffer *response_payload_recv = NULL; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_call_credentials *creds; diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c index 4bf55c8725..f67da2d90d 100644 --- a/test/core/end2end/tests/cancel_after_accept.c +++ b/test/core/end2end/tests/cancel_after_accept.c @@ -118,8 +118,10 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, size_t details_capacity = 0; grpc_byte_buffer *request_payload_recv = NULL; grpc_byte_buffer *response_payload_recv = NULL; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *response_payload = diff --git a/test/core/end2end/tests/cancel_after_client_done.c b/test/core/end2end/tests/cancel_after_client_done.c index afb17b0719..44be85435d 100644 --- a/test/core/end2end/tests/cancel_after_client_done.c +++ b/test/core/end2end/tests/cancel_after_client_done.c @@ -117,8 +117,10 @@ static void test_cancel_after_accept_and_writes_closed( size_t details_capacity = 0; grpc_byte_buffer *request_payload_recv = NULL; grpc_byte_buffer *response_payload_recv = NULL; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *response_payload = diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c index fe0e0d689c..c276f5e2fa 100644 --- a/test/core/end2end/tests/cancel_after_invoke.c +++ b/test/core/end2end/tests/cancel_after_invoke.c @@ -116,7 +116,8 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config, char *details = NULL; size_t details_capacity = 0; grpc_byte_buffer *response_payload_recv = NULL; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.c index 3a0b83c4d2..e33b120a5b 100644 --- a/test/core/end2end/tests/cancel_before_invoke.c +++ b/test/core/end2end/tests/cancel_before_invoke.c @@ -114,7 +114,8 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config, char *details = NULL; size_t details_capacity = 0; grpc_byte_buffer *response_payload_recv = NULL; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); diff --git a/test/core/end2end/tests/compressed_payload.c b/test/core/end2end/tests/compressed_payload.c index 92788dd8fa..4ed24baf67 100644 --- a/test/core/end2end/tests/compressed_payload.c +++ b/test/core/end2end/tests/compressed_payload.c @@ -308,7 +308,8 @@ static void request_with_payload_template( response_str[1023] = '\0'; request_payload_slice = grpc_slice_from_copied_string(request_str); - grpc_slice response_payload_slice = grpc_slice_from_copied_string(response_str); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string(response_str); client_args = grpc_channel_args_set_compression_algorithm( NULL, default_client_channel_compression_algorithm); diff --git a/test/core/end2end/tests/filter_call_init_fails.c b/test/core/end2end/tests/filter_call_init_fails.c index 36f98694b6..b180957d4f 100644 --- a/test/core/end2end/tests/filter_call_init_fails.c +++ b/test/core/end2end/tests/filter_call_init_fails.c @@ -108,7 +108,8 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_request(grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c index 66449558c7..943a3df90d 100644 --- a/test/core/end2end/tests/filter_causes_close.c +++ b/test/core/end2end/tests/filter_causes_close.c @@ -104,7 +104,8 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_request(grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); diff --git a/test/core/end2end/tests/large_metadata.c b/test/core/end2end/tests/large_metadata.c index 29dcafb985..26a4eef7d9 100644 --- a/test/core/end2end/tests/large_metadata.c +++ b/test/core/end2end/tests/large_metadata.c @@ -99,7 +99,8 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_request_with_large_metadata(grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); diff --git a/test/core/end2end/tests/load_reporting_hook.c b/test/core/end2end/tests/load_reporting_hook.c index 1dba200c02..046e0c321b 100644 --- a/test/core/end2end/tests/load_reporting_hook.c +++ b/test/core/end2end/tests/load_reporting_hook.c @@ -128,7 +128,8 @@ static void request_response_with_payload(grpc_end2end_test_fixture f, grpc_metadata *initial_lr_metadata, grpc_metadata *trailing_lr_metadata) { grpc_slice request_payload_slice = grpc_slice_from_static_string(request_msg); - grpc_slice response_payload_slice = grpc_slice_from_static_string(response_msg); + grpc_slice response_payload_slice = + grpc_slice_from_static_string(response_msg); grpc_call *c; grpc_call *s; grpc_byte_buffer *request_payload = diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c index cdf52f9838..559b00d828 100644 --- a/test/core/end2end/tests/max_message_length.c +++ b/test/core/end2end/tests/max_message_length.c @@ -116,7 +116,8 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config, cq_verifier *cqv; grpc_op ops[6]; grpc_op *op; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *recv_payload = NULL; diff --git a/test/core/end2end/tests/network_status_change.c b/test/core/end2end/tests/network_status_change.c index e9528ff105..84447e6a2f 100644 --- a/test/core/end2end/tests/network_status_change.c +++ b/test/core/end2end/tests/network_status_change.c @@ -102,7 +102,8 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_invoke_network_status_change(grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); diff --git a/test/core/end2end/tests/payload.c b/test/core/end2end/tests/payload.c index 5a19950726..01ba964ef0 100644 --- a/test/core/end2end/tests/payload.c +++ b/test/core/end2end/tests/payload.c @@ -95,7 +95,8 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -/* Creates and returns a grpc_slice containing random alphanumeric characters. */ +/* Creates and returns a grpc_slice containing random alphanumeric characters. + */ static grpc_slice generate_random_slice() { size_t i; static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c index 3398a9cff7..317788f7fa 100644 --- a/test/core/end2end/tests/ping_pong_streaming.c +++ b/test/core/end2end/tests/ping_pong_streaming.c @@ -120,8 +120,10 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, grpc_byte_buffer *response_payload; grpc_byte_buffer *response_payload_recv; int i; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, "/foo", "foo.test.google.fr:1234", deadline, diff --git a/test/core/end2end/tests/request_with_flags.c b/test/core/end2end/tests/request_with_flags.c index a37fc645b4..8649c1563f 100644 --- a/test/core/end2end/tests/request_with_flags.c +++ b/test/core/end2end/tests/request_with_flags.c @@ -100,7 +100,8 @@ static void test_invoke_request_with_flags( grpc_end2end_test_config config, uint32_t *flags_for_op, grpc_call_error call_start_batch_expected_result) { grpc_call *c; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c index 3e2bbb3b0e..144cd58ec0 100644 --- a/test/core/end2end/tests/request_with_payload.c +++ b/test/core/end2end/tests/request_with_payload.c @@ -99,7 +99,8 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_invoke_request_with_payload(grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); diff --git a/test/core/end2end/tests/resource_quota_server.c b/test/core/end2end/tests/resource_quota_server.c index 280bad5749..cf81b06692 100644 --- a/test/core/end2end/tests/resource_quota_server.c +++ b/test/core/end2end/tests/resource_quota_server.c @@ -95,7 +95,8 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -/* Creates and returns a grpc_slice containing random alphanumeric characters. */ +/* Creates and returns a grpc_slice containing random alphanumeric characters. + */ static grpc_slice generate_random_slice() { size_t i; static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; diff --git a/test/core/end2end/tests/simple_cacheable_request.c b/test/core/end2end/tests/simple_cacheable_request.c index 40dd3983e1..4284175214 100644 --- a/test/core/end2end/tests/simple_cacheable_request.c +++ b/test/core/end2end/tests/simple_cacheable_request.c @@ -102,8 +102,10 @@ static void test_cacheable_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *response_payload = diff --git a/test/core/end2end/tests/simple_metadata.c b/test/core/end2end/tests/simple_metadata.c index 1ac9dc8210..e11981f92b 100644 --- a/test/core/end2end/tests/simple_metadata.c +++ b/test/core/end2end/tests/simple_metadata.c @@ -100,8 +100,10 @@ static void test_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *response_payload = diff --git a/test/core/end2end/tests/trailing_metadata.c b/test/core/end2end/tests/trailing_metadata.c index 0bbf0879cc..f88d5edeae 100644 --- a/test/core/end2end/tests/trailing_metadata.c +++ b/test/core/end2end/tests/trailing_metadata.c @@ -100,8 +100,10 @@ static void test_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *response_payload = diff --git a/test/core/http/format_request_test.c b/test/core/http/format_request_test.c index bd31e5e8ab..290990c906 100644 --- a/test/core/http/format_request_test.c +++ b/test/core/http/format_request_test.c @@ -52,13 +52,13 @@ static void test_format_get_request(void) { slice = grpc_httpcli_format_get_request(&req); GPR_ASSERT(0 == grpc_slice_str_cmp(slice, - "GET /index.html HTTP/1.0\r\n" - "Host: example.com\r\n" - "Connection: close\r\n" - "User-Agent: " GRPC_HTTPCLI_USER_AGENT - "\r\n" - "x-yz: abc\r\n" - "\r\n")); + "GET /index.html HTTP/1.0\r\n" + "Host: example.com\r\n" + "Connection: close\r\n" + "User-Agent: " GRPC_HTTPCLI_USER_AGENT + "\r\n" + "x-yz: abc\r\n" + "\r\n")); grpc_slice_unref(slice); } @@ -79,16 +79,16 @@ static void test_format_post_request(void) { slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len); GPR_ASSERT(0 == grpc_slice_str_cmp(slice, - "POST /index.html HTTP/1.0\r\n" - "Host: example.com\r\n" - "Connection: close\r\n" - "User-Agent: " GRPC_HTTPCLI_USER_AGENT - "\r\n" - "x-yz: abc\r\n" - "Content-Type: text/plain\r\n" - "Content-Length: 9\r\n" - "\r\n" - "fake body")); + "POST /index.html HTTP/1.0\r\n" + "Host: example.com\r\n" + "Connection: close\r\n" + "User-Agent: " GRPC_HTTPCLI_USER_AGENT + "\r\n" + "x-yz: abc\r\n" + "Content-Type: text/plain\r\n" + "Content-Length: 9\r\n" + "\r\n" + "fake body")); grpc_slice_unref(slice); } @@ -107,13 +107,13 @@ static void test_format_post_request_no_body(void) { slice = grpc_httpcli_format_post_request(&req, NULL, 0); GPR_ASSERT(0 == grpc_slice_str_cmp(slice, - "POST /index.html HTTP/1.0\r\n" - "Host: example.com\r\n" - "Connection: close\r\n" - "User-Agent: " GRPC_HTTPCLI_USER_AGENT - "\r\n" - "x-yz: abc\r\n" - "\r\n")); + "POST /index.html HTTP/1.0\r\n" + "Host: example.com\r\n" + "Connection: close\r\n" + "User-Agent: " GRPC_HTTPCLI_USER_AGENT + "\r\n" + "x-yz: abc\r\n" + "\r\n")); grpc_slice_unref(slice); } diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c index 8a1699608e..8186ea7e85 100644 --- a/test/core/iomgr/endpoint_tests.c +++ b/test/core/iomgr/endpoint_tests.c @@ -36,9 +36,9 @@ #include #include +#include #include #include -#include #include #include #include "test/core/util/test_config.h" @@ -88,7 +88,7 @@ static grpc_endpoint_test_fixture begin_test(grpc_endpoint_test_config config, static void end_test(grpc_endpoint_test_config config) { config.clean_up(); } static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size, - size_t *num_blocks, uint8_t *current_data) { + size_t *num_blocks, uint8_t *current_data) { size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1 : 0); grpc_slice *slices = gpr_malloc(sizeof(grpc_slice) * nslices); size_t num_bytes_left = num_bytes; @@ -99,7 +99,7 @@ static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size, for (i = 0; i < nslices; ++i) { slices[i] = grpc_slice_malloc(slice_size > num_bytes_left ? num_bytes_left - : slice_size); + : slice_size); num_bytes_left -= GRPC_SLICE_LENGTH(slices[i]); buf = GRPC_SLICE_START_PTR(slices[i]); for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) { diff --git a/test/core/iomgr/load_file_test.c b/test/core/iomgr/load_file_test.c index af822466d7..8714e1f368 100644 --- a/test/core/iomgr/load_file_test.c +++ b/test/core/iomgr/load_file_test.c @@ -34,9 +34,9 @@ #include #include +#include #include #include -#include #include "src/core/lib/iomgr/load_file.h" #include "src/core/lib/support/string.h" diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c index bba1900987..5eafa570bb 100644 --- a/test/core/iomgr/tcp_posix_test.c +++ b/test/core/iomgr/tcp_posix_test.c @@ -274,7 +274,7 @@ struct write_socket_state { }; static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size, - size_t *num_blocks, uint8_t *current_data) { + size_t *num_blocks, uint8_t *current_data) { size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1u : 0u); grpc_slice *slices = gpr_malloc(sizeof(grpc_slice) * nslices); size_t num_bytes_left = num_bytes; @@ -284,7 +284,7 @@ static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size, for (i = 0; i < nslices; ++i) { slices[i] = grpc_slice_malloc(slice_size > num_bytes_left ? num_bytes_left - : slice_size); + : slice_size); num_bytes_left -= GRPC_SLICE_LENGTH(slices[i]); buf = GRPC_SLICE_START_PTR(slices[i]); for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) { diff --git a/test/core/security/b64_test.c b/test/core/security/b64_test.c index dea0f56266..af883f51e9 100644 --- a/test/core/security/b64_test.c +++ b/test/core/security/b64_test.c @@ -35,9 +35,9 @@ #include +#include #include #include -#include #include "test/core/util/test_config.h" static int buffers_are_equal(const unsigned char *buf1, diff --git a/test/core/security/create_jwt.c b/test/core/security/create_jwt.c index 0303b791ae..741ace9bdd 100644 --- a/test/core/security/create_jwt.c +++ b/test/core/security/create_jwt.c @@ -37,10 +37,10 @@ #include "src/core/lib/iomgr/load_file.h" #include "src/core/lib/security/credentials/jwt/jwt_credentials.h" +#include #include #include #include -#include void create_jwt(const char *json_key_file_path, const char *service_url, const char *scope) { diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c index 0637215915..d4c755088d 100644 --- a/test/core/security/credentials_test.c +++ b/test/core/security/credentials_test.c @@ -243,9 +243,10 @@ static void test_oauth2_token_fetcher_creds_parsing_ok(void) { GPR_ASSERT(token_lifetime.tv_sec == 3599); GPR_ASSERT(token_lifetime.tv_nsec == 0); GPR_ASSERT(token_md->num_entries == 1); - GPR_ASSERT(grpc_slice_str_cmp(token_md->entries[0].key, "authorization") == 0); + GPR_ASSERT(grpc_slice_str_cmp(token_md->entries[0].key, "authorization") == + 0); GPR_ASSERT(grpc_slice_str_cmp(token_md->entries[0].value, - "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") == + "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") == 0); grpc_credentials_md_store_unref(token_md); grpc_http_response_destroy(&response); @@ -530,7 +531,7 @@ static void on_oauth2_creds_get_metadata_success( GPR_ASSERT(num_md == 1); GPR_ASSERT(grpc_slice_str_cmp(md_elems[0].key, "authorization") == 0); GPR_ASSERT(grpc_slice_str_cmp(md_elems[0].value, - "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") == + "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") == 0); GPR_ASSERT(user_data != NULL); GPR_ASSERT(strcmp((const char *)user_data, test_user_data) == 0); diff --git a/test/core/security/fetch_oauth2.c b/test/core/security/fetch_oauth2.c index ca093095c3..e9e211206c 100644 --- a/test/core/security/fetch_oauth2.c +++ b/test/core/security/fetch_oauth2.c @@ -36,10 +36,10 @@ #include #include +#include #include #include #include -#include #include #include "src/core/lib/iomgr/load_file.h" diff --git a/test/core/security/json_token_test.c b/test/core/security/json_token_test.c index 593b79855f..201655881f 100644 --- a/test/core/security/json_token_test.c +++ b/test/core/security/json_token_test.c @@ -37,9 +37,9 @@ #include #include +#include #include #include -#include #include "src/core/lib/json/json.h" #include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h" diff --git a/test/core/security/jwt_verifier_test.c b/test/core/security/jwt_verifier_test.c index 01fe436f27..f8afba8d6d 100644 --- a/test/core/security/jwt_verifier_test.c +++ b/test/core/security/jwt_verifier_test.c @@ -37,9 +37,9 @@ #include +#include #include #include -#include #include #include "src/core/lib/http/httpcli.h" @@ -487,8 +487,8 @@ static void corrupt_jwt_sig(char *jwt) { GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(sig)); sig_bytes = GRPC_SLICE_START_PTR(sig); (*sig_bytes)++; /* Corrupt first byte. */ - bad_b64_sig = - grpc_base64_encode(GRPC_SLICE_START_PTR(sig), GRPC_SLICE_LENGTH(sig), 1, 0); + bad_b64_sig = grpc_base64_encode(GRPC_SLICE_START_PTR(sig), + GRPC_SLICE_LENGTH(sig), 1, 0); memcpy(last_dot + 1, bad_b64_sig, strlen(bad_b64_sig)); gpr_free(bad_b64_sig); grpc_slice_unref(sig); diff --git a/test/core/security/oauth2_utils.c b/test/core/security/oauth2_utils.c index 22dbf0428d..44a209258d 100644 --- a/test/core/security/oauth2_utils.c +++ b/test/core/security/oauth2_utils.c @@ -37,9 +37,9 @@ #include #include +#include #include #include -#include #include #include "src/core/lib/security/credentials/credentials.h" diff --git a/test/core/security/print_google_default_creds_token.c b/test/core/security/print_google_default_creds_token.c index 3a04c6e3eb..157b7bf5ff 100644 --- a/test/core/security/print_google_default_creds_token.c +++ b/test/core/security/print_google_default_creds_token.c @@ -36,10 +36,10 @@ #include #include +#include #include #include #include -#include #include #include "src/core/lib/security/credentials/composite/composite_credentials.h" diff --git a/test/core/security/verify_jwt.c b/test/core/security/verify_jwt.c index 4d0ff242ea..043d29e6bb 100644 --- a/test/core/security/verify_jwt.c +++ b/test/core/security/verify_jwt.c @@ -36,10 +36,10 @@ #include #include +#include #include #include #include -#include #include #include "src/core/lib/security/credentials/jwt/jwt_verifier.h" diff --git a/test/core/slice/slice_buffer_test.c b/test/core/slice/slice_buffer_test.c index 4c26113d05..bf9ae197d2 100644 --- a/test/core/slice/slice_buffer_test.c +++ b/test/core/slice/slice_buffer_test.c @@ -31,8 +31,8 @@ * */ -#include #include +#include #include "test/core/util/test_config.h" void test_slice_buffer_add() { diff --git a/test/core/slice/slice_test.c b/test/core/slice/slice_test.c index e6d29e7459..ca44becfd0 100644 --- a/test/core/slice/slice_test.c +++ b/test/core/slice/slice_test.c @@ -170,11 +170,12 @@ static void test_slice_sub_works(unsigned length) { grpc_slice_unref(slice); } -static void check_head_tail(grpc_slice slice, grpc_slice head, grpc_slice tail) { +static void check_head_tail(grpc_slice slice, grpc_slice head, + grpc_slice tail) { GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == GRPC_SLICE_LENGTH(head) + GRPC_SLICE_LENGTH(tail)); - GPR_ASSERT(0 == memcmp(GRPC_SLICE_START_PTR(slice), GRPC_SLICE_START_PTR(head), - GRPC_SLICE_LENGTH(head))); + GPR_ASSERT(0 == memcmp(GRPC_SLICE_START_PTR(slice), + GRPC_SLICE_START_PTR(head), GRPC_SLICE_LENGTH(head))); GPR_ASSERT(0 == memcmp(GRPC_SLICE_START_PTR(slice) + GRPC_SLICE_LENGTH(head), GRPC_SLICE_START_PTR(tail), GRPC_SLICE_LENGTH(tail))); } @@ -243,8 +244,8 @@ static void test_slice_from_copied_string_works(void) { slice = grpc_slice_from_copied_string(text); GPR_ASSERT(strlen(text) == GRPC_SLICE_LENGTH(slice)); - GPR_ASSERT(0 == - memcmp(text, GRPC_SLICE_START_PTR(slice), GRPC_SLICE_LENGTH(slice))); + GPR_ASSERT( + 0 == memcmp(text, GRPC_SLICE_START_PTR(slice), GRPC_SLICE_LENGTH(slice))); grpc_slice_unref(slice); } diff --git a/test/core/transport/chttp2/hpack_parser_test.c b/test/core/transport/chttp2/hpack_parser_test.c index c7e8f3a050..e2813df70c 100644 --- a/test/core/transport/chttp2/hpack_parser_test.c +++ b/test/core/transport/chttp2/hpack_parser_test.c @@ -36,9 +36,9 @@ #include #include +#include #include #include -#include #include "test/core/util/parse_hexstring.h" #include "test/core/util/slice_splitter.h" #include "test/core/util/test_config.h" diff --git a/test/core/transport/chttp2/varint_test.c b/test/core/transport/chttp2/varint_test.c index 5b831c71b2..e29be4b056 100644 --- a/test/core/transport/chttp2/varint_test.c +++ b/test/core/transport/chttp2/varint_test.c @@ -33,15 +33,16 @@ #include "src/core/ext/transport/chttp2/transport/varint.h" -#include #include +#include #include "test/core/util/test_config.h" static void test_varint(uint32_t value, uint32_t prefix_bits, uint8_t prefix_or, const char *expect_bytes, size_t expect_length) { uint32_t nbytes = GRPC_CHTTP2_VARINT_LENGTH(value, prefix_bits); - grpc_slice expect = grpc_slice_from_copied_buffer(expect_bytes, expect_length); + grpc_slice expect = + grpc_slice_from_copied_buffer(expect_bytes, expect_length); grpc_slice slice; gpr_log(GPR_DEBUG, "Test: 0x%08x", value); GPR_ASSERT(nbytes == expect_length); diff --git a/test/core/util/mock_endpoint.h b/test/core/util/mock_endpoint.h index 8f8d2a412d..ec7f0fcfcd 100644 --- a/test/core/util/mock_endpoint.h +++ b/test/core/util/mock_endpoint.h @@ -39,6 +39,7 @@ grpc_endpoint *grpc_mock_endpoint_create(void (*on_write)(grpc_slice slice), grpc_resource_quota *resource_quota); void grpc_mock_endpoint_put_read(grpc_exec_ctx *exec_ctx, - grpc_endpoint *mock_endpoint, grpc_slice slice); + grpc_endpoint *mock_endpoint, + grpc_slice slice); #endif diff --git a/test/core/util/one_corpus_entry_fuzzer.c b/test/core/util/one_corpus_entry_fuzzer.c index 6b572bb3c3..c016ebb536 100644 --- a/test/core/util/one_corpus_entry_fuzzer.c +++ b/test/core/util/one_corpus_entry_fuzzer.c @@ -47,7 +47,8 @@ int main(int argc, char **argv) { leak_check = false; GPR_ASSERT( GRPC_LOG_IF_ERROR("load_file", grpc_load_file(argv[1], 0, &buffer))); - LLVMFuzzerTestOneInput(GRPC_SLICE_START_PTR(buffer), GRPC_SLICE_LENGTH(buffer)); + LLVMFuzzerTestOneInput(GRPC_SLICE_START_PTR(buffer), + GRPC_SLICE_LENGTH(buffer)); grpc_slice_unref(buffer); return 0; } diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc index a56667585f..f3cfe53bda 100644 --- a/test/cpp/grpclb/grpclb_test.cc +++ b/test/cpp/grpclb/grpclb_test.cc @@ -456,7 +456,8 @@ static void perform_request(client_fixture *cf) { int i; memset(ops, 0, sizeof(ops)); - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); c = grpc_channel_create_call(cf->client, NULL, GRPC_PROPAGATE_DEFAULTS, cf->cq, "/foo", "foo.test.google.fr:1234", diff --git a/test/cpp/util/cli_call.cc b/test/cpp/util/cli_call.cc index 0517610f10..a02a8b2ee2 100644 --- a/test/cpp/util/cli_call.cc +++ b/test/cpp/util/cli_call.cc @@ -41,8 +41,8 @@ #include #include #include -#include #include +#include namespace grpc { namespace testing { -- cgit v1.2.3