From 7e617bde3629f7fbfa7e600621a6196f2653498e Mon Sep 17 00:00:00 2001 From: jbj Date: Thu, 19 Nov 1998 19:10:23 +0000 Subject: [PATCH] lclint noise. CVS patchset: 2544 CVS date: 1998/11/19 19:10:23 --- .lclintrc | 1 - build/.lclintrc | 1 - build/parseDescription.c | 6 +-- build/parseFiles.c | 6 +-- build/parsePrep.c | 16 +++--- build/parseScript.c | 8 +-- lib/.lclintrc | 1 - lib/cpio.c | 2 + lib/query.c | 22 ++++---- lib/rpmrc.c | 2 + lib/uninstall.c | 13 +++-- rpm.c | 138 +++++++++++++++++++++++------------------------ 12 files changed, 110 insertions(+), 106 deletions(-) diff --git a/.lclintrc b/.lclintrc index d2c745b..8b1c04e 100644 --- a/.lclintrc +++ b/.lclintrc @@ -8,7 +8,6 @@ +unixlib -fixedformalarray --fullinitblock -type # -weak paramaters diff --git a/build/.lclintrc b/build/.lclintrc index 7866403..2e28259 100644 --- a/build/.lclintrc +++ b/build/.lclintrc @@ -8,7 +8,6 @@ +unixlib -fixedformalarray --fullinitblock -type # -weak paramaters diff --git a/build/parseDescription.c b/build/parseDescription.c index 6f8b382..d2cb3c8 100644 --- a/build/parseDescription.c +++ b/build/parseDescription.c @@ -11,9 +11,9 @@ extern int noLang; /* XXX FIXME: pass as arg */ static char *lang; static struct poptOption optionsTable[] = { - { NULL, 'n', POPT_ARG_STRING, &name, 'n' }, - { NULL, 'l', POPT_ARG_STRING, &lang, 'l' }, - { 0, 0, 0, 0, 0 } + { NULL, 'n', POPT_ARG_STRING, &name, 'n', NULL, NULL}, + { NULL, 'l', POPT_ARG_STRING, &lang, 'l', NULL, NULL}, + { 0, 0, 0, 0, 0, NULL, NULL} }; int parseDescription(Spec spec) diff --git a/build/parseFiles.c b/build/parseFiles.c index fcbe6eb..f43c654 100644 --- a/build/parseFiles.c +++ b/build/parseFiles.c @@ -8,9 +8,9 @@ static char *name; static char *file; static struct poptOption optionsTable[] = { - { NULL, 'n', POPT_ARG_STRING, &name, 'n' }, - { NULL, 'f', POPT_ARG_STRING, &file, 'f' }, - { 0, 0, 0, 0, 0 } + { NULL, 'n', POPT_ARG_STRING, &name, 'n', NULL, NULL}, + { NULL, 'f', POPT_ARG_STRING, &file, 'f', NULL, NULL}, + { 0, 0, 0, 0, 0, NULL, NULL} }; int parseFiles(Spec spec) diff --git a/build/parsePrep.c b/build/parsePrep.c index 3e9db44..078deb8 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -9,14 +9,14 @@ static int createDir, quietly; static char * dirName; static struct poptOption optionsTable[] = { - { NULL, 'a', POPT_ARG_STRING, NULL, 'a' }, - { NULL, 'b', POPT_ARG_STRING, NULL, 'b' }, - { NULL, 'c', 0, &createDir, 0 }, - { NULL, 'D', 0, &leaveDirs, 0 }, - { NULL, 'n', POPT_ARG_STRING, &dirName, 0 }, - { NULL, 'T', 0, &skipDefaultAction, 0 }, - { NULL, 'q', 0, &quietly, 0 }, - { 0, 0, 0, 0, 0 } + { NULL, 'a', POPT_ARG_STRING, NULL, 'a', NULL, NULL}, + { NULL, 'b', POPT_ARG_STRING, NULL, 'b', NULL, NULL}, + { NULL, 'c', 0, &createDir, 0, NULL, NULL}, + { NULL, 'D', 0, &leaveDirs, 0, NULL, NULL}, + { NULL, 'n', POPT_ARG_STRING, &dirName, 0, NULL, NULL}, + { NULL, 'T', 0, &skipDefaultAction, 0, NULL, NULL}, + { NULL, 'q', 0, &quietly, 0, NULL, NULL}, + { 0, 0, 0, 0, 0, NULL, NULL} }; #ifdef DYING diff --git a/build/parseScript.c b/build/parseScript.c index 001f9f5..5c4dd67 100644 --- a/build/parseScript.c +++ b/build/parseScript.c @@ -11,10 +11,10 @@ static int addTriggerIndex(Package pkg, char *file, char *script, char *prog); static char *prog; static char *file; static struct poptOption optionsTable[] = { - { NULL, 'p', POPT_ARG_STRING, &prog, 'p' }, - { NULL, 'n', POPT_ARG_STRING, &name, 'n' }, - { NULL, 'f', POPT_ARG_STRING, &file, 'f' }, - { 0, 0, 0, 0, 0 } + { NULL, 'p', POPT_ARG_STRING, &prog, 'p', NULL, NULL}, + { NULL, 'n', POPT_ARG_STRING, &name, 'n', NULL, NULL}, + { NULL, 'f', POPT_ARG_STRING, &file, 'f', NULL, NULL}, + { 0, 0, 0, 0, 0, NULL, NULL} }; /* %trigger is a strange combination of %pre and Requires: behavior */ diff --git a/lib/.lclintrc b/lib/.lclintrc index 21483c6..9b6c66c 100644 --- a/lib/.lclintrc +++ b/lib/.lclintrc @@ -10,7 +10,6 @@ # not-yet normal parameters -boolops # w->n -fixedformalarray --fullinitblock -null -predboolint # w->n -predboolothers # w->n diff --git a/lib/cpio.c b/lib/cpio.c index fe47bd4..d808aa3 100644 --- a/lib/cpio.c +++ b/lib/cpio.c @@ -838,7 +838,9 @@ int cpioBuildArchive(CFD_t *cfd, struct cpioFileMapping * mappings, struct cpioCallbackInfo cbinfo; struct cpioCrcPhysicalHeader hdr; struct stat sb; +/*@-fullinitblock@*/ struct hardLink hlinkList = { NULL }; +/*@=fullinitblock@*/ struct hardLink * hlink, * parent; hlinkList.next = NULL; diff --git a/lib/query.c b/lib/query.c index d1e8f25..4d6a26d 100644 --- a/lib/query.c +++ b/lib/query.c @@ -33,32 +33,32 @@ struct poptOption rpmQuerySourcePoptTable[] = { queryArgCallback, 0, NULL, NULL }, { "file", 'f', 0, 0, 'f', "query package owning file", "FILE" }, { "group", 'g', 0, 0, 'g', "query packages in group", "GROUP" }, - { "package", 'p', 0, 0, 'p', "query a package file" }, + { "package", 'p', 0, 0, 'p', "query a package file", NULL }, { "triggeredby", '\0', 0, 0, POPT_TRIGGEREDBY, "query the pacakges triggered by the package", "PACKAGE" }, { "whatrequires", '\0', 0, 0, POPT_WHATREQUIRES, "query the packages which require a capability", "CAPABILITY" }, { "whatprovides", '\0', 0, 0, POPT_WHATPROVIDES, "query the packages which provide a capability", "CAPABILITY" }, - { 0, 0, 0, 0, 0 } + { 0, 0, 0, 0, 0, NULL, NULL } }; struct poptOption rpmQueryPoptTable[] = { { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA, queryArgCallback, 0, NULL, NULL }, - { "configfiles", 'c', 0, 0, 'c', "list all configuration files" }, - { "docfiles", 'd', 0, 0, 'd', "list all documetnation files" }, - { "dump", '\0', 0, 0, POPT_DUMP, "dump basic file information" }, - { "list", 'l', 0, 0, 'l', "list files in package" }, + { "configfiles", 'c', 0, 0, 'c', "list all configuration files", NULL }, + { "docfiles", 'd', 0, 0, 'd', "list all documetnation files", NULL }, + { "dump", '\0', 0, 0, POPT_DUMP, "dump basic file information", NULL }, + { "list", 'l', 0, 0, 'l', "list files in package", NULL }, { "qf", '\0', POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN, 0, - POPT_QUERYFORMAT }, + POPT_QUERYFORMAT, NULL, NULL }, { "querybynumber", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, - POPT_QUERYBYNUMBER }, + POPT_QUERYBYNUMBER, NULL, NULL }, { "queryformat", '\0', POPT_ARG_STRING, 0, POPT_QUERYFORMAT, "use the following query format", "QUERYFORMAT" }, - { "state", 's', 0, 0, 's', "display the states of the listed files" }, - { "verbose", 'v', 0, 0, 'v', "display a verbose filelisting" }, - { 0, 0, 0, 0, 0 } + { "state", 's', 0, 0, 's', "display the states of the listed files", NULL }, + { "verbose", 'v', 0, 0, 'v', "display a verbose filelisting", NULL }, + { 0, 0, 0, 0, 0, NULL, NULL } }; static void queryArgCallback(poptContext con, enum poptCallbackReason reason, diff --git a/lib/rpmrc.c b/lib/rpmrc.c index afc5902..e6de546 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -78,6 +78,7 @@ struct tableType { int canonsLength; }; +/*@-fullinitblock@*/ static struct tableType tables[RPM_MACHTABLE_COUNT] = { { "arch", 1, 0 }, { "os", 1, 0 }, @@ -136,6 +137,7 @@ static struct rpmOption optionTable[] = { { "topdir", RPMVAR_TOPDIR, 0, 0, 1, 1 }, { "vendor", RPMVAR_VENDOR, 0, 0, 1, 1 }, }; +/*@=fullinitblock@*/ static int optionTableSize = sizeof(optionTable) / sizeof(*optionTable); #define OS 0 diff --git a/lib/uninstall.c b/lib/uninstall.c index 0b98291..dc7fe6b 100644 --- a/lib/uninstall.c +++ b/lib/uninstall.c @@ -460,11 +460,14 @@ static int runScript(Header h, char * root, int progArgc, char ** progArgv, close(pipes[0]); if (errfd != NULL) { - if (fdFileno(errfd) != STDERR_FILENO) dup2(fdFileno(errfd), STDERR_FILENO); - if (fdFileno(out) != STDOUT_FILENO) dup2(fdFileno(out), STDOUT_FILENO); + if (fdFileno(errfd) != STDERR_FILENO) + dup2(fdFileno(errfd), STDERR_FILENO); + if (fdFileno(out) != STDOUT_FILENO) + dup2(fdFileno(out), STDOUT_FILENO); /* make sure we don't close stdin/stderr/stdout by mistake! */ - if (fdFileno(out) > STDERR_FILENO && out != errfd) fdClose (out); - if (fdFileno(errfd) > STDERR_FILENO) fdClose (errfd); + if (fdFileno(out) > STDERR_FILENO && fdFileno(out) != fdFileno(errfd)) fdClose (out); + if (fdFileno(errfd) > STDERR_FILENO) + fdClose (errfd); } doputenv(SCRIPT_PATH); @@ -474,7 +477,7 @@ static int runScript(Header h, char * root, int progArgc, char ** progArgv, doputenv(prefixBuf); /* backwards compatibility */ - if (!i) { + if (i == 0) { sprintf(prefixBuf, "RPM_INSTALL_PREFIX=%s", prefixes[i]); doputenv(prefixBuf); } diff --git a/rpm.c b/rpm.c index 5cf55da..a5a9ba0 100755 --- a/rpm.c +++ b/rpm.c @@ -78,76 +78,76 @@ static int rpm_version; static struct rpmQueryArguments queryArgs; /* the structure describing the options we take and the defaults */ static struct poptOption optionsTable[] = { - { "addsign", '\0', 0, 0, GETOPT_ADDSIGN }, - { "all", 'a', 0, 0, 'a' }, - { "allfiles", '\0', 0, &allFiles, 0 }, - { "allmatches", 'a', 0, &allMatches, 0 }, - { "badreloc", '\0', 0, &badReloc, 0 }, - { "build", 'b', POPT_ARG_STRING, 0, 'b' }, - { "buildarch", '\0', POPT_ARG_STRING, &arch, GETOPT_BUILDARCH }, - { "buildos", '\0', POPT_ARG_STRING, &os, GETOPT_BUILDOS }, - { "buildplatform", '\0', POPT_ARG_STRING, 0, GETOPT_BUILDPLATFORM }, - { "buildroot", '\0', POPT_ARG_STRING, 0, GETOPT_BUILDROOT }, - { "checksig", 'K', 0, 0, 'K' }, - { "clean", '\0', 0, &clean, 0 }, - { "dbpath", '\0', POPT_ARG_STRING, 0, GETOPT_DBPATH }, - { "erase", 'e', 0, 0, 'e' }, - { "excludedocs", '\0', 0, &excldocs, 0}, - { "force", '\0', 0, &force, 0 }, - { "ftpport", '\0', POPT_ARG_STRING, &ftpPort, 0}, - { "ftpproxy", '\0', POPT_ARG_STRING, &ftpProxy, 0}, - { "hash", 'h', 0, &showHash, 0 }, - { "help", '\0', 0, &help, 0 }, - { NULL, 'i', 0, 0, 'i' }, - { "ignorearch", '\0', 0, &ignoreArch, 0 }, - { "ignoreos", '\0', 0, &ignoreOs, 0 }, - { "includedocs", '\0', 0, &incldocs, 0}, - { "initdb", '\0', 0, &initdb, 0 }, + { "addsign", '\0', 0, 0, GETOPT_ADDSIGN, NULL, NULL}, + { "all", 'a', 0, 0, 'a', NULL, NULL}, + { "allfiles", '\0', 0, &allFiles, 0, NULL, NULL}, + { "allmatches", 'a', 0, &allMatches, 0, NULL, NULL}, + { "badreloc", '\0', 0, &badReloc, 0, NULL, NULL}, + { "build", 'b', POPT_ARG_STRING, 0, 'b', NULL, NULL}, + { "buildarch", '\0', POPT_ARG_STRING, &arch, GETOPT_BUILDARCH, NULL, NULL}, + { "buildos", '\0', POPT_ARG_STRING, &os, GETOPT_BUILDOS, NULL, NULL}, + { "buildplatform", '\0', POPT_ARG_STRING, 0, GETOPT_BUILDPLATFORM, NULL, NULL}, + { "buildroot", '\0', POPT_ARG_STRING, 0, GETOPT_BUILDROOT, NULL, NULL}, + { "checksig", 'K', 0, 0, 'K', NULL, NULL, NULL, NULL}, + { "clean", '\0', 0, &clean, 0, NULL, NULL}, + { "dbpath", '\0', POPT_ARG_STRING, 0, GETOPT_DBPATH, NULL, NULL}, + { "erase", 'e', 0, 0, 'e', NULL, NULL}, + { "excludedocs", '\0', 0, &excldocs, 0, NULL, NULL}, + { "force", '\0', 0, &force, 0, NULL, NULL}, + { "ftpport", '\0', POPT_ARG_STRING, &ftpPort, 0, NULL, NULL}, + { "ftpproxy", '\0', POPT_ARG_STRING, &ftpProxy, 0, NULL, NULL}, + { "hash", 'h', 0, &showHash, 0, NULL, NULL}, + { "help", '\0', 0, &help, 0, NULL, NULL}, + { NULL, 'i', 0, 0, 'i', NULL, NULL}, + { "ignorearch", '\0', 0, &ignoreArch, 0, NULL, NULL}, + { "ignoreos", '\0', 0, &ignoreOs, 0, NULL, NULL}, + { "includedocs", '\0', 0, &incldocs, 0, NULL, NULL}, + { "initdb", '\0', 0, &initdb, 0, NULL, NULL}, /* info and install both using 'i' is dumb */ - { "install", '\0', 0, 0, GETOPT_INSTALL }, - { "justdb", '\0', 0, &justdb, 0 }, - { "nodeps", '\0', 0, &noDeps, 0 }, - { "nofiles", '\0', 0, &noFiles, 0 }, - { "nolang", '\0', 0, &noLang, 0 }, - { "nomd5", '\0', 0, &noMd5, 0 }, - { "noorder", '\0', 0, &noOrder, 0 }, - { "nopgp", '\0', 0, &noPgp, 0 }, - { "noscripts", '\0', 0, &noScripts, 0 }, - { "notriggers", '\0', 0, &noTriggers, 0 }, - { "oldpackage", '\0', 0, &oldPackage, 0 }, - { "percent", '\0', 0, &showPercents, 0 }, - { "pipe", '\0', POPT_ARG_STRING, &pipeOutput, 0 }, - { "prefix", '\0', POPT_ARG_STRING, &prefix, 0 }, - { "query", 'q', 0, NULL, 'q' }, - { "querytags", '\0', 0, &queryTags, 0 }, - { "quiet", '\0', 0, &quiet, 0 }, - { "rcfile", '\0', POPT_ARG_STRING, &rcfile, 0 }, - { "rebuild", '\0', 0, 0, GETOPT_REBUILD }, - { "rebuilddb", '\0', 0, 0, GETOPT_REBUILDDB }, - { "recompile", '\0', 0, 0, GETOPT_RECOMPILE }, - { "relocate", '\0', POPT_ARG_STRING, 0, GETOPT_RELOCATE }, - { "replacefiles", '\0', 0, &replaceFiles, 0 }, - { "replacepkgs", '\0', 0, &replacePackages, 0 }, - { "resign", '\0', 0, 0, GETOPT_RESIGN }, - { "rmsource", '\0', 0, 0, GETOPT_RMSOURCE }, - { "root", 'r', POPT_ARG_STRING, &rootdir, 0 }, - { "short-circuit", '\0', 0, &shortCircuit, 0 }, - { "showrc", '\0', 0, &showrc, GETOPT_SHOWRC }, - { "sign", '\0', 0, &signIt, 0 }, - { "tarball", 't', POPT_ARG_STRING, 0, 't' }, - { "test", '\0', 0, &test, 0 }, - { "timecheck", '\0', POPT_ARG_STRING, 0, GETOPT_TIMECHECK }, - { "upgrade", 'U', 0, 0, 'U' }, - { "uninstall", 'u', 0, 0, 'u' }, - { "verbose", 'v', 0, 0, 'v' }, - { "verify", 'V', 0, 0, 'V' }, - { NULL, 'y', 0, 0, 'V' }, - { "version", '\0', 0, &rpm_version, 0 }, - { NULL, '\0', POPT_ARG_INCLUDE_TABLE, - rpmQuerySourcePoptTable, 0, (void *) &queryArgs, NULL }, - { NULL, '\0', POPT_ARG_INCLUDE_TABLE, - rpmQueryPoptTable, 0, (void *) &queryArgs, NULL }, - { 0, 0, 0, 0, 0 } + { "install", '\0', 0, 0, GETOPT_INSTALL, NULL, NULL}, + { "justdb", '\0', 0, &justdb, 0, NULL, NULL}, + { "nodeps", '\0', 0, &noDeps, 0, NULL, NULL}, + { "nofiles", '\0', 0, &noFiles, 0, NULL, NULL}, + { "nolang", '\0', 0, &noLang, 0, NULL, NULL}, + { "nomd5", '\0', 0, &noMd5, 0, NULL, NULL}, + { "noorder", '\0', 0, &noOrder, 0, NULL, NULL}, + { "nopgp", '\0', 0, &noPgp, 0, NULL, NULL}, + { "noscripts", '\0', 0, &noScripts, 0, NULL, NULL}, + { "notriggers", '\0', 0, &noTriggers, 0, NULL, NULL}, + { "oldpackage", '\0', 0, &oldPackage, 0, NULL, NULL}, + { "percent", '\0', 0, &showPercents, 0, NULL, NULL}, + { "pipe", '\0', POPT_ARG_STRING, &pipeOutput, 0, NULL, NULL}, + { "prefix", '\0', POPT_ARG_STRING, &prefix, 0, NULL, NULL}, + { "query", 'q', 0, NULL, 'q', NULL, NULL}, + { "querytags", '\0', 0, &queryTags, 0, NULL, NULL}, + { "quiet", '\0', 0, &quiet, 0, NULL, NULL}, + { "rcfile", '\0', POPT_ARG_STRING, &rcfile, 0, NULL, NULL}, + { "rebuild", '\0', 0, 0, GETOPT_REBUILD, NULL, NULL}, + { "rebuilddb", '\0', 0, 0, GETOPT_REBUILDDB, NULL, NULL}, + { "recompile", '\0', 0, 0, GETOPT_RECOMPILE, NULL, NULL}, + { "relocate", '\0', POPT_ARG_STRING, 0, GETOPT_RELOCATE, NULL, NULL}, + { "replacefiles", '\0', 0, &replaceFiles, 0, NULL, NULL}, + { "replacepkgs", '\0', 0, &replacePackages, 0, NULL, NULL}, + { "resign", '\0', 0, 0, GETOPT_RESIGN, NULL, NULL}, + { "rmsource", '\0', 0, 0, GETOPT_RMSOURCE, NULL, NULL}, + { "root", 'r', POPT_ARG_STRING, &rootdir, 0, NULL, NULL}, + { "short-circuit", '\0', 0, &shortCircuit, 0, NULL, NULL}, + { "showrc", '\0', 0, &showrc, GETOPT_SHOWRC, NULL, NULL}, + { "sign", '\0', 0, &signIt, 0, NULL, NULL}, + { "tarball", 't', POPT_ARG_STRING, 0, 't', NULL, NULL}, + { "test", '\0', 0, &test, 0, NULL, NULL}, + { "timecheck", '\0', POPT_ARG_STRING, 0, GETOPT_TIMECHECK, NULL, NULL}, + { "upgrade", 'U', 0, 0, 'U', NULL, NULL}, + { "uninstall", 'u', 0, 0, 'u', NULL, NULL}, + { "verbose", 'v', 0, 0, 'v', NULL, NULL}, + { "verify", 'V', 0, 0, 'V', NULL, NULL}, + { NULL, 'y', 0, 0, 'V', NULL, NULL}, + { "version", '\0', 0, &rpm_version, 0, NULL, NULL}, + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, + rpmQuerySourcePoptTable, 0, (void *) &queryArgs, NULL }, + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, + rpmQueryPoptTable, 0, (void *) &queryArgs, NULL }, + { 0, 0, 0, 0, 0, NULL, NULL } }; -- 2.7.4