]> granicus.if.org Git - neomutt/commitdiff
tidy code
authorRichard Russon <rich@flatcap.org>
Wed, 10 Oct 2018 22:06:03 +0000 (23:06 +0100)
committerRichard Russon <rich@flatcap.org>
Wed, 10 Oct 2018 22:12:51 +0000 (23:12 +0100)
curs_main.c
globals.h
imap/imap.c
mailbox.c
maildir/mh.c
mx.c

index 8651f63c25454179da9defa20a44315b7b863af7..8f9f45bf83b2ead8e128a3038729370deb3ec68c 100644 (file)
@@ -2211,9 +2211,11 @@ int mutt_index_menu(void)
           }
           else
 #endif
+          {
             /* By default, fill buf with the next mailbox that contains unread
              * mail */
             mutt_mailbox(buf, sizeof(buf));
+          }
 
           if (mutt_enter_fname(cp, buf, sizeof(buf), 1) == -1)
           {
index a0b1511cb693227e9c5a6237e7d57a4f894ca731..4bb3bc190315e2304f3afd69a78ad38507ddf82c 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -85,8 +85,6 @@ WHERE struct RegexList SubscribedLists INITVAL(STAILQ_HEAD_INITIALIZER(Subscribe
 WHERE struct RegexList UnSubscribedLists INITVAL(STAILQ_HEAD_INITIALIZER(UnSubscribedLists));
 WHERE struct ReplaceList SubjectRegexList INITVAL(STAILQ_HEAD_INITIALIZER(SubjectRegexList));
 
-WHERE unsigned short Counter;
-
 /* flags for received signals */
 WHERE SIG_ATOMIC_VOLATILE_T SigAlrm;
 WHERE SIG_ATOMIC_VOLATILE_T SigInt;
index ec5354f3d363c2247ad5696cb5523aae76e49ef5..af2a05ec99ee819832f8ba2310ef39e8572407e6 100644 (file)
@@ -1121,7 +1121,7 @@ void imap_close_connection(struct ImapAccountData *adata)
   adata->seqno = false;
   adata->nextcmd = false;
   adata->lastcmd = false;
-  adata->status = false;
+  adata->status = 0;
   memset(adata->cmds, 0, sizeof(struct ImapCommand) * adata->cmdslots);
 }
 
@@ -2212,7 +2212,7 @@ static int imap_mbox_open(struct Context *ctx)
   int count = 0;
   struct ImapMbox mx, pmx;
   int rc;
-  const char *condstore;
+  const char *condstore = NULL;
 
   if (imap_parse_path(ctx->mailbox->path, &mx))
   {
@@ -2245,7 +2245,7 @@ static int imap_mbox_open(struct Context *ctx)
   adata->ctx = ctx;
 
   /* clear mailbox status */
-  adata->status = false;
+  adata->status = 0;
   memset(adata->ctx->mailbox->rights, 0, sizeof(adata->ctx->mailbox->rights));
   adata->new_mail_count = 0;
   adata->max_msn = 0;
index b0bd44fbeb6c202a86aba3f8315b36afbc69f0e2..a9bd41942e2529291961b65587692e7d91f0d432 100644 (file)
--- a/mailbox.c
+++ b/mailbox.c
@@ -300,19 +300,13 @@ static int mailbox_mbox_check(struct Mailbox *mailbox, struct stat *sb, bool che
  */
 static void mailbox_check(struct Mailbox *m, struct stat *ctx_sb, bool check_stats)
 {
-  struct stat sb;
-#ifdef USE_SIDEBAR
-  short orig_new;
-  int orig_count, orig_unread, orig_flagged;
-#endif
-
-  memset(&sb, 0, sizeof(sb));
+  struct stat sb = { 0 };
 
 #ifdef USE_SIDEBAR
-  orig_new = m->has_new;
-  orig_count = m->msg_count;
-  orig_unread = m->msg_unread;
-  orig_flagged = m->msg_flagged;
+  short orig_new = m->has_new;
+  int orig_count = m->msg_count;
+  int orig_unread = m->msg_unread;
+  int orig_flagged = m->msg_flagged;
 #endif
 
   if (m->magic != MUTT_IMAP)
@@ -333,8 +327,7 @@ static void mailbox_check(struct Mailbox *m, struct stat *ctx_sb, bool check_sta
     else
 #endif
         if (stat(m->path, &sb) != 0 || (S_ISREG(sb.st_mode) && sb.st_size == 0) ||
-            ((m->magic == MUTT_UNKNOWN) &&
-             (m->magic = mx_path_probe(m->path, NULL)) <= 0))
+            ((m->magic == MUTT_UNKNOWN) && (m->magic = mx_path_probe(m->path, NULL)) <= 0))
     {
       /* if the mailbox still doesn't exist, set the newly created flag to be
        * ready for when it does. */
index be1462b475f73fe7127f54af3042842b9202a387..bfd30214b44c763315ce1d2a6567ddcff43273b7 100644 (file)
@@ -2383,8 +2383,8 @@ static int maildir_mbox_open_append(struct Context *ctx, int flags)
  */
 static int maildir_mbox_check(struct Context *ctx, int *index_hint)
 {
-  struct stat st_new; /* status of the "new" subdirectory */
-  struct stat st_cur; /* status of the "cur" subdirectory */
+  struct stat st_new;         /* status of the "new" subdirectory */
+  struct stat st_cur;         /* status of the "cur" subdirectory */
   int changed = 0;            /* bitmask representing which subdirectories
                                  have changed.  0x1 = new, 0x2 = cur */
   bool occult = false;        /* messages were removed from the mailbox */
diff --git a/mx.c b/mx.c
index 9e57b4184b4d3b69ba64d7bf189e692a8daac5bf..9cd1274cf3eb7851e09b77b200263ea4fb7aa1ef 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -253,8 +253,10 @@ struct Context *mx_mbox_open(const char *path, int flags)
   }
 
   if (!realpath(ctx->mailbox->path, ctx->mailbox->realpath))
+  {
     mutt_str_strfcpy(ctx->mailbox->realpath, ctx->mailbox->path,
                      sizeof(ctx->mailbox->realpath));
+  }
 
   ctx->msgnotreadyet = -1;
   ctx->collapsed = false;