]> granicus.if.org Git - neomutt/commitdiff
tidy thread
authorRichard Russon <rich@flatcap.org>
Sat, 14 Jul 2018 16:28:46 +0000 (17:28 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 16 Jul 2018 22:47:18 +0000 (23:47 +0100)
email/thread.c
email/thread.h

index 5e2d81b46e7febae883f5f0702a6d701d51fb96e..1c0fcd9e6d3024b6b2dc76cdc32b989e4b53e1cc 100644 (file)
  * is_descendant - Is one thread a descendant of another
  * @param a Parent thread
  * @param b Child thread
- * @retval 1 If b is a descendent of a (child, grandchild, etc)
+ * @retval true If b is a descendent of a (child, grandchild, etc)
  */
-int is_descendant(struct MuttThread *a, struct MuttThread *b)
+bool is_descendant(struct MuttThread *a, struct MuttThread *b)
 {
   while (a)
   {
     if (a == b)
-      return 1;
+      return true;
     a = a->parent;
   }
-  return 0;
+  return false;
 }
 
 /**
@@ -75,7 +75,7 @@ void unlink_message(struct MuttThread **old, struct MuttThread *cur)
 
   if (cur->sort_key)
   {
-    for (tmp = cur->parent; tmp && tmp->sort_key == cur->sort_key; tmp = tmp->parent)
+    for (tmp = cur->parent; tmp && (tmp->sort_key == cur->sort_key); tmp = tmp->parent)
       tmp->sort_key = NULL;
   }
 }
@@ -121,7 +121,7 @@ struct Header *find_virtual(struct MuttThread *cur, int reverse)
 {
   struct MuttThread *top = NULL;
 
-  if (cur->message && cur->message->virtual >= 0)
+  if (cur->message && (cur->message->virtual >= 0))
     return cur->message;
 
   top = cur;
@@ -134,7 +134,7 @@ struct Header *find_virtual(struct MuttThread *cur, int reverse)
 
   while (true)
   {
-    if (cur->message && cur->message->virtual >= 0)
+    if (cur->message && (cur->message->virtual >= 0))
       return cur->message;
 
     if (cur->child)
@@ -220,7 +220,9 @@ void mutt_break_thread(struct Header *hdr)
 {
   mutt_list_free(&hdr->env->in_reply_to);
   mutt_list_free(&hdr->env->references);
-  hdr->env->irt_changed = hdr->env->refs_changed = hdr->changed = true;
+  hdr->env->irt_changed = true;
+  hdr->env->refs_changed = true;
+  hdr->changed = true;
 
   clean_references(hdr->thread, hdr->thread->child);
 }
index b5b696c429f0b0dcc2263ce96bbe1bde614602de..bfb07ff13c0750070105f648a48c088370ce3ed4 100644 (file)
@@ -52,7 +52,7 @@ struct MuttThread
 void           clean_references(struct MuttThread *brk, struct MuttThread *cur);
 struct Header *find_virtual(struct MuttThread *cur, int reverse);
 void           insert_message(struct MuttThread **new, struct MuttThread *newparent, struct MuttThread *cur);
-int            is_descendant(struct MuttThread *a, struct MuttThread *b);
+bool           is_descendant(struct MuttThread *a, struct MuttThread *b);
 void           mutt_break_thread(struct Header *hdr);
 void           thread_hash_destructor(int type, void *obj, intptr_t data);
 void           unlink_message(struct MuttThread **old, struct MuttThread *cur);