aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/channel
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/channel')
-rw-r--r--src/core/channel/census_filter.c20
-rw-r--r--src/core/channel/channel_stack.c8
-rw-r--r--src/core/channel/channel_stack.h4
-rw-r--r--src/core/channel/child_channel.c11
-rw-r--r--src/core/channel/client_channel.c11
-rw-r--r--src/core/channel/connected_channel.c16
-rw-r--r--src/core/channel/http_client_filter.c14
-rw-r--r--src/core/channel/http_filter.c10
-rw-r--r--src/core/channel/http_server_filter.c10
-rw-r--r--src/core/channel/metadata_buffer.c6
-rw-r--r--src/core/channel/noop_filter.c10
11 files changed, 43 insertions, 77 deletions
diff --git a/src/core/channel/census_filter.c b/src/core/channel/census_filter.c
index ed60f0a5f6..3447e9dde4 100644
--- a/src/core/channel/census_filter.c
+++ b/src/core/channel/census_filter.c
@@ -178,19 +178,11 @@ static void destroy_channel_elem(grpc_channel_element* elem) {
}
const grpc_channel_filter grpc_client_census_filter = {
- client_call_op, channel_op,
-
- sizeof(call_data), client_init_call_elem, client_destroy_call_elem,
-
- sizeof(channel_data), init_channel_elem, destroy_channel_elem,
-
- "census-client"};
+ client_call_op, channel_op, sizeof(call_data),
+ client_init_call_elem, client_destroy_call_elem, sizeof(channel_data),
+ init_channel_elem, destroy_channel_elem, "census-client"};
const grpc_channel_filter grpc_server_census_filter = {
- server_call_op, channel_op,
-
- sizeof(call_data), server_init_call_elem, server_destroy_call_elem,
-
- sizeof(channel_data), init_channel_elem, destroy_channel_elem,
-
- "census-server"};
+ server_call_op, channel_op, sizeof(call_data),
+ server_init_call_elem, server_destroy_call_elem, sizeof(channel_data),
+ init_channel_elem, destroy_channel_elem, "census-server"};
diff --git a/src/core/channel/channel_stack.c b/src/core/channel/channel_stack.c
index 5ee412bf7d..0134b9ab44 100644
--- a/src/core/channel/channel_stack.c
+++ b/src/core/channel/channel_stack.c
@@ -54,7 +54,7 @@
/* Given a size, round up to the next multiple of sizeof(void*) */
#define ROUND_UP_TO_ALIGNMENT_SIZE(x) \
- (((x)+GPR_MAX_ALIGNMENT - 1) & ~(GPR_MAX_ALIGNMENT - 1))
+ (((x) + GPR_MAX_ALIGNMENT - 1) & ~(GPR_MAX_ALIGNMENT - 1))
size_t grpc_channel_stack_size(const grpc_channel_filter **filters,
size_t filter_count) {
@@ -75,9 +75,9 @@ size_t grpc_channel_stack_size(const grpc_channel_filter **filters,
return size;
}
-#define CHANNEL_ELEMS_FROM_STACK(stk) \
- ((grpc_channel_element *)((char *)(stk) + ROUND_UP_TO_ALIGNMENT_SIZE( \
- sizeof(grpc_channel_stack))))
+#define CHANNEL_ELEMS_FROM_STACK(stk) \
+ ((grpc_channel_element *)( \
+ (char *)(stk) + ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_channel_stack))))
#define CALL_ELEMS_FROM_STACK(stk) \
((grpc_call_element *)((char *)(stk) + \
diff --git a/src/core/channel/channel_stack.h b/src/core/channel/channel_stack.h
index eb68102b43..12ada95813 100644
--- a/src/core/channel/channel_stack.h
+++ b/src/core/channel/channel_stack.h
@@ -244,7 +244,9 @@ typedef struct {
/* A call stack tracks a set of related filters for one call, and guarantees
they live within a single malloc() allocation */
-typedef struct { size_t count; } grpc_call_stack;
+typedef struct {
+ size_t count;
+} grpc_call_stack;
/* Get a channel element given a channel stack and its index */
grpc_channel_element *grpc_channel_stack_element(grpc_channel_stack *stack,
diff --git a/src/core/channel/child_channel.c b/src/core/channel/child_channel.c
index f400e9b670..a7f06bcdc0 100644
--- a/src/core/channel/child_channel.c
+++ b/src/core/channel/child_channel.c
@@ -165,14 +165,9 @@ static void lb_destroy_channel_elem(grpc_channel_element *elem) {
}
const grpc_channel_filter grpc_child_channel_top_filter = {
- lb_call_op, lb_channel_op,
-
- sizeof(lb_call_data), lb_init_call_elem, lb_destroy_call_elem,
-
- sizeof(lb_channel_data), lb_init_channel_elem, lb_destroy_channel_elem,
-
- "child-channel",
-};
+ lb_call_op, lb_channel_op, sizeof(lb_call_data),
+ lb_init_call_elem, lb_destroy_call_elem, sizeof(lb_channel_data),
+ lb_init_channel_elem, lb_destroy_channel_elem, "child-channel", };
/* grpc_child_channel proper */
diff --git a/src/core/channel/client_channel.c b/src/core/channel/client_channel.c
index f9b42db419..bcb024f2ac 100644
--- a/src/core/channel/client_channel.c
+++ b/src/core/channel/client_channel.c
@@ -450,14 +450,9 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
}
const grpc_channel_filter grpc_client_channel_filter = {
- call_op, channel_op,
-
- sizeof(call_data), init_call_elem, destroy_call_elem,
-
- sizeof(channel_data), init_channel_elem, destroy_channel_elem,
-
- "client-channel",
-};
+ call_op, channel_op, sizeof(call_data),
+ init_call_elem, destroy_call_elem, sizeof(channel_data),
+ init_channel_elem, destroy_channel_elem, "client-channel", };
grpc_transport_setup_result grpc_client_channel_transport_setup_complete(
grpc_channel_stack *channel_stack, grpc_transport *transport,
diff --git a/src/core/channel/connected_channel.c b/src/core/channel/connected_channel.c
index 47c0ed3b88..d48269b743 100644
--- a/src/core/channel/connected_channel.c
+++ b/src/core/channel/connected_channel.c
@@ -69,7 +69,7 @@ typedef struct {
/* We perform a small hack to locate transport data alongside the connected
channel data in call allocations, to allow everything to be pulled in minimal
cache line requests */
-#define TRANSPORT_STREAM_FROM_CALL_DATA(calld) ((grpc_stream *)((calld)+1))
+#define TRANSPORT_STREAM_FROM_CALL_DATA(calld) ((grpc_stream *)((calld) + 1))
#define CALL_DATA_FROM_TRANSPORT_STREAM(transport_stream) \
(((call_data *)(transport_stream)) - 1)
@@ -257,14 +257,9 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
}
const grpc_channel_filter grpc_connected_channel_filter = {
- call_op, channel_op,
-
- sizeof(call_data), init_call_elem, destroy_call_elem,
-
- sizeof(channel_data), init_channel_elem, destroy_channel_elem,
-
- "connected",
-};
+ call_op, channel_op, sizeof(call_data),
+ init_call_elem, destroy_call_elem, sizeof(channel_data),
+ init_channel_elem, destroy_channel_elem, "connected", };
static gpr_slice alloc_recv_buffer(void *user_data, grpc_transport *transport,
grpc_stream *stream, size_t size_hint) {
@@ -507,8 +502,7 @@ static void transport_closed(void *user_data, grpc_transport *transport) {
const grpc_transport_callbacks connected_channel_transport_callbacks = {
alloc_recv_buffer, accept_stream, recv_batch,
- transport_goaway, transport_closed,
-};
+ transport_goaway, transport_closed, };
grpc_transport_setup_result grpc_connected_channel_bind_transport(
grpc_channel_stack *channel_stack, grpc_transport *transport) {
diff --git a/src/core/channel/http_client_filter.c b/src/core/channel/http_client_filter.c
index b139b72795..bd1c1f0a6b 100644
--- a/src/core/channel/http_client_filter.c
+++ b/src/core/channel/http_client_filter.c
@@ -35,7 +35,9 @@
#include <string.h>
#include <grpc/support/log.h>
-typedef struct call_data { int sent_headers; } call_data;
+typedef struct call_data {
+ int sent_headers;
+} call_data;
typedef struct channel_data {
grpc_mdelem *te_trailers;
@@ -178,10 +180,6 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
}
const grpc_channel_filter grpc_http_client_filter = {
- call_op, channel_op,
-
- sizeof(call_data), init_call_elem, destroy_call_elem,
-
- sizeof(channel_data), init_channel_elem, destroy_channel_elem,
-
- "http-client"};
+ call_op, channel_op, sizeof(call_data),
+ init_call_elem, destroy_call_elem, sizeof(channel_data),
+ init_channel_elem, destroy_channel_elem, "http-client"};
diff --git a/src/core/channel/http_filter.c b/src/core/channel/http_filter.c
index 846f7b9713..eaa746ef20 100644
--- a/src/core/channel/http_filter.c
+++ b/src/core/channel/http_filter.c
@@ -132,10 +132,6 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
}
const grpc_channel_filter grpc_http_filter = {
- call_op, channel_op,
-
- sizeof(call_data), init_call_elem, destroy_call_elem,
-
- sizeof(channel_data), init_channel_elem, destroy_channel_elem,
-
- "http"};
+ call_op, channel_op, sizeof(call_data),
+ init_call_elem, destroy_call_elem, sizeof(channel_data),
+ init_channel_elem, destroy_channel_elem, "http"};
diff --git a/src/core/channel/http_server_filter.c b/src/core/channel/http_server_filter.c
index 19b9606b43..a136496f23 100644
--- a/src/core/channel/http_server_filter.c
+++ b/src/core/channel/http_server_filter.c
@@ -244,10 +244,6 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
}
const grpc_channel_filter grpc_http_server_filter = {
- call_op, channel_op,
-
- sizeof(call_data), init_call_elem, destroy_call_elem,
-
- sizeof(channel_data), init_channel_elem, destroy_channel_elem,
-
- "http-server"};
+ call_op, channel_op, sizeof(call_data),
+ init_call_elem, destroy_call_elem, sizeof(channel_data),
+ init_channel_elem, destroy_channel_elem, "http-server"};
diff --git a/src/core/channel/metadata_buffer.c b/src/core/channel/metadata_buffer.c
index 75fd90b707..a21a37ea7d 100644
--- a/src/core/channel/metadata_buffer.c
+++ b/src/core/channel/metadata_buffer.c
@@ -61,7 +61,7 @@ struct grpc_metadata_buffer_impl {
size_t elem_cap;
};
-#define ELEMS(buffer) ((qelem *)((buffer)+1))
+#define ELEMS(buffer) ((qelem *)((buffer) + 1))
void grpc_metadata_buffer_init(grpc_metadata_buffer *buffer) {
/* start buffer as NULL, indicating no elements */
@@ -152,7 +152,9 @@ size_t grpc_metadata_buffer_count(const grpc_metadata_buffer *buffer) {
return *buffer ? (*buffer)->elems : 0;
}
-typedef struct { grpc_metadata_buffer_impl *impl; } elems_hdr;
+typedef struct {
+ grpc_metadata_buffer_impl *impl;
+} elems_hdr;
grpc_metadata *grpc_metadata_buffer_extract_elements(
grpc_metadata_buffer *buffer) {
diff --git a/src/core/channel/noop_filter.c b/src/core/channel/noop_filter.c
index b6b3f661f7..d5615f7ae6 100644
--- a/src/core/channel/noop_filter.c
+++ b/src/core/channel/noop_filter.c
@@ -131,10 +131,6 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
}
const grpc_channel_filter grpc_no_op_filter = {
- call_op, channel_op,
-
- sizeof(call_data), init_call_elem, destroy_call_elem,
-
- sizeof(channel_data), init_channel_elem, destroy_channel_elem,
-
- "no-op"};
+ call_op, channel_op, sizeof(call_data),
+ init_call_elem, destroy_call_elem, sizeof(channel_data),
+ init_channel_elem, destroy_channel_elem, "no-op"};