]> granicus.if.org Git - neomutt/commitdiff
rename variables starting with a underscore
authorRichard Russon <rich@flatcap.org>
Wed, 6 Dec 2017 14:25:02 +0000 (14:25 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 7 Dec 2017 12:20:06 +0000 (12:20 +0000)
15 files changed:
imap/message.c
init.c
mbox.c
mh.c
mutt/charset.c
mutt/charset.h
mutt/file.c
mutt_notmuch.c
mx.h
ncrypt/gnupgparse.c
ncrypt/pgpinvoke.c
pgppubring.c
recvcmd.c
rfc1524.c
rfc1524.h

index 22eb362135f34154079d82d9b0b5d84828144ebb..4a87e46dcd7bab4d710b839e7ffbc1b8697326b4 100644 (file)
@@ -1045,7 +1045,7 @@ int imap_fetch_message(struct Context *ctx, struct Message *msg, int msgno)
   }
 
   /* This function is called in a few places after endwin()
-   * e.g. _mutt_pipe_message(). */
+   * e.g. mutt_pipe_message(). */
   output_progress = !isendwin();
   if (output_progress)
     mutt_message(_("Fetching message..."));
diff --git a/init.c b/init.c
index 148199073673608f45cac2dd17881bda805a2d25..7d9580376ebcbdacc535e6997108ccd8920ba339 100644 (file)
--- a/init.c
+++ b/init.c
@@ -2658,7 +2658,7 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data,
       }
       else if (query || *s->dptr != '=')
       {
-        char _tmp[LONG_STRING];
+        char tmp2[LONG_STRING];
         const char *val = NULL;
 
         if (myvar)
@@ -2676,17 +2676,17 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data,
         }
         else if (DTYPE(MuttVars[idx].type) == DT_ADDRESS)
         {
-          _tmp[0] = '\0';
-          rfc822_write_address(_tmp, sizeof(_tmp),
+          tmp2[0] = '\0';
+          rfc822_write_address(tmp2, sizeof(tmp2),
                                *((struct Address **) MuttVars[idx].data), 0);
-          val = _tmp;
+          val = tmp2;
         }
         else if (DTYPE(MuttVars[idx].type) == DT_PATH)
         {
-          _tmp[0] = '\0';
-          mutt_str_strfcpy(_tmp, NONULL(*((char **) MuttVars[idx].data)), sizeof(_tmp));
-          mutt_pretty_mailbox(_tmp, sizeof(_tmp));
-          val = _tmp;
+          tmp2[0] = '\0';
+          mutt_str_strfcpy(tmp2, NONULL(*((char **) MuttVars[idx].data)), sizeof(tmp2));
+          mutt_pretty_mailbox(tmp2, sizeof(tmp2));
+          val = tmp2;
         }
         else if (DTYPE(MuttVars[idx].type) == DT_MBTABLE)
         {
diff --git a/mbox.c b/mbox.c
index 79c287b51fc252a04718ef858388b87dfad879b4..2a5a06ccc9a833f00bfc1d557860d3bf25fae0d6 100644 (file)
--- a/mbox.c
+++ b/mbox.c
@@ -905,13 +905,13 @@ static bool mbox_has_new(struct Context *ctx)
 void mbox_reset_atime(struct Context *ctx, struct stat *st)
 {
   struct utimbuf utimebuf;
-  struct stat _st;
+  struct stat st2;
 
   if (!st)
   {
-    if (stat(ctx->path, &_st) < 0)
+    if (stat(ctx->path, &st2) < 0)
       return;
-    st = &_st;
+    st = &st2;
   }
 
   utimebuf.actime = st->st_atime;
diff --git a/mh.c b/mh.c
index 92410ef8ce436246ae93559db3c714b6fafd6169..e0a7d85330200851b5d549ddfb0dfbba4c219844 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -784,9 +784,8 @@ static void maildir_update_mtime(struct Context *ctx)
  * out a fake header structure generated by lazy maildir parsing.
  */
 struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname,
-                                    bool is_old, struct Header *_h)
+                                    bool is_old, struct Header *h)
 {
-  struct Header *h = _h;
   struct stat st;
 
   if (!h)
index 3602abedc7ffc323ff43c4eeee8829cd725d1609..424cdb669f4f9e8f52d085d9f24eae8444c40984 100644 (file)
@@ -225,20 +225,20 @@ const struct MimeNames PreferredMIMENames[] =
 
 /**
  * mutt_cs_fgetconv_close - Close an fgetconv handle
- * @param _fc fgetconv handle
+ * @param handle fgetconv handle
  */
-void mutt_cs_fgetconv_close(FGETCONV **_fc)
+void mutt_cs_fgetconv_close(FGETCONV **handle)
 {
-  struct FgetConv *fc = (struct FgetConv *) *_fc;
+  struct FgetConv *fc = (struct FgetConv *) *handle;
 
   if (fc->cd != (iconv_t) -1)
     iconv_close(fc->cd);
-  FREE(_fc);
+  FREE(handle);
 }
 
 /**
  * mutt_cs_fgetconv - Convert a file's character set
- * @param _fc fgetconv handle
+ * @param handle fgetconv handle
  * @retval num Next character in the converted file
  * @retval EOF Error
  *
@@ -246,9 +246,9 @@ void mutt_cs_fgetconv_close(FGETCONV **_fc)
  * Each call to this function will return one converted character.
  * The buffer is refilled automatically when empty.
  */
-int mutt_cs_fgetconv(FGETCONV *_fc)
+int mutt_cs_fgetconv(FGETCONV *handle)
 {
-  struct FgetConv *fc = (struct FgetConv *) _fc;
+  struct FgetConv *fc = (struct FgetConv *) handle;
 
   if (!fc)
     return EOF;
@@ -300,22 +300,22 @@ int mutt_cs_fgetconv(FGETCONV *_fc)
 
 /**
  * mutt_cs_fgetconvs - Convert a file's charset into a string buffer
- * @param buf Buffer for result
- * @param l   Length of buffer
- * @param _fc fgetconv handle
+ * @param buf    Buffer for result
+ * @param l      Length of buffer
+ * @param handle fgetconv handle
  * @retval ptr  Result buffer on success
  * @retval NULL Error
  *
  * Read a file into a buffer, converting the character set as it goes.
  */
-char *mutt_cs_fgetconvs(char *buf, size_t l, FGETCONV *_fc)
+char *mutt_cs_fgetconvs(char *buf, size_t l, FGETCONV *handle)
 {
   int c;
   size_t r;
 
   for (r = 0; r + 1 < l;)
   {
-    c = mutt_cs_fgetconv(_fc);
+    c = mutt_cs_fgetconv(handle);
     if (c == EOF)
       break;
     buf[r++] = (char) c;
index 27ab5e9c28e6fe478985d63e180f9c34c4ba23ab..449d28c9c6383ef68e26d2dd3b88b687836545a2 100644 (file)
@@ -32,7 +32,7 @@ extern char *Charset;
 typedef void *FGETCONV;
 
 /**
- * struct FgetConv - Cursor for converting a file's encoding
+ * struct EgetConv - Cursor for converting a file's encoding
  */
 struct FgetConv
 {
@@ -69,9 +69,9 @@ extern const struct MimeNames PreferredMIMENames[];
 
 void   mutt_cs_canonical_charset(char *dest, size_t dlen, const char *name);
 int    mutt_cs_chscmp(const char *s, const char *chs);
-void   mutt_cs_fgetconv_close(FGETCONV **fc);
-int    mutt_cs_fgetconv(FGETCONV *fc);
-char * mutt_cs_fgetconvs(char *buf, size_t l, FGETCONV *fc);
+void   mutt_cs_fgetconv_close(FGETCONV **handle);
+int    mutt_cs_fgetconv(FGETCONV *handle);
+char * mutt_cs_fgetconvs(char *buf, size_t l, FGETCONV *handle);
 char * mutt_cs_get_default_charset(void);
 size_t mutt_cs_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft, const char **inrepls, const char *outrepl);
 void   mutt_cs_set_langinfo_charset(void);
index a9c677915242ca22d5e33a4ff9819d3863a1013c..39b193c9e062c28f45705565984ace76c66a14d8 100644 (file)
@@ -849,10 +849,10 @@ int mutt_file_mkdir(const char *path, mode_t mode)
   }
 
   errno = 0;
-  char _path[PATH_MAX];
+  char tmp_path[PATH_MAX];
   const size_t len = strlen(path);
 
-  if (len >= sizeof(_path))
+  if (len >= sizeof(tmp_path))
   {
     errno = ENAMETOOLONG;
     return -1;
@@ -863,9 +863,9 @@ int mutt_file_mkdir(const char *path, mode_t mode)
     return 0;
 
   /* Create a mutable copy */
-  mutt_str_strfcpy(_path, path, sizeof(_path));
+  mutt_str_strfcpy(tmp_path, path, sizeof(tmp_path));
 
-  for (char *p = _path + 1; *p; p++)
+  for (char *p = tmp_path + 1; *p; p++)
   {
     if (*p != '/')
       continue;
@@ -873,13 +873,13 @@ int mutt_file_mkdir(const char *path, mode_t mode)
     /* Temporarily truncate the path */
     *p = '\0';
 
-    if ((mkdir(_path, S_IRWXU | S_IRWXG | S_IRWXO) != 0) && (errno != EEXIST))
+    if ((mkdir(tmp_path, S_IRWXU | S_IRWXG | S_IRWXO) != 0) && (errno != EEXIST))
       return -1;
 
     *p = '/';
   }
 
-  if ((mkdir(_path, mode) != 0) && (errno != EEXIST))
+  if ((mkdir(tmp_path, mode) != 0) && (errno != EEXIST))
     return -1;
 
   return 0;
@@ -897,14 +897,14 @@ int mutt_file_mkdir(const char *path, mode_t mode)
 time_t mutt_file_decrease_mtime(const char *f, struct stat *st)
 {
   struct utimbuf utim;
-  struct stat _st;
+  struct stat st2;
   time_t mtime;
 
   if (!st)
   {
-    if (stat(f, &_st) == -1)
+    if (stat(f, &st2) == -1)
       return -1;
-    st = &_st;
+    st = &st2;
   }
 
   mtime = st->st_mtime;
@@ -1024,13 +1024,13 @@ int mutt_file_chmod_add(const char *path, mode_t mode)
  */
 int mutt_file_chmod_add_stat(const char *path, mode_t mode, struct stat *st)
 {
-  struct stat _st;
+  struct stat st2;
 
   if (!st)
   {
-    if (stat(path, &_st) == -1)
+    if (stat(path, &st2) == -1)
       return -1;
-    st = &_st;
+    st = &st2;
   }
   return chmod(path, st->st_mode | mode);
 }
@@ -1076,13 +1076,13 @@ int mutt_file_chmod_rm(const char *path, mode_t mode)
  */
 int mutt_file_chmod_rm_stat(const char *path, mode_t mode, struct stat *st)
 {
-  struct stat _st;
+  struct stat st2;
 
   if (!st)
   {
-    if (stat(path, &_st) == -1)
+    if (stat(path, &st2) == -1)
       return -1;
-    st = &_st;
+    st = &st2;
   }
   return chmod(path, st->st_mode & ~mode);
 }
index f2637ea4a7b96b53b7a63ebfd95685f5396fffdd..3cdc8c37f57ecb146d8060ef3a415e19ca7cae93 100644 (file)
 #endif
 
 /* @def The definition in <notmuch.h> is broken */
-#define LIBNOTMUCH_CHECK_VERSION(_major, _minor, _micro)                            \
-  (LIBNOTMUCH_MAJOR_VERSION > (_major) ||                                           \
-   (LIBNOTMUCH_MAJOR_VERSION == (_major) && LIBNOTMUCH_MINOR_VERSION > (_minor)) || \
-   (LIBNOTMUCH_MAJOR_VERSION == (_major) && LIBNOTMUCH_MINOR_VERSION == (_minor) && \
-    LIBNOTMUCH_MICRO_VERSION >= (_micro)))
+#define LIBNOTMUCH_CHECK_VERSION(major, minor, micro)                            \
+  (LIBNOTMUCH_MAJOR_VERSION > (major) ||                                           \
+   (LIBNOTMUCH_MAJOR_VERSION == (major) && LIBNOTMUCH_MINOR_VERSION > (minor)) || \
+   (LIBNOTMUCH_MAJOR_VERSION == (major) && LIBNOTMUCH_MINOR_VERSION == (minor) && \
+    LIBNOTMUCH_MICRO_VERSION >= (micro)))
 
 /**
  * enum NmQueryType - Notmuch Query Types
diff --git a/mx.h b/mx.h
index a950506a2e20ebbf357fe9af9e6a37ee10ea860e..b358e76322949b6bb5f040b614223592518c397c 100644 (file)
--- a/mx.h
+++ b/mx.h
@@ -94,7 +94,7 @@ int mh_check_empty(const char *path);
 int maildir_check_empty(const char *path);
 
 struct Header *maildir_parse_message(int magic, const char *fname, bool is_old, struct Header *h);
-struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname, bool is_old, struct Header *_h);
+struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname, bool is_old, struct Header *h);
 void maildir_parse_flags(struct Header *h, const char *path);
 bool maildir_update_flags(struct Context *ctx, struct Header *o, struct Header *n);
 void maildir_flags(char *dest, size_t destlen, struct Header *hdr);
index ef7eba5bd43c97e8d15cc29dfcb61d9c123ac7f4..b31c96fef60d1e47f04e86913e227da2a1545144 100644 (file)
@@ -70,7 +70,7 @@
 
 /* decode the backslash-escaped user ids. */
 
-static char *_chs = NULL;
+static char *chs = NULL;
 
 static void fix_uid(char *uid)
 {
@@ -90,7 +90,7 @@ static void fix_uid(char *uid)
   }
   *d = '\0';
 
-  if (_chs && (cd = mutt_iconv_open(_chs, "utf-8", 0)) != (iconv_t) -1)
+  if (chs && (cd = mutt_iconv_open(chs, "utf-8", 0)) != (iconv_t) -1)
   {
     int n = s - uid + 1; /* chars available in original buffer */
     char *buf = NULL;
@@ -397,7 +397,7 @@ struct PgpKeyInfo *pgp_get_candidates(enum PgpRing keyring, struct ListHead *hin
   if (devnull == -1)
     return NULL;
 
-  mutt_str_replace(&_chs, Charset);
+  mutt_str_replace(&chs, Charset);
 
   thepid = pgp_invoke_list_keys(NULL, &fp, NULL, -1, -1, devnull, keyring, hints);
   if (thepid == -1)
index 04e626f9c31081d8a64b2176c3899f885035c25f..fd71aaf1988a4771a67a3f228aee4a091f241576 100644 (file)
@@ -238,14 +238,14 @@ pid_t pgp_invoke_traditional(FILE **pgpin, FILE **pgpout, FILE **pgperr,
 
 void pgp_invoke_import(const char *fname)
 {
-  char _fname[_POSIX_PATH_MAX + SHORT_STRING];
+  char tmp_fname[_POSIX_PATH_MAX + SHORT_STRING];
   char cmd[HUGE_STRING];
   struct PgpCommandContext cctx;
 
   memset(&cctx, 0, sizeof(cctx));
 
-  mutt_file_quote_filename(_fname, sizeof(_fname), fname);
-  cctx.fname = _fname;
+  mutt_file_quote_filename(tmp_fname, sizeof(tmp_fname), fname);
+  cctx.fname = tmp_fname;
   cctx.signas = PgpSignAs;
 
   mutt_pgp_command(cmd, sizeof(cmd), &cctx, PgpImportCommand);
index 4302a14f309df9b1269e4a8b9f95b5b77ce2ef6d..f724ec88abd6153e5d7390cd1c1d910f5c4046a2 100644 (file)
@@ -841,7 +841,7 @@ int main(int argc, char *const argv[])
   short version = 2;
   short secring = 0;
 
-  const char *_kring = NULL;
+  const char *tmp_kring = NULL;
   char *env_pgppath = NULL, *env_home = NULL;
 
   char pgppath[_POSIX_PATH_MAX];
@@ -865,7 +865,7 @@ int main(int argc, char *const argv[])
 
       case 'k':
       {
-        _kring = optarg;
+        tmp_kring = optarg;
         break;
       }
 
@@ -892,8 +892,8 @@ int main(int argc, char *const argv[])
     }
   }
 
-  if (_kring)
-    mutt_str_strfcpy(kring, _kring, sizeof(kring));
+  if (tmp_kring)
+    mutt_str_strfcpy(kring, tmp_kring, sizeof(kring));
   else
   {
     if ((env_pgppath = getenv("PGPPATH")))
index ac2aa3259a86851346807206778b3234c4d7f74c..a782395cbe8dd9728ed08ba44b60c99ba1fe336b 100644 (file)
--- a/recvcmd.c
+++ b/recvcmd.c
@@ -328,27 +328,27 @@ static struct AttachPtr *find_parent(struct AttachCtx *actx, struct Body *cur, s
   return parent;
 }
 
-static void include_header(int quote, FILE *ifp, struct Header *hdr, FILE *ofp, char *_prefix)
+static void include_header(int quote, FILE *ifp, struct Header *hdr, FILE *ofp, char *prefix)
 {
   int chflags = CH_DECODE;
-  char prefix[SHORT_STRING];
+  char prefix2[SHORT_STRING];
 
   if (option(OPT_WEED))
     chflags |= CH_WEED | CH_REORDER;
 
   if (quote)
   {
-    if (_prefix)
-      mutt_str_strfcpy(prefix, _prefix, sizeof(prefix));
+    if (prefix)
+      mutt_str_strfcpy(prefix2, prefix, sizeof(prefix2));
     else if (!option(OPT_TEXT_FLOWED))
-      mutt_make_string_flags(prefix, sizeof(prefix), NONULL(IndentString), Context, hdr, 0);
+      mutt_make_string_flags(prefix2, sizeof(prefix2), NONULL(IndentString), Context, hdr, 0);
     else
-      mutt_str_strfcpy(prefix, ">", sizeof(prefix));
+      mutt_str_strfcpy(prefix2, ">", sizeof(prefix2));
 
     chflags |= CH_PREFIX;
   }
 
-  mutt_copy_header(ifp, hdr, ofp, chflags, quote ? prefix : NULL);
+  mutt_copy_header(ifp, hdr, ofp, chflags, quote ? prefix2 : NULL);
 }
 
 /**
index 5b21a1709a234e419c41e275a22dc919d154ef39..356347ccf4aa87c38911ef5a7e1d224b6d9c60d4 100644 (file)
--- a/rfc1524.c
+++ b/rfc1524.c
  * In addition, this function returns a 0 if the command works on a file,
  * and 1 if the command works on a pipe.
  */
-int rfc1524_expand_command(struct Body *a, char *filename, char *_type, char *command, int clen)
+int rfc1524_expand_command(struct Body *a, char *filename, char *type, char *command, int clen)
 {
   int x = 0, y = 0;
   int needspipe = true;
   char buf[LONG_STRING];
-  char type[LONG_STRING];
+  char type2[LONG_STRING];
 
-  mutt_str_strfcpy(type, _type, sizeof(type));
+  mutt_str_strfcpy(type2, type, sizeof(type2));
 
   if (option(OPT_MAILCAP_SANITIZE))
-    mutt_file_sanitize_filename(type, 0);
+    mutt_file_sanitize_filename(type2, 0);
 
   while (x < clen - 1 && command[x] && y < sizeof(buf) - 1)
   {
@@ -86,7 +86,7 @@ int rfc1524_expand_command(struct Body *a, char *filename, char *_type, char *co
       {
         char param[STRING];
         char pvalue[STRING];
-        char *_pvalue = NULL;
+        char *pvalue2 = NULL;
         int z = 0;
 
         x++;
@@ -94,8 +94,8 @@ int rfc1524_expand_command(struct Body *a, char *filename, char *_type, char *co
           param[z++] = command[x++];
         param[z] = '\0';
 
-        _pvalue = mutt_param_get(param, a->parameter);
-        mutt_str_strfcpy(pvalue, NONULL(_pvalue), sizeof(pvalue));
+        pvalue2 = mutt_param_get(param, a->parameter);
+        mutt_str_strfcpy(pvalue, NONULL(pvalue2), sizeof(pvalue));
         if (option(OPT_MAILCAP_SANITIZE))
           mutt_file_sanitize_filename(pvalue, 0);
 
@@ -108,7 +108,7 @@ int rfc1524_expand_command(struct Body *a, char *filename, char *_type, char *co
       }
       else if (command[x] == 't')
       {
-        y += mutt_file_quote_filename(buf + y, sizeof(buf) - y, type);
+        y += mutt_file_quote_filename(buf + y, sizeof(buf) - y, type2);
       }
       x++;
     }
index 16987468dd2257ba08ccfccafd437855d8f7d697..5394646550ce9102e94839cbe731d7c411bb09ac 100644 (file)
--- a/rfc1524.h
+++ b/rfc1524.h
@@ -47,7 +47,7 @@ struct Rfc1524MailcapEntry
 
 struct Rfc1524MailcapEntry *rfc1524_new_entry(void);
 void rfc1524_free_entry(struct Rfc1524MailcapEntry **entry);
-int rfc1524_expand_command(struct Body *a, char *filename, char *_type, char *command, int clen);
+int rfc1524_expand_command(struct Body *a, char *filename, char *type, char *command, int clen);
 int rfc1524_expand_filename(char *nametemplate, char *oldfile, char *newfile, size_t nflen);
 int rfc1524_mailcap_lookup(struct Body *a, char *type, struct Rfc1524MailcapEntry *entry, int opt);