From 7f1e330a39ba4fabe75426504d10ca405823d7f3 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Tue, 16 May 2017 14:18:22 +0100 Subject: [PATCH] replace 'ATTACH_MATCH' with 'struct AttachMatch' --- init.c | 12 ++++++------ mutt.h | 4 ++-- parse.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/init.c b/init.c index 94d1e78b3..c3910b835 100644 --- a/init.c +++ b/init.c @@ -1316,7 +1316,7 @@ static void _attachments_clean(void) static int parse_attach_list(struct Buffer *buf, struct Buffer *s, struct List **ldata, struct Buffer *err) { - ATTACH_MATCH *a = NULL; + struct AttachMatch *a = NULL; struct List *listp = NULL, *lastp = NULL; char *p = NULL; char *tmpminor = NULL; @@ -1329,7 +1329,7 @@ static int parse_attach_list(struct Buffer *buf, struct Buffer *s, struct List * (void *) *ldata); for (listp = *ldata; listp; listp = listp->next) { - a = (ATTACH_MATCH *) listp->data; + a = (struct AttachMatch *) listp->data; mutt_debug(5, "parse_attach_list: skipping %s/%s\n", a->major, a->minor); lastp = listp; } @@ -1341,7 +1341,7 @@ static int parse_attach_list(struct Buffer *buf, struct Buffer *s, struct List * if (!buf->data || *buf->data == '\0') continue; - a = safe_malloc(sizeof(ATTACH_MATCH)); + a = safe_malloc(sizeof(struct AttachMatch)); /* some cheap hacks that I expect to remove */ if (ascii_strcasecmp(buf->data, "any") == 0) @@ -1404,7 +1404,7 @@ static int parse_attach_list(struct Buffer *buf, struct Buffer *s, struct List * static int parse_unattach_list(struct Buffer *buf, struct Buffer *s, struct List **ldata, struct Buffer *err) { - ATTACH_MATCH *a = NULL; + struct AttachMatch *a = NULL; struct List *lp = NULL, *lastp = NULL, *newlp = NULL; char *tmp = NULL; int major; @@ -1438,7 +1438,7 @@ static int parse_unattach_list(struct Buffer *buf, struct Buffer *s, struct List lastp = NULL; for (lp = *ldata; lp;) { - a = (ATTACH_MATCH *) lp->data; + a = (struct AttachMatch *) lp->data; mutt_debug(5, "parse_unattach_list: check %s/%s [%d] : %s/%s [%d]\n", a->major, a->minor, a->major_int, tmp, minor, major); if (a->major_int == major && (mutt_strcasecmp(minor, a->minor) == 0)) @@ -1477,7 +1477,7 @@ static int print_attach_list(struct List *lp, char op, char *name) while (lp) { printf("attachments %c%s %s/%s\n", op, name, - ((ATTACH_MATCH *) lp->data)->major, ((ATTACH_MATCH *) lp->data)->minor); + ((struct AttachMatch *) lp->data)->major, ((struct AttachMatch *) lp->data)->minor); lp = lp->next; } diff --git a/mutt.h b/mutt.h index 7cf7f7a3c..1eb9a96cc 100644 --- a/mutt.h +++ b/mutt.h @@ -1108,13 +1108,13 @@ int state_printf(struct State *s, const char *fmt, ...); int state_putws(const wchar_t *ws, struct State *s); /* for attachment counter */ -typedef struct +struct AttachMatch { char *major; int major_int; char *minor; regex_t minor_rx; -} ATTACH_MATCH; +}; /* multibyte character table. * Allows for direct access to the individual multibyte characters in a diff --git a/parse.c b/parse.c index 3971bcca6..df9a2860b 100644 --- a/parse.c +++ b/parse.c @@ -1541,7 +1541,7 @@ struct Address *mutt_parse_adrlist(struct Address *p, const char *s) static bool count_body_parts_check(struct List **checklist, struct Body *b, bool dflt) { struct List *type = NULL; - ATTACH_MATCH *a = NULL; + struct AttachMatch *a = NULL; /* If list is null, use default behavior. */ if (!*checklist) @@ -1551,7 +1551,7 @@ static bool count_body_parts_check(struct List **checklist, struct Body *b, bool for (type = *checklist; type; type = type->next) { - a = (ATTACH_MATCH *) type->data; + a = (struct AttachMatch *) type->data; mutt_debug(5, "cbpc: %s %d/%s ?? %s/%s [%d]... ", dflt ? "[OK] " : "[EXCL] ", b->type, b->subtype ? b->subtype : "*", a->major, a->minor, a->major_int); -- 2.40.0