From e800b4dc2eb0738980835f55cee74d236b19bf77 Mon Sep 17 00:00:00 2001 From: Kazuho Oku Date: Mon, 13 Dec 2021 16:14:04 +0900 Subject: [PATCH] clang-format --- t/util.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/t/util.h b/t/util.h index e889bcca2..a77b02d99 100644 --- a/t/util.h +++ b/t/util.h @@ -88,7 +88,7 @@ struct st_util_save_ticket_t { static int util_save_ticket_cb(ptls_save_ticket_t *_self, ptls_t *tls, ptls_iovec_t src) { - struct st_util_save_ticket_t *self = (struct st_util_save_ticket_t*)_self; + struct st_util_save_ticket_t *self = (struct st_util_save_ticket_t *)_self; FILE *fp; if ((fp = fopen(self->fn, "wb")) == NULL) { @@ -124,7 +124,7 @@ static inline void setup_session_file(ptls_context_t *ctx, ptls_handshake_proper } } -static inline X509_STORE* init_cert_store(char const *crt_file) +static inline X509_STORE *init_cert_store(char const *crt_file) { int ret = 0; X509_STORE *store = X509_STORE_new(); @@ -133,8 +133,7 @@ static inline X509_STORE* init_cert_store(char const *crt_file) X509_LOOKUP *lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file()); ret = X509_LOOKUP_load_file(lookup, crt_file, X509_FILETYPE_PEM); if (ret != 1) { - fprintf(stderr, "Cannot load store (%s), ret = %d\n", - crt_file, ret); + fprintf(stderr, "Cannot load store (%s), ret = %d\n", crt_file, ret); X509_STORE_free(store); exit(1); } @@ -180,7 +179,8 @@ static inline void setup_esni(ptls_context_t *ctx, const char *esni_fn, ptls_key fclose(fp); } - if ((ctx->esni = (ptls_esni_context_t**) malloc(sizeof(*ctx->esni) * 2)) == NULL || (*ctx->esni = (ptls_esni_context_t*) malloc(sizeof(**ctx->esni))) == NULL) { + if ((ctx->esni = (ptls_esni_context_t **)malloc(sizeof(*ctx->esni) * 2)) == NULL || + (*ctx->esni = (ptls_esni_context_t *)malloc(sizeof(**ctx->esni))) == NULL) { fprintf(stderr, "no memory\n"); exit(1); } @@ -198,7 +198,7 @@ struct st_util_log_event_t { static void log_event_cb(ptls_log_event_t *_self, ptls_t *tls, const char *type, const char *fmt, ...) { - struct st_util_log_event_t *self = (struct st_util_log_event_t*)_self; + struct st_util_log_event_t *self = (struct st_util_log_event_t *)_self; char randomhex[PTLS_HELLO_RANDOM_SIZE * 2 + 1]; va_list args; @@ -234,14 +234,14 @@ struct st_util_session_cache_t { static int encrypt_ticket_cb(ptls_encrypt_ticket_t *_self, ptls_t *tls, int is_encrypt, ptls_buffer_t *dst, ptls_iovec_t src) { - struct st_util_session_cache_t *self = (struct st_util_session_cache_t*)_self; + struct st_util_session_cache_t *self = (struct st_util_session_cache_t *)_self; int ret; if (is_encrypt) { /* replace the cached entry along with a newly generated session id */ free(self->data.base); - if ((self->data.base = (uint8_t *) malloc(src.len)) == NULL) + if ((self->data.base = (uint8_t *)malloc(src.len)) == NULL) return PTLS_ERROR_NO_MEMORY; ptls_get_context(tls)->random_bytes(self->id, sizeof(self->id)); @@ -336,8 +336,8 @@ static inline ptls_iovec_t resolve_esni_keys(const char *server_name) ptls_buffer_t decode_buf; ptls_base64_decode_state_t ds; int answer_len; - - char* buf = ""; + + char *buf = ""; ptls_buffer_init(&decode_buf, buf, 0); if (snprintf(esni_name, sizeof(esni_name), "_esni.%s", server_name) > sizeof(esni_name) - 1)