diff options
author | devzero2000 <devzero2000> | 2014-01-08 11:16:14 +0000 |
---|---|---|
committer | devzero2000 <devzero2000> | 2014-01-08 11:16:14 +0000 |
commit | fd12de829935607074ea9d98690c9b13fd7a075b (patch) | |
tree | 58d0a7e0d9c42f38c5429189ab57bd8c60d0ce43 | |
parent | 16bff9b54f462340f7a01efcb7ac982e6d1777a2 (diff) | |
download | libpopt-fd12de829935607074ea9d98690c9b13fd7a075b.tar.gz |
popthelp.c reduce variables scope (cppcheck warning)
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | popthelp.c | 4 |
2 files changed, 3 insertions, 2 deletions
@@ -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 @@ -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); |