Skip to content
Snippets Groups Projects
Commit 64f1f8d0 authored by Mark D. Roth's avatar Mark D. Roth
Browse files

clang-format

parent bfbfca43
No related branches found
No related tags found
No related merge requests found
...@@ -55,7 +55,7 @@ struct grpc_lb_policy_factory { ...@@ -55,7 +55,7 @@ struct grpc_lb_policy_factory {
typedef struct grpc_lb_address { typedef struct grpc_lb_address {
grpc_resolved_address address; grpc_resolved_address address;
bool is_balancer; bool is_balancer;
char *balancer_name; /* For secure naming. */ char *balancer_name; /* For secure naming. */
void *user_data; void *user_data;
} grpc_lb_address; } grpc_lb_address;
...@@ -66,20 +66,20 @@ typedef struct grpc_lb_addresses { ...@@ -66,20 +66,20 @@ typedef struct grpc_lb_addresses {
/** Returns a grpc_addresses struct with enough space for /** Returns a grpc_addresses struct with enough space for
* \a num_addresses addresses. */ * \a num_addresses addresses. */
grpc_lb_addresses* grpc_lb_addresses_create(size_t num_addresses); grpc_lb_addresses *grpc_lb_addresses_create(size_t num_addresses);
/** Sets the value of the address at index \a index of \a addresses. /** Sets the value of the address at index \a index of \a addresses.
* \a address is a socket address of length \a address_len. * \a address is a socket address of length \a address_len.
* Takes ownership of \a balancer_name. */ * Takes ownership of \a balancer_name. */
void grpc_lb_addresses_set_address(grpc_lb_addresses *addresses, size_t index, void grpc_lb_addresses_set_address(grpc_lb_addresses *addresses, size_t index,
void *address, size_t address_len, void *address, size_t address_len,
bool is_balancer, char* balancer_name, bool is_balancer, char *balancer_name,
void *user_data); void *user_data);
/** Destroys \a addresses. If \a user_data_destroy is not NULL, it will /** Destroys \a addresses. If \a user_data_destroy is not NULL, it will
* be invoked to destroy the \a user_data field of each address. */ * be invoked to destroy the \a user_data field of each address. */
void grpc_lb_addresses_destroy(grpc_lb_addresses* addresses, void grpc_lb_addresses_destroy(grpc_lb_addresses *addresses,
void (*user_data_destroy)(void*)); void (*user_data_destroy)(void *));
/** Arguments passed to LB policies. */ /** Arguments passed to LB policies. */
typedef struct grpc_lb_policy_args { typedef struct grpc_lb_policy_args {
......
...@@ -353,7 +353,7 @@ static bool is_server_valid(const grpc_grpclb_server *server, size_t idx, ...@@ -353,7 +353,7 @@ static bool is_server_valid(const grpc_grpclb_server *server, size_t idx,
/* populate \a addresses according to \a serverlist. Returns the number of /* populate \a addresses according to \a serverlist. Returns the number of
* addresses successfully parsed and added to \a addresses */ * addresses successfully parsed and added to \a addresses */
static grpc_lb_addresses* process_serverlist( static grpc_lb_addresses *process_serverlist(
const grpc_grpclb_serverlist *serverlist) { const grpc_grpclb_serverlist *serverlist) {
size_t num_valid = 0; size_t num_valid = 0;
/* first pass: count how many are valid in order to allocate the necessary /* first pass: count how many are valid in order to allocate the necessary
...@@ -398,7 +398,7 @@ static grpc_lb_addresses* process_serverlist( ...@@ -398,7 +398,7 @@ static grpc_lb_addresses* process_serverlist(
} }
/* lb token processing */ /* lb token processing */
void* user_data; void *user_data;
if (server->has_load_balance_token) { if (server->has_load_balance_token) {
const size_t lb_token_size = const size_t lb_token_size =
GPR_ARRAY_SIZE(server->load_balance_token) - 1; GPR_ARRAY_SIZE(server->load_balance_token) - 1;
...@@ -414,8 +414,8 @@ static grpc_lb_addresses* process_serverlist( ...@@ -414,8 +414,8 @@ static grpc_lb_addresses* process_serverlist(
user_data = GRPC_MDELEM_LOAD_REPORTING_INITIAL_EMPTY; user_data = GRPC_MDELEM_LOAD_REPORTING_INITIAL_EMPTY;
} }
grpc_lb_addresses_set_address(lb_addresses, addr_idx, &addr.addr, grpc_lb_addresses_set_address(lb_addresses, addr_idx, &addr.addr, addr.len,
addr.len, false /* is_balancer */, false /* is_balancer */,
NULL /* balancer_name */, user_data); NULL /* balancer_name */, user_data);
++addr_idx; ++addr_idx;
} }
...@@ -424,7 +424,7 @@ static grpc_lb_addresses* process_serverlist( ...@@ -424,7 +424,7 @@ static grpc_lb_addresses* process_serverlist(
return lb_addresses; return lb_addresses;
} }
static void lb_token_destroy(void* token) { static void lb_token_destroy(void *token) {
if (token != NULL) GRPC_MDELEM_UNREF(token); if (token != NULL) GRPC_MDELEM_UNREF(token);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment