]> granicus.if.org Git - neomutt/commitdiff
boolify retval
authorRichard Russon <rich@flatcap.org>
Wed, 25 Jul 2018 11:44:04 +0000 (12:44 +0100)
committerRichard Russon <rich@flatcap.org>
Wed, 25 Jul 2018 14:08:29 +0000 (15:08 +0100)
browser.c
commands.c
commands.h
group.c
pager.c

index 04ea7d5bff3c7a41e6cda46543cb6fa60b46bab4..f239c3b888f9e7c4e0d0e476cc9144d05ba4bd63 100644 (file)
--- 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;
 }
 
 /**
index d2e367d8ecb3d46762827960aa545fba54f3ad85..5f42ac7be81c8f95ed490345016d9096597600bb 100644 (file)
@@ -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
index 3002b8d89d2255e9ae3c5b75c57985106afb5838..9f78ba44d61e0cc85a835a6b9c965fa6ff214aff 100644 (file)
@@ -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 6cacdf1dc150c189401b225fd3d61474ef5fcc01..188e8eb3e42d9783a0b77196fe673960f02067b2 100644 (file)
--- 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 5113c2d812ca9071448af92e0332dbd7e1bea57f..ba55a34968a731f77afd1dc467e11f0a6d52198b 100644 (file)
--- 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++;