From: Richard Russon Date: Wed, 25 Jul 2018 11:44:04 +0000 (+0100) Subject: boolify retval X-Git-Tag: 2019-10-25~732^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eabc1aeeb3183b623d6877653c89ab6a8e0d9f26;p=neomutt boolify retval --- diff --git a/browser.c b/browser.c index 04ea7d5bf..f239c3b88 100644 --- a/browser.c +++ b/browser.c @@ -323,10 +323,10 @@ static void browser_sort(struct BrowserState *state) * link_is_dir - Does this symlink point to a directory? * @param folder Folder * @param path Link name - * @retval 1 Links to a directory - * @retval 0 Otherwise + * @retval true Links to a directory + * @retval false Otherwise */ -static int link_is_dir(const char *folder, const char *path) +static bool link_is_dir(const char *folder, const char *path) { struct stat st; char fullpath[PATH_MAX]; @@ -335,8 +335,8 @@ static int link_is_dir(const char *folder, const char *path) if (stat(fullpath, &st) == 0) return S_ISDIR(st.st_mode); - else - return 0; + + return false; } /** diff --git a/commands.c b/commands.c index d2e367d8e..5f42ac7be 100644 --- a/commands.c +++ b/commands.c @@ -1193,9 +1193,9 @@ int mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp) * @param[out] redraw Set of #REDRAW_FULL if the screen may need redrawing * @retval true If message contains inline PGP content */ -static int check_traditional_pgp(struct Header *h, int *redraw) +static bool check_traditional_pgp(struct Header *h, int *redraw) { - int rc = 0; + bool rc = false; h->security |= PGP_TRADITIONAL_CHECKED; @@ -1207,7 +1207,7 @@ static int check_traditional_pgp(struct Header *h, int *redraw) { h->security = crypt_query(h->content); *redraw |= REDRAW_FULL; - rc = 1; + rc = true; } h->security |= PGP_TRADITIONAL_CHECKED; @@ -1221,9 +1221,9 @@ static int check_traditional_pgp(struct Header *h, int *redraw) * @param[out] redraw Set of #REDRAW_FULL if the screen may need redrawing * @retval true If message contains inline PGP content */ -int mutt_check_traditional_pgp(struct Header *h, int *redraw) +bool mutt_check_traditional_pgp(struct Header *h, int *redraw) { - int rc = 0; + bool rc = false; if (h && !(h->security & PGP_TRADITIONAL_CHECKED)) rc = check_traditional_pgp(h, redraw); else diff --git a/commands.h b/commands.h index 3002b8d89..9f78ba44d 100644 --- a/commands.h +++ b/commands.h @@ -43,7 +43,7 @@ extern bool PromptAfter; void ci_bounce_message(struct Header *h); void mutt_check_stats(void); -int mutt_check_traditional_pgp(struct Header *h, int *redraw); +bool mutt_check_traditional_pgp(struct Header *h, int *redraw); void mutt_display_address(struct Envelope *env); int mutt_display_message(struct Header *cur); int mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp); diff --git a/group.c b/group.c index 6cacdf1dc..188e8eb3e 100644 --- a/group.c +++ b/group.c @@ -92,10 +92,10 @@ int mutt_group_context_clear(struct GroupContext **ctx) * @param g Group to test * @retval true If the Group is empty */ -static int empty_group(struct Group *g) +static bool empty_group(struct Group *g) { if (!g) - return -1; + return true; return !g->as && !g->rs; } diff --git a/pager.c b/pager.c index 5113c2d81..ba55a3496 100644 --- a/pager.c +++ b/pager.c @@ -1120,7 +1120,7 @@ static void resolve_types(char *buf, char *raw, struct Line *line_info, int n, * @param buf String to check * @retval true If it is */ -static int is_ansi(unsigned char *buf) +static bool is_ansi(unsigned char *buf) { while (*buf && (isdigit(*buf) || *buf == ';')) buf++;