]> granicus.if.org Git - neomutt/commitdiff
boolify params/retvals
authorRichard Russon <rich@flatcap.org>
Fri, 16 Nov 2018 11:47:16 +0000 (11:47 +0000)
committerRichard Russon <rich@flatcap.org>
Fri, 16 Nov 2018 12:33:05 +0000 (12:33 +0000)
maildir/mh.c
mutt/list.c
mutt/list.h
mutt_thread.c
mutt_thread.h

index cf467ea4ad5e0a5f975f0e2cb22d516895edf23a..dd26d5ed5c6765a79bc7658f60599fcb96a3a0c4 100644 (file)
@@ -1324,7 +1324,7 @@ static int ch_compare(const void *a, const void *b)
  * @retval -1 Failure
  */
 static int maildir_mh_open_message(struct Mailbox *m, struct Message *msg,
-                                   int msgno, int is_maildir)
+                                   int msgno, bool is_maildir)
 {
   struct Email *cur = m->hdrs[msgno];
   char path[PATH_MAX];
@@ -2633,7 +2633,7 @@ static int maildir_msg_open(struct Context *ctx, struct Message *msg, int msgno)
 
   struct Mailbox *m = ctx->mailbox;
 
-  return maildir_mh_open_message(m, msg, msgno, 1);
+  return maildir_mh_open_message(m, msg, msgno, true);
 }
 
 /**
@@ -3075,7 +3075,7 @@ static int mh_msg_open(struct Context *ctx, struct Message *msg, int msgno)
 
   struct Mailbox *m = ctx->mailbox;
 
-  return maildir_mh_open_message(m, msg, msgno, 0);
+  return maildir_mh_open_message(m, msg, msgno, false);
 }
 
 /**
index 859b30b603a660119e077e9ba0ba633ddf691b6b..b6415ad2e53471e04d208f03e3e28f3e70bdd1b8 100644 (file)
@@ -187,7 +187,7 @@ bool mutt_list_match(const char *s, struct ListHead *h)
  * To be identical, the lists must both be the same length and contain the same
  * strings.  Two empty lists are identical.
  */
-int mutt_list_compare(const struct ListHead *ah, const struct ListHead *bh)
+bool mutt_list_compare(const struct ListHead *ah, const struct ListHead *bh)
 {
   struct ListNode *a = STAILQ_FIRST(ah);
   struct ListNode *b = STAILQ_FIRST(bh);
@@ -195,13 +195,13 @@ int mutt_list_compare(const struct ListHead *ah, const struct ListHead *bh)
   while (a && b)
   {
     if (mutt_str_strcmp(a->data, b->data) != 0)
-      return 0;
+      return false;
 
     a = STAILQ_NEXT(a, entries);
     b = STAILQ_NEXT(b, entries);
   }
   if (a || b)
-    return 0;
+    return false;
 
-  return 1;
+  return true;
 }
index 71c9ed4ba737e3553126663ad98187c46659feef..87c1368a21267cd78f87ac0340c4c1acbd5581e1 100644 (file)
@@ -51,7 +51,7 @@ STAILQ_HEAD(ListHead, ListNode);
 typedef void (*list_free_t)(void **ptr);
 
 void             mutt_list_clear(struct ListHead *h);
-int              mutt_list_compare(const struct ListHead *ah, const struct ListHead *bh);
+bool             mutt_list_compare(const struct ListHead *ah, const struct ListHead *bh);
 struct ListNode *mutt_list_find(const struct ListHead *h, const char *data);
 void             mutt_list_free(struct ListHead *h);
 void             mutt_list_free_type(struct ListHead *h, list_free_t fn);
index 6704faa494a4baa8202d1923b6ca53657adfd664..c66a785a8f477cfe7aa66acd761adf52079edbcc 100644 (file)
@@ -1482,7 +1482,7 @@ static bool link_threads(struct Email *parent, struct Email *child, struct Conte
  *
  * if last is omitted, all the tagged threads will be used.
  */
-int mutt_link_threads(struct Email *cur, struct Email *last, struct Context *ctx)
+bool mutt_link_threads(struct Email *cur, struct Email *last, struct Context *ctx)
 {
   if (!ctx || !ctx->mailbox)
     return false;
index 8ea4ae39de9199a5f96bd4dff4fae16159687994..5590c5e1276d149deb08490810134d44c4bacc2c 100644 (file)
@@ -63,7 +63,7 @@ int mutt_traverse_thread(struct Context *ctx, struct Email *cur, int flag);
 #define mutt_thread_contains_flagged(x, y) mutt_traverse_thread(x, y, MUTT_THREAD_FLAGGED)
 #define mutt_thread_next_unread(x, y)      mutt_traverse_thread(x, y, MUTT_THREAD_NEXT_UNREAD)
 
-int mutt_link_threads(struct Email *cur, struct Email *last, struct Context *ctx);
+bool mutt_link_threads(struct Email *cur, struct Email *last, struct Context *ctx);
 int mutt_messages_in_thread(struct Context *ctx, struct Email *e, int flag);
 void mutt_draw_tree(struct Context *ctx);