From fd12de829935607074ea9d98690c9b13fd7a075b Mon Sep 17 00:00:00 2001 From: devzero2000 Date: Wed, 8 Jan 2014 11:16:14 +0000 Subject: popthelp.c reduce variables scope (cppcheck warning) --- CHANGES | 1 + popthelp.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 61a101a..852aca4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,5 @@ 1.17 -> 2.0: + - devzero2000: popthelp.c reduce variables scope (cppcheck warning) - devzero2000: poptint.c reduce variables scope (cppcheck warning) - devzero2000: poptconfig.c reduce variables scope (cppcheck warning) - devzero2000: add cppcheck conditional makefile target diff --git a/popthelp.c b/popthelp.c index 90785a3..ce7581f 100644 --- a/popthelp.c +++ b/popthelp.c @@ -536,7 +536,6 @@ static size_t maxArgWidth(const struct poptOption * opt, /*@*/ { size_t max = 0; - const char * argDescrip; if (opt != NULL) while (opt->longName || opt->shortName || opt->arg) { @@ -547,6 +546,7 @@ static size_t maxArgWidth(const struct poptOption * opt, if (len > max) max = len; } else if (!F_ISSET(opt, DOC_HIDDEN)) { len = sizeof(" ")-1; + const char * argDescrip; /* XXX --long always padded for alignment with/without "-X, ". */ len += sizeof("-X, ")-1; if (opt->longName) { @@ -618,7 +618,6 @@ static void singleTableHelp(poptContext con, FILE * fp, /*@modifies fp, columns->cur, fileSystem @*/ { const struct poptOption * opt; - const char *sub_transdom; if (table == poptAliasOptions) { itemHelp(fp, con->aliases, con->numAliases, columns, NULL); @@ -634,6 +633,7 @@ static void singleTableHelp(poptContext con, FILE * fp, if (table != NULL) for (opt = table; opt->longName || opt->shortName || opt->arg; opt++) { + const char *sub_transdom; if (poptArgType(opt) != POPT_ARG_INCLUDE_TABLE) continue; sub_transdom = getTableTranslationDomain(opt->arg); -- cgit v1.2.1