From: Richard Russon Date: Wed, 6 Dec 2017 14:25:02 +0000 (+0000) Subject: rename variables starting with a underscore X-Git-Tag: neomutt-20171208~8^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e00a23ae70af0190af0137df3eb28aec66dd463d;p=neomutt rename variables starting with a underscore --- diff --git a/imap/message.c b/imap/message.c index 22eb36213..4a87e46dc 100644 --- a/imap/message.c +++ b/imap/message.c @@ -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 148199073..7d9580376 100644 --- 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 79c287b51..2a5a06ccc 100644 --- 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 92410ef8c..e0a7d8533 100644 --- 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) diff --git a/mutt/charset.c b/mutt/charset.c index 3602abedc..424cdb669 100644 --- a/mutt/charset.c +++ b/mutt/charset.c @@ -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; diff --git a/mutt/charset.h b/mutt/charset.h index 27ab5e9c2..449d28c9c 100644 --- a/mutt/charset.h +++ b/mutt/charset.h @@ -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); diff --git a/mutt/file.c b/mutt/file.c index a9c677915..39b193c9e 100644 --- a/mutt/file.c +++ b/mutt/file.c @@ -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); } diff --git a/mutt_notmuch.c b/mutt_notmuch.c index f2637ea4a..3cdc8c37f 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -68,11 +68,11 @@ #endif /* @def The definition in 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 a950506a2..b358e7632 100644 --- 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); diff --git a/ncrypt/gnupgparse.c b/ncrypt/gnupgparse.c index ef7eba5bd..b31c96fef 100644 --- a/ncrypt/gnupgparse.c +++ b/ncrypt/gnupgparse.c @@ -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) diff --git a/ncrypt/pgpinvoke.c b/ncrypt/pgpinvoke.c index 04e626f9c..fd71aaf19 100644 --- a/ncrypt/pgpinvoke.c +++ b/ncrypt/pgpinvoke.c @@ -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); diff --git a/pgppubring.c b/pgppubring.c index 4302a14f3..f724ec88a 100644 --- a/pgppubring.c +++ b/pgppubring.c @@ -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"))) diff --git a/recvcmd.c b/recvcmd.c index ac2aa3259..a782395cb 100644 --- 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); } /** diff --git a/rfc1524.c b/rfc1524.c index 5b21a1709..356347ccf 100644 --- a/rfc1524.c +++ b/rfc1524.c @@ -60,17 +60,17 @@ * 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++; } diff --git a/rfc1524.h b/rfc1524.h index 16987468d..539464655 100644 --- 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);