]> granicus.if.org Git - neomutt/commitdiff
rename variables/parameters
authorRichard Russon <rich@flatcap.org>
Mon, 29 Apr 2019 22:17:33 +0000 (23:17 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 29 Apr 2019 22:47:45 +0000 (23:47 +0100)
Rename variables for consistency or clarity.

address/group.c
address/group.h
monitor.c
mutt/file.c
mutt/file.h
mutt/md5.c
sendlib.c

index 847433ca33e50365f722a29486858409789203d6..88c9501dcf02346532b4f7f0a43eb5bc2032ac6c 100644 (file)
@@ -57,28 +57,28 @@ void mutt_grouplist_free(void)
 
 /**
  * mutt_pattern_group - Match a pattern to a Group
- * @param k Pattern to match
+ * @param pat Pattern to match
  * @retval ptr Matching Group
  * @retval ptr Newly created Group (if no match)
  */
-struct Group *mutt_pattern_group(const char *k)
+struct Group *mutt_pattern_group(const char *pat)
 {
-  struct Group *p = NULL;
+  struct Group *g = NULL;
 
-  if (!k)
+  if (!pat)
     return 0;
 
-  p = mutt_hash_find(Groups, k);
-  if (!p)
+  g = mutt_hash_find(Groups, pat);
+  if (!g)
   {
-    mutt_debug(LL_DEBUG2, "Creating group %s\n", k);
-    p = mutt_mem_calloc(1, sizeof(struct Group));
-    p->name = mutt_str_strdup(k);
-    STAILQ_INIT(&p->rs);
-    mutt_hash_insert(Groups, p->name, p);
+    mutt_debug(LL_DEBUG2, "Creating group %s\n", pat);
+    g = mutt_mem_calloc(1, sizeof(struct Group));
+    g->name = mutt_str_strdup(pat);
+    STAILQ_INIT(&g->rs);
+    mutt_hash_insert(Groups, g->name, g);
   }
 
-  return p;
+  return g;
 }
 
 /**
index 6eb39945a07530599e4ff253793908903076bbdb..780e9d203f3ee38d148b4207b53bac2a9876201c 100644 (file)
@@ -64,6 +64,6 @@ int  mutt_grouplist_remove_regex(struct GroupList *head, const char *s);
 int  mutt_grouplist_remove_addrlist(struct GroupList *head, struct Address *a);
 
 bool mutt_group_match(struct Group *g, const char *s);
-struct Group *mutt_pattern_group(const char *k);
+struct Group *mutt_pattern_group(const char *pat);
 
 #endif /* MUTT_GROUP_H */
index b5a8f4059cccdb2781752b678e02608143877a85..f39873159f08ebd1eef9bfadb8e7a9a1c8838322 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -379,7 +379,7 @@ int mutt_monitor_poll(void)
     }
     else
     {
-      bool inputReady = false;
+      bool input_ready = false;
       for (int i = 0; fds && (i < PollFdsCount); i++)
       {
         if (PollFds[i].revents)
@@ -387,7 +387,7 @@ int mutt_monitor_poll(void)
           fds--;
           if (PollFds[i].fd == 0)
           {
-            inputReady = true;
+            input_ready = true;
           }
           else if (PollFds[i].fd == INotifyFd)
           {
@@ -422,7 +422,7 @@ int mutt_monitor_poll(void)
           }
         }
       }
-      if (!inputReady)
+      if (!input_ready)
         rc = MonitorFilesChanged ? -2 : -3;
     }
   }
index a19081b7b7ac9a1dd1a27fc33511ca538f805912..0ad1daa9b3264e4b38430ee78b956267b2e4c969 100644 (file)
@@ -571,18 +571,18 @@ FILE *mutt_file_fopen(const char *path, const char *mode)
 
 /**
  * mutt_file_sanitize_filename - Replace unsafe characters in a filename
- * @param fp     Filename to make safe
+ * @param path  Filename to make safe
  * @param slash Replace '/' characters too
  */
-void mutt_file_sanitize_filename(char *fp, bool slash)
+void mutt_file_sanitize_filename(char *path, bool slash)
 {
-  if (!fp)
+  if (!path)
     return;
 
-  for (; *fp; fp++)
+  for (; *path; path++)
   {
-    if ((slash && (*fp == '/')) || !strchr(safe_chars, *fp))
-      *fp = '_';
+    if ((slash && (*path == '/')) || !strchr(safe_chars, *path))
+      *path = '_';
   }
 }
 
