From c6708cffb8941fd6f873959ba448b135a6a019ae Mon Sep 17 00:00:00 2001 From: Brad House Date: Tue, 19 Dec 2023 08:33:31 -0500 Subject: [PATCH] clang-format --- src/lib/ares__iface_ips.c | 9 ++++----- src/lib/ares__socket.c | 3 ++- src/lib/ares_private.h | 6 +++--- src/lib/ares_process.c | 1 - src/lib/ares_rand.c | 2 -- src/lib/ares_timeout.c | 2 +- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/lib/ares__iface_ips.c b/src/lib/ares__iface_ips.c index 7cd12a60..15e813d4 100644 --- a/src/lib/ares__iface_ips.c +++ b/src/lib/ares__iface_ips.c @@ -201,9 +201,8 @@ static ares_status_t size_t alloc_size; alloc_size = ares__round_up_pow2(ips->alloc_size + 1); - temp = ares_realloc_zero(ips->ips, - ips->alloc_size * sizeof(*ips->ips), - alloc_size * sizeof(*ips->ips)); + temp = ares_realloc_zero(ips->ips, ips->alloc_size * sizeof(*ips->ips), + alloc_size * sizeof(*ips->ips)); if (temp == NULL) { return ARES_ENOMEM; } @@ -509,8 +508,8 @@ done: #else -static ares_status_t ares__iface_ips_enumerate(ares__iface_ips_t *ips, - const char *name) +static ares_status_t ares__iface_ips_enumerate(ares__iface_ips_t *ips, + const char *name) { (void)ips; (void)name; diff --git a/src/lib/ares__socket.c b/src/lib/ares__socket.c index 4eee6245..9129f444 100644 --- a/src/lib/ares__socket.c +++ b/src/lib/ares__socket.c @@ -254,7 +254,8 @@ ares_status_t ares__open_connection(ares_channel_t *channel, ares__llist_node_t *node; int type = is_tcp ? SOCK_STREAM : SOCK_DGRAM; #ifdef __OpenBSD__ - if((is_tcp && server->tcp_port == 53) || (!is_tcp && server->udp_port == 53)) { + if ((is_tcp && server->tcp_port == 53) || + (!is_tcp && server->udp_port == 53)) { type |= SOCK_DNS; } #endif diff --git a/src/lib/ares_private.h b/src/lib/ares_private.h index 85964ace..acc7f7ca 100644 --- a/src/lib/ares_private.h +++ b/src/lib/ares_private.h @@ -364,9 +364,9 @@ void ares__rand_bytes(ares_rand_state *state, unsigned char *buf, size_t len); unsigned short ares__generate_new_id(ares_rand_state *state); struct timeval ares__tvnow(void); -void ares__timeval_remaining(struct timeval *remaining, - const struct timeval *now, - const struct timeval *tout); +void ares__timeval_remaining(struct timeval *remaining, + const struct timeval *now, + const struct timeval *tout); ares_status_t ares__expand_name_validated(const unsigned char *encoded, const unsigned char *abuf, size_t alen, char **s, size_t *enclen, diff --git a/src/lib/ares_process.c b/src/lib/ares_process.c index 5d4359ba..ff5899c1 100644 --- a/src/lib/ares_process.c +++ b/src/lib/ares_process.c @@ -755,7 +755,6 @@ static void handle_conn_error(struct server_connection *conn, /* This will requeue any connections automatically */ ares__close_connection(conn); - } ares_status_t ares__requeue_query(struct query *query, struct timeval *now) diff --git a/src/lib/ares_rand.c b/src/lib/ares_rand.c index 867ca334..976d8ff6 100644 --- a/src/lib/ares_rand.c +++ b/src/lib/ares_rand.c @@ -39,7 +39,6 @@ typedef enum { ARES_RAND_RC4 = 1 << 2, /* Internal RC4 based PRNG */ } ares_rand_backend; - #define ARES_RC4_KEY_LEN 32 /* 256 bits */ typedef struct ares_rand_rc4 { @@ -138,7 +137,6 @@ static void ares_rc4_prng(ares_rand_rc4 *rc4_state, unsigned char *buf, rc4_state->j = j; } - struct ares_rand_state { ares_rand_backend type; ares_rand_backend bad_backends; diff --git a/src/lib/ares_timeout.c b/src/lib/ares_timeout.c index 30c4118d..4e80580b 100644 --- a/src/lib/ares_timeout.c +++ b/src/lib/ares_timeout.c @@ -34,7 +34,7 @@ #include "ares.h" #include "ares_private.h" -void ares__timeval_remaining(struct timeval *remaining, +void ares__timeval_remaining(struct timeval *remaining, const struct timeval *now, const struct timeval *tout) {