From: Richard Russon Date: Fri, 21 Jul 2017 23:35:47 +0000 (+0100) Subject: tidy: sort out typedef usage X-Git-Tag: neomutt-20170907~55^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9896a1b8597dc96a8ad9d2058a34b15da0fca3eb;p=neomutt tidy: sort out typedef usage --- diff --git a/color.c b/color.c index 181ac4346..498f36639 100644 --- a/color.c +++ b/color.c @@ -750,8 +750,8 @@ static int parse_object(struct Buffer *buf, struct Buffer *s, int *o, int *ql, return 0; } -typedef int (*parser_callback_t)(struct Buffer *, struct Buffer *, int *, int *, - int *, struct Buffer *); +typedef int (*parser_callback_t)(struct Buffer *buf, struct Buffer *s, int *fg, + int *bg, int *attr, struct Buffer *err); #ifdef HAVE_COLOR diff --git a/handler.c b/handler.c index 73d9c92cc..1e1f7bf46 100644 --- a/handler.c +++ b/handler.c @@ -58,7 +58,7 @@ #define BUFI_SIZE 1000 #define BUFO_SIZE 2000 -typedef int (*handler_t)(struct Body *, struct State *); +typedef int (*handler_t)(struct Body *b, struct State *s); // clang-format off const int Index_hex[128] = { diff --git a/mutt_ssl_gnutls.c b/mutt_ssl_gnutls.c index 446fd8af7..da61ec06f 100644 --- a/mutt_ssl_gnutls.c +++ b/mutt_ssl_gnutls.c @@ -87,11 +87,11 @@ typedef gnutls_x509_crt gnutls_x509_crt_t; /** * struct TlsSockData - TLS socket data */ -typedef struct TlsSockData +struct TlsSockData { gnutls_session_t state; gnutls_certificate_credentials_t xcred; -} tlssockdata; +}; static int tls_init(void) { @@ -115,7 +115,7 @@ static int tls_init(void) static int tls_socket_read(struct Connection *conn, char *buf, size_t len) { - tlssockdata *data = conn->sockdata; + struct TlsSockData *data = conn->sockdata; int ret; if (!data) @@ -141,7 +141,7 @@ static int tls_socket_read(struct Connection *conn, char *buf, size_t len) static int tls_socket_write(struct Connection *conn, const char *buf, size_t len) { - tlssockdata *data = conn->sockdata; + struct TlsSockData *data = conn->sockdata; int ret; size_t sent = 0; @@ -173,7 +173,7 @@ static int tls_socket_write(struct Connection *conn, const char *buf, size_t len static int tls_socket_close(struct Connection *conn) { - tlssockdata *data = conn->sockdata; + struct TlsSockData *data = conn->sockdata; if (data) { /* shut down only the write half to avoid hanging waiting for the remote to respond. @@ -817,7 +817,7 @@ static int tls_check_one_certificate(const gnutls_datum_t *certdata, static int tls_check_certificate(struct Connection *conn) { - tlssockdata *data = conn->sockdata; + struct TlsSockData *data = conn->sockdata; gnutls_session_t state = data->state; const gnutls_datum_t *cert_list = NULL; unsigned int cert_list_size = 0; @@ -895,7 +895,7 @@ static int tls_check_certificate(struct Connection *conn) static void tls_get_client_cert(struct Connection *conn) { - tlssockdata *data = conn->sockdata; + struct TlsSockData *data = conn->sockdata; const gnutls_datum_t *crtdata = NULL; gnutls_x509_crt_t clientcrt; char *dn = NULL; @@ -949,7 +949,7 @@ err_crt: } #ifdef HAVE_GNUTLS_PRIORITY_SET_DIRECT -static int tls_set_priority(tlssockdata *data) +static int tls_set_priority(struct TlsSockData *data) { size_t nproto = 4; char *priority = NULL; @@ -1012,7 +1012,7 @@ static int tls_set_priority(tlssockdata *data) static int protocol_priority[] = { GNUTLS_TLS1_2, GNUTLS_TLS1_1, GNUTLS_TLS1, GNUTLS_SSL3, 0 }; -static int tls_set_priority(tlssockdata *data) +static int tls_set_priority(struct TlsSockData *data) { size_t nproto = 0; /* number of tls/ssl protocols */ @@ -1055,10 +1055,10 @@ static int tls_set_priority(tlssockdata *data) */ static int tls_negotiate(struct Connection *conn) { - tlssockdata *data = NULL; + struct TlsSockData *data = NULL; int err; - data = safe_calloc(1, sizeof(tlssockdata)); + data = safe_calloc(1, sizeof(struct TlsSockData)); conn->sockdata = data; err = gnutls_certificate_allocate_credentials(&data->xcred); if (err < 0) diff --git a/rfc2047.c b/rfc2047.c index 1a2079fe1..98283c617 100644 --- a/rfc2047.c +++ b/rfc2047.c @@ -53,7 +53,7 @@ extern char RFC822Specials[]; -typedef size_t (*encoder_t)(char *, ICONV_CONST char *, size_t, const char *); +typedef size_t (*encoder_t)(char *s, ICONV_CONST char *d, size_t dlen, const char *tocode); static size_t convert_string(ICONV_CONST char *f, size_t flen, const char *from, const char *to, char **t, size_t *tlen)