index 09bf95e5921c47973b8bf4b9cdd260807dc8549f..2515fbdcf0fd16aa1743b981aa89e48825e00f59 100644 (file)
@@ -109,7 +109,7 @@ char *      mutt_file_read_line(char *line, size_t *size, FILE *fp, int *line_nu
 int         mutt_file_rename(const char *oldfile, const char *newfile);
 int         mutt_file_rmtree(const char *path);
 int         mutt_file_safe_rename(const char *src, const char *target);
-void        mutt_file_sanitize_filename(char *fp, bool slash);
+void        mutt_file_sanitize_filename(char *path, bool slash);
 int         mutt_file_sanitize_regex(struct Buffer *dest, const char *src);
 void        mutt_file_set_mtime(const char *from, const char *to);
 int         mutt_file_stat_compare(struct stat *sba, enum MuttStatType sba_type, struct stat *sbb, enum MuttStatType sbb_type);
index 67421f9f60bdd726d582ff0f44a37873a5494f05..e01a9d4c278fe3c981b91549849923038eef6417 100644 (file)
@@ -346,24 +346,24 @@ void mutt_md5_process(const char *str, struct Md5Ctx *md5ctx)
 
 /**
  * mutt_md5_process_bytes - Process a block of data
- * @param buffer Buffer to process
- * @param len    Length of buffer
+ * @param buf    Buffer to process
+ * @param buflen Length of buffer
  * @param md5ctx MD5 context
  *
  * Starting with the result of former calls of this function (or the
- * initialization function update the context for the next LEN bytes starting
- * at Buffer.  It is NOT required that LEN is a multiple of 64.
+ * initialization function update the context for the next BUFLEN bytes starting
+ * at Buffer.  It is NOT required that BUFLEN is a multiple of 64.
  */
-void mutt_md5_process_bytes(const void *buffer, size_t len, struct Md5Ctx *md5ctx)
+void mutt_md5_process_bytes(const void *buf, size_t buflen, struct Md5Ctx *md5ctx)
 {
   /* When we already have some bits in our internal buffer concatenate both
    * inputs first. */
   if (md5ctx->buflen != 0)
   {
     size_t left_over = md5ctx->buflen;
-    size_t add = ((128 - left_over) > len) ? len : (128 - left_over);
+    size_t add = ((128 - left_over) > buflen) ? buflen : (128 - left_over);
 
-    memcpy(&((char *) md5ctx->buffer)[left_over], buffer, add);
+    memcpy(&((char *) md5ctx->buffer)[left_over], buf, add);
     md5ctx->buflen += add;
 
     if (md5ctx->buflen > 64)
@@ -376,41 +376,41 @@ void mutt_md5_process_bytes(const void *buffer, size_t len, struct Md5Ctx *md5ct
              md5ctx->buflen);
     }
 
-    buffer = (const char *) buffer + add;
-    len -= add;
+    buf = (const char *) buf + add;
+    buflen -= add;
   }
 
   /* Process available complete blocks. */
-  if (len >= 64)
+  if (buflen >= 64)
   {
 #if !defined(_STRING_ARCH_unaligned)
 #define alignof(type) offsetof(struct { char c; type x; }, x)
 #define UNALIGNED_P(p) (((size_t) p) % alignof(md5_uint32) != 0)
-    if (UNALIGNED_P(buffer))
+    if (UNALIGNED_P(buf))
     {
-      while (len > 64)
+      while (buflen > 64)
       {
-        mutt_md5_process_block(memcpy(md5ctx->buffer, buffer, 64), 64, md5ctx);
-        buffer = (const char *) buffer + 64;
-        len -= 64;
+        mutt_md5_process_block(memcpy(md5ctx->buffer, buf, 64), 64, md5ctx);
+        buf = (const char *) buf + 64;
+        buflen -= 64;
       }
     }
     else
 #endif
     {
-      mutt_md5_process_block(buffer, len & ~63, md5ctx);
-      buffer = (const char *) buffer + (len & ~63);
-      len &= 63;
+      mutt_md5_process_block(buf, buflen & ~63, md5ctx);
+      buf = (const char *) buf + (buflen & ~63);
+      buflen &= 63;
     }
   }
 
   /* Move remaining bytes in internal buffer. */
-  if (len > 0)
+  if (buflen > 0)
   {
     size_t left_over = md5ctx->buflen;
 
-    memcpy(&((char *) md5ctx->buffer)[left_over], buffer, len);
-    left_over += len;
+    memcpy(&((char *) md5ctx->buffer)[left_over], buf, buflen);
+    left_over += buflen;
     if (left_over >= 64)
     {
       mutt_md5_process_block(md5ctx->buffer, 64, md5ctx);
index 4f56c9a1042371fe2335ef0fa238ce90cddabd9d..b42b12012b9875ac90750b95c313a9d041475719 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -3273,7 +3273,7 @@ int mutt_write_fcc(const char *path, struct Email *e, const char *msgid,
 
   if (fp_tmp)
   {
-    char sasha[1024];
+    char line_buf[1024];
     int lines = 0;
 
     mutt_write_mime_body(e->content, fp_tmp);
@@ -3301,7 +3301,7 @@ int mutt_write_fcc(const char *path, struct Email *e, const char *msgid,
 
     /* count the number of lines */
     rewind(fp_tmp);
-    while (fgets(sasha, sizeof(sasha), fp_tmp))
+    while (fgets(line_buf, sizeof(line_buf), fp_tmp))
       lines++;
     fprintf(msg->fp, "Content-Length: " OFF_T_FMT "\n", (LOFF_T) ftello(fp_tmp));
     fprintf(msg->fp, "Lines: %d\n\n", lines);