]> granicus.if.org Git - neomutt/commitdiff
rename variables: progressbar -> progress
authorRichard Russon <rich@flatcap.org>
Thu, 28 Feb 2019 14:35:55 +0000 (14:35 +0000)
committerRichard Russon <rich@flatcap.org>
Sun, 3 Mar 2019 00:07:25 +0000 (00:07 +0000)
Consistent variable naming makes the code easier to read.

imap/message.c
mutt_attach.c
pop/pop.c
pop/pop_lib.c
pop/pop_private.h

index d51477c6b5a3cd35f9f0048011c8be340029fbb8..cb917c11b8c2bd0c4d93ca7b800c21fea2a653a6 100644 (file)
@@ -1421,7 +1421,7 @@ int imap_append_message(struct Mailbox *m, struct Message *msg)
   char internaldate[IMAP_DATELEN];
   char imap_flags[128];
   size_t len;
-  struct Progress progressbar;
+  struct Progress progress;
   size_t sent;
   int c, last;
   int rc;
@@ -1451,8 +1451,7 @@ int imap_append_message(struct Mailbox *m, struct Message *msg)
   }
   rewind(fp);
 
-  mutt_progress_init(&progressbar, _("Uploading message..."),
-                     MUTT_PROGRESS_SIZE, C_NetInc, len);
+  mutt_progress_init(&progress, _("Uploading message..."), MUTT_PROGRESS_SIZE, C_NetInc, len);
 
   mutt_date_make_imap(internaldate, sizeof(internaldate), msg->received);
 
@@ -1500,7 +1499,7 @@ int imap_append_message(struct Mailbox *m, struct Message *msg)
     {
       sent += len;
       flush_buffer(buf, &len, adata->conn);
-      mutt_progress_update(&progressbar, sent, -1);
+      mutt_progress_update(&progress, sent, -1);
     }
   }
 
@@ -1838,7 +1837,7 @@ int imap_msg_open(struct Mailbox *m, struct Message *msg, int msgno)
   char buf[1024];
   char *pc = NULL;
   unsigned int bytes;
-  struct Progress progressbar;
+  struct Progress progress;
   unsigned int uid;
   bool retried = false;
   bool read;
@@ -1925,11 +1924,10 @@ int imap_msg_open(struct Mailbox *m, struct Message *msg, int msgno)
           }
           if (output_progress)
           {
-            mutt_progress_init(&progressbar, _("Fetching message..."),
+            mutt_progress_init(&progress, _("Fetching message..."),
                                MUTT_PROGRESS_SIZE, C_NetInc, bytes);
           }
-          if (imap_read_literal(msg->fp, adata, bytes,
-                                output_progress ? &progressbar : NULL) < 0)
+          if (imap_read_literal(msg->fp, adata, bytes, output_progress ? &progress : NULL) < 0)
           {
             goto bail;
           }
index 8a13f739fdb5bf8ca418c0654b7fb8e260edb34c..e397c57dae2abafaa6e934153c6d8b8627f683f0 100644 (file)
@@ -525,13 +525,12 @@ int mutt_view_attachment(FILE *fp, struct Body *a, int flag, struct Email *e,
       {
         if (a->description)
         {
-          snprintf(desc, sizeof(desc),
-                   _("---Command: %-20.20s Description: %s"), cmd, a->description);
+          snprintf(desc, sizeof(desc), _("---Command: %-20.20s Description: %s"),
+                   cmd, a->description);
         }
         else
         {
-          snprintf(desc, sizeof(desc),
-                   _("---Command: %-30.30s Attachment: %s"), cmd, type);
+          snprintf(desc, sizeof(desc), _("---Command: %-30.30s Attachment: %s"), cmd, type);
         }
       }
 
index d44628555407d5abeb8b54677888483627d0f09d..c98095a78e87177ee00cc1ebeb10fd01e160ef90 100644 (file)
--- a/pop/pop.c
+++ b/pop/pop.c
@@ -1060,7 +1060,7 @@ static int pop_msg_open(struct Mailbox *m, struct Message *msg, int msgno)
 
   char buf[1024];
   char path[PATH_MAX];
-  struct Progress progressbar;
+  struct Progress progress;
   struct PopAccountData *adata = pop_adata_get(m);
   struct Email *e = m->emails[msgno];
   struct PopEmailData *edata = e->edata;
@@ -1109,7 +1109,7 @@ static int pop_msg_open(struct Mailbox *m, struct Message *msg, int msgno)
       return -1;
     }
 
-    mutt_progress_init(&progressbar, _("Fetching message..."), MUTT_PROGRESS_SIZE,
+    mutt_progress_init(&progress, _("Fetching message..."), MUTT_PROGRESS_SIZE,
                        C_NetInc, e->content->length + e->content->offset - 1);
 
     /* see if we can put in body cache; use our cache as fallback */
@@ -1129,7 +1129,7 @@ static int pop_msg_open(struct Mailbox *m, struct Message *msg, int msgno)
 
     snprintf(buf, sizeof(buf), "RETR %d\r\n", e->refno);
 
-    const int ret = pop_fetch_data(adata, buf, &progressbar, fetch_message, msg->fp);
+    const int ret = pop_fetch_data(adata, buf, &progress, fetch_message, msg->fp);
     if (ret == 0)
       break;
 
index 5dd6977489f76c256b42fb9194fd536a51bdd6e0..14576fa7be182e52f8baa2a382c0227846636567 100644 (file)
@@ -477,11 +477,11 @@ int pop_query_d(struct PopAccountData *adata, char *buf, size_t buflen, char *ms
 
 /**
  * pop_fetch_data - Read Headers with callback function
- * @param adata       POP Account data
- * @param query       POP query to send to server
- * @param progressbar Progress bar
- * @param func        Function called for each header read
- * @param data        Data to pass to the callback
+ * @param adata    POP Account data
+ * @param query    POP query to send to server
+ * @param progress Progress bar
+ * @param func     Function called for each header read
+ * @param data     Data to pass to the callback
  * @retval  0 Successful
  * @retval -1 Connection lost
  * @retval -2 Invalid command or execution error
@@ -491,7 +491,7 @@ int pop_query_d(struct PopAccountData *adata, char *buf, size_t buflen, char *ms
  * func(NULL, *data)  if  rewind(*data)  needs, exits when fail or done.
  */
 int pop_fetch_data(struct PopAccountData *adata, const char *query,
-                   struct Progress *progressbar, int (*func)(char *, void *), void *data)
+                   struct Progress *progress, int (*func)(char *, void *), void *data)
 {
   char buf[1024];
   long pos = 0;
@@ -533,8 +533,8 @@ int pop_fetch_data(struct PopAccountData *adata, const char *query,
     }
     else
     {
-      if (progressbar)
-        mutt_progress_update(progressbar, pos, -1);
+      if (progress)
+        mutt_progress_update(progress, pos, -1);
       if ((ret == 0) && (func(inbuf, data) < 0))
         ret = -3;
       lenbuf = 0;
@@ -603,14 +603,14 @@ int pop_reconnect(struct Mailbox *m)
     int ret = pop_open_connection(adata);
     if (ret == 0)
     {
-      struct Progress progressbar;
-      mutt_progress_init(&progressbar, _("Verifying message indexes..."),
+      struct Progress progress;
+      mutt_progress_init(&progress, _("Verifying message indexes..."),
                          MUTT_PROGRESS_SIZE, C_NetInc, 0);
 
       for (int i = 0; i < m->msg_count; i++)
         m->emails[i]->refno = -1;
 
-      ret = pop_fetch_data(adata, "UIDL\r\n", &progressbar, check_uidl, m);
+      ret = pop_fetch_data(adata, "UIDL\r\n", &progress, check_uidl, m);
       if (ret == -2)
       {
         mutt_error("%s", adata->err_msg);
index 9279986dd6137cce96743d6a7bf1cda6d0cd461b..a84ccf5cec7e98cecf248703cb4026e1337bd207 100644 (file)
@@ -130,8 +130,8 @@ int pop_parse_path(const char *path, struct ConnAccount *acct);
 int pop_connect(struct PopAccountData *adata);
 int pop_open_connection(struct PopAccountData *adata);
 int pop_query_d(struct PopAccountData *adata, char *buf, size_t buflen, char *msg);
-int pop_fetch_data(struct PopAccountData *adata, const char *query, struct Progress *progressbar,
-                   int (*func)(char *, void *), void *data);
+int pop_fetch_data(struct PopAccountData *adata, const char *query,
+                   struct Progress *progress, int (*func)(char *, void *), void *data);
 int pop_reconnect(struct Mailbox *m);
 void pop_logout(struct Mailbox *m);
 struct PopAccountData *pop_adata_get(struct Mailbox *m);