Kill off lclint remnants everywhere
- remove ancient and likely irrelevant LCL comments and bogus NULL checks
This commit is contained in:
parent
52e4b9bcac
commit
69702c1de3
|
@ -298,7 +298,6 @@ rpmRC readRPM(const char *fileName, rpmSpec *specp,
|
||||||
{ rpmts ts = rpmtsCreate();
|
{ rpmts ts = rpmtsCreate();
|
||||||
|
|
||||||
/* XXX W2DO? pass fileName? */
|
/* XXX W2DO? pass fileName? */
|
||||||
/* LCL: segfault */
|
|
||||||
rc = rpmReadPackageFile(ts, fdi, "readRPM",
|
rc = rpmReadPackageFile(ts, fdi, "readRPM",
|
||||||
&spec->packages->header);
|
&spec->packages->header);
|
||||||
|
|
||||||
|
@ -782,7 +781,6 @@ rpmRC packageBinaries(rpmSpec spec)
|
||||||
|
|
||||||
memset(csa, 0, sizeof(*csa));
|
memset(csa, 0, sizeof(*csa));
|
||||||
csa->cpioArchiveSize = 0;
|
csa->cpioArchiveSize = 0;
|
||||||
/* LCL: function typedefs */
|
|
||||||
csa->cpioFdIn = fdNew(RPMDBG_M("init (packageBinaries)"));
|
csa->cpioFdIn = fdNew(RPMDBG_M("init (packageBinaries)"));
|
||||||
csa->cpioList = rpmfiLink(pkg->cpioList, RPMDBG_M("packageBinaries"));
|
csa->cpioList = rpmfiLink(pkg->cpioList, RPMDBG_M("packageBinaries"));
|
||||||
|
|
||||||
|
@ -839,7 +837,6 @@ rpmRC packageSources(rpmSpec spec)
|
||||||
|
|
||||||
memset(csa, 0, sizeof(*csa));
|
memset(csa, 0, sizeof(*csa));
|
||||||
csa->cpioArchiveSize = 0;
|
csa->cpioArchiveSize = 0;
|
||||||
/* LCL: function typedefs */
|
|
||||||
csa->cpioFdIn = fdNew(RPMDBG_M("init (packageSources)"));
|
csa->cpioFdIn = fdNew(RPMDBG_M("init (packageSources)"));
|
||||||
csa->cpioList = rpmfiLink(spec->sourceCpioList,
|
csa->cpioList = rpmfiLink(spec->sourceCpioList,
|
||||||
RPMDBG_M("packageSources"));
|
RPMDBG_M("packageSources"));
|
||||||
|
|
|
@ -251,7 +251,6 @@ exit:
|
||||||
* @return RPMRC_OK if OK
|
* @return RPMRC_OK if OK
|
||||||
*/
|
*/
|
||||||
static int checkForRequired(Header h, const char * NVR)
|
static int checkForRequired(Header h, const char * NVR)
|
||||||
/* LCL: parse error here with modifies */
|
|
||||||
{
|
{
|
||||||
int res = RPMRC_OK;
|
int res = RPMRC_OK;
|
||||||
const rpmTag * p;
|
const rpmTag * p;
|
||||||
|
|
|
@ -441,7 +441,6 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootDir,
|
||||||
/* in the spec's line buffer. Except for parsePreamble(), */
|
/* in the spec's line buffer. Except for parsePreamble(), */
|
||||||
/* which handles the initial entry into a spec file. */
|
/* which handles the initial entry into a spec file. */
|
||||||
|
|
||||||
/* LCL: parsePart is modified @*/
|
|
||||||
while (parsePart != PART_NONE) {
|
while (parsePart != PART_NONE) {
|
||||||
int goterror = 0;
|
int goterror = 0;
|
||||||
switch (parsePart) {
|
switch (parsePart) {
|
||||||
|
@ -507,7 +506,6 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootDir,
|
||||||
|
|
||||||
closeSpec(spec);
|
closeSpec(spec);
|
||||||
|
|
||||||
/* LCL: sizeof(spec->BASpecs[0]) -nullderef whine here */
|
|
||||||
spec->BASpecs = xcalloc(spec->BACount, sizeof(*spec->BASpecs));
|
spec->BASpecs = xcalloc(spec->BACount, sizeof(*spec->BASpecs));
|
||||||
index = 0;
|
index = 0;
|
||||||
if (spec->BANames != NULL)
|
if (spec->BANames != NULL)
|
||||||
|
@ -556,7 +554,6 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootDir,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* LCL: parsePart is modified @*/
|
|
||||||
|
|
||||||
/* Check for description in each package and add arch and os */
|
/* Check for description in each package and add arch and os */
|
||||||
{
|
{
|
||||||
|
|
|
@ -1056,7 +1056,6 @@ assert(s != NULL);
|
||||||
else
|
else
|
||||||
s = fn;
|
s = fn;
|
||||||
|
|
||||||
/* LCL: s is not null. */
|
|
||||||
rasprintf(&buf, "%s%s", s,
|
rasprintf(&buf, "%s%s", s,
|
||||||
#if !defined(__alpha__)
|
#if !defined(__alpha__)
|
||||||
isElf64 ? "()(64bit)" : "");
|
isElf64 ? "()(64bit)" : "");
|
||||||
|
|
|
@ -69,7 +69,6 @@ static const struct fprintCacheEntry_s * cacheContainsDirectory(
|
||||||
* @param scareMemory
|
* @param scareMemory
|
||||||
* @return pointer to the finger print associated with a file path.
|
* @return pointer to the finger print associated with a file path.
|
||||||
*/
|
*/
|
||||||
/* LCL: segfault */
|
|
||||||
fingerPrint fpLookup(fingerPrintCache cache,
|
fingerPrint fpLookup(fingerPrintCache cache,
|
||||||
const char * dirName, const char * baseName, int scareMemory)
|
const char * dirName, const char * baseName, int scareMemory)
|
||||||
{
|
{
|
||||||
|
@ -212,7 +211,6 @@ int fpEqual(const fingerPrint * k1, const fingerPrint * k2)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Otherwise, compare fingerprints by value. */
|
/* Otherwise, compare fingerprints by value. */
|
||||||
/* LCL: whines about (*k2).subdir */
|
|
||||||
if (FP_EQUAL(*k1, *k2))
|
if (FP_EQUAL(*k1, *k2))
|
||||||
return 0;
|
return 0;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -1146,7 +1146,6 @@ static int fsmRmdirs(FSM_t fsm)
|
||||||
fsm->path = dn;
|
fsm->path = dn;
|
||||||
|
|
||||||
/* Remove generated directories. */
|
/* Remove generated directories. */
|
||||||
/* LCL: te used after release? */
|
|
||||||
do {
|
do {
|
||||||
if (*te == '/') {
|
if (*te == '/') {
|
||||||
*te = '\0';
|
*te = '\0';
|
||||||
|
|
|
@ -1844,7 +1844,6 @@ int headerNext(HeaderIterator hi, rpmtd td)
|
||||||
if (entry == NULL || slot >= h->indexUsed)
|
if (entry == NULL || slot >= h->indexUsed)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* LCL: no clue */
|
|
||||||
hi->next_index++;
|
hi->next_index++;
|
||||||
|
|
||||||
td->tag = entry->info.tag;
|
td->tag = entry->info.tag;
|
||||||
|
|
|
@ -34,7 +34,7 @@ char ** headerGetLangs(Header h)
|
||||||
table[i] = e;
|
table[i] = e;
|
||||||
table[count] = NULL;
|
table[count] = NULL;
|
||||||
|
|
||||||
return table; /* LCL: double indirection? */
|
return table;
|
||||||
}
|
}
|
||||||
|
|
||||||
void headerDump(Header h, FILE *f, int flags)
|
void headerDump(Header h, FILE *f, int flags)
|
||||||
|
|
|
@ -302,7 +302,6 @@ static int parseFormat(headerSprintfArgs hsa, char * str,
|
||||||
format = xcalloc(numTokens, sizeof(*format));
|
format = xcalloc(numTokens, sizeof(*format));
|
||||||
if (endPtr) *endPtr = NULL;
|
if (endPtr) *endPtr = NULL;
|
||||||
|
|
||||||
/* LCL: can't detect done termination */
|
|
||||||
dst = start = str;
|
dst = start = str;
|
||||||
numTokens = 0;
|
numTokens = 0;
|
||||||
token = NULL;
|
token = NULL;
|
||||||
|
|
|
@ -1362,7 +1362,6 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LCL: fi->fd != NULL here. */
|
|
||||||
psm->cfd = Fdopen(fdDup(Fileno(rpmteFd(psm->te))), psm->rpmio_flags);
|
psm->cfd = Fdopen(fdDup(Fileno(rpmteFd(psm->te))), psm->rpmio_flags);
|
||||||
if (psm->cfd == NULL) { /* XXX can't happen */
|
if (psm->cfd == NULL) { /* XXX can't happen */
|
||||||
rc = RPMRC_FAIL;
|
rc = RPMRC_FAIL;
|
||||||
|
|
|
@ -303,7 +303,6 @@ int rpmcliShowMatches(QVA_t qva, rpmts ts)
|
||||||
return ec;
|
return ec;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LCL: segfault (realpath annotation?) */
|
|
||||||
int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
|
int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
|
||||||
{
|
{
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
|
@ -1562,7 +1562,6 @@ rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi)
|
||||||
mire->pattern = _free(mire->pattern);
|
mire->pattern = _free(mire->pattern);
|
||||||
if (mire->preg != NULL) {
|
if (mire->preg != NULL) {
|
||||||
regfree(mire->preg);
|
regfree(mire->preg);
|
||||||
/* LCL: regfree has bogus only */
|
|
||||||
mire->preg = _free(mire->preg);
|
mire->preg = _free(mire->preg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1810,7 +1809,6 @@ int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTag tag,
|
||||||
allpat = _free(allpat);
|
allpat = _free(allpat);
|
||||||
if (preg) {
|
if (preg) {
|
||||||
regfree(preg);
|
regfree(preg);
|
||||||
/* LCL: regfree has bogus only */
|
|
||||||
preg = _free(preg);
|
preg = _free(preg);
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -2147,7 +2145,6 @@ void rpmdbSortIterator(rpmdbMatchIterator mi)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LCL: segfault */
|
|
||||||
static int rpmdbGrowIterator(rpmdbMatchIterator mi)
|
static int rpmdbGrowIterator(rpmdbMatchIterator mi)
|
||||||
{
|
{
|
||||||
DBC * dbcursor;
|
DBC * dbcursor;
|
||||||
|
|
|
@ -190,7 +190,6 @@ int rpmpsTrim(rpmps ps, rpmps filter)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
while ((t - ps->probs) < ps->numProblems) {
|
while ((t - ps->probs) < ps->numProblems) {
|
||||||
/* LCL: looks good to me <shrug> */
|
|
||||||
if ((*f)->type == (*t)->type && (*t)->key == (*f)->key &&
|
if ((*f)->type == (*t)->type && (*t)->key == (*f)->key &&
|
||||||
XSTRCMP((*f)->str1, (*t)->str1))
|
XSTRCMP((*f)->str1, (*t)->str1))
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -337,7 +337,6 @@ static rpmRC addCanon(canonEntry * table, int * tableLen, char * line,
|
||||||
return RPMRC_FAIL;
|
return RPMRC_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LCL: s != NULL here. */
|
|
||||||
tnum = strtoul(s, &s1, 10);
|
tnum = strtoul(s, &s1, 10);
|
||||||
if ((*s1) || (s1 == s) || (tnum == ULONG_MAX)) {
|
if ((*s1) || (s1 == s) || (tnum == ULONG_MAX)) {
|
||||||
rpmlog(RPMLOG_ERR, _("Bad arch/os number: %s (%s:%d)\n"), s,
|
rpmlog(RPMLOG_ERR, _("Bad arch/os number: %s (%s:%d)\n"), s,
|
||||||
|
|
|
@ -145,7 +145,6 @@ static void sortRelocs(rpmRelocation *relocations, int numRelocations)
|
||||||
relocations[j ].oldPath == NULL || /* XXX can't happen */
|
relocations[j ].oldPath == NULL || /* XXX can't happen */
|
||||||
strcmp(relocations[j - 1].oldPath, relocations[j].oldPath) <= 0)
|
strcmp(relocations[j - 1].oldPath, relocations[j].oldPath) <= 0)
|
||||||
continue;
|
continue;
|
||||||
/* LCL: ??? */
|
|
||||||
tmpReloc = relocations[j - 1];
|
tmpReloc = relocations[j - 1];
|
||||||
relocations[j - 1] = relocations[j];
|
relocations[j - 1] = relocations[j];
|
||||||
relocations[j] = tmpReloc;
|
relocations[j] = tmpReloc;
|
||||||
|
|
|
@ -411,7 +411,6 @@ static void skipFiles(const rpmts ts, rpmte p)
|
||||||
dff = xcalloc(dc, sizeof(*dff));
|
dff = xcalloc(dc, sizeof(*dff));
|
||||||
|
|
||||||
fi = rpmfiInit(fi, 0);
|
fi = rpmfiInit(fi, 0);
|
||||||
if (fi != NULL) /* XXX lclint */
|
|
||||||
while ((i = rpmfiNext(fi)) >= 0)
|
while ((i = rpmfiNext(fi)) >= 0)
|
||||||
{
|
{
|
||||||
char ** nsp;
|
char ** nsp;
|
||||||
|
@ -549,7 +548,6 @@ static void skipFiles(const rpmts ts, rpmte p)
|
||||||
|
|
||||||
/* If explicitly included in the package, skip the directory. */
|
/* If explicitly included in the package, skip the directory. */
|
||||||
fi = rpmfiInit(fi, 0);
|
fi = rpmfiInit(fi, 0);
|
||||||
if (fi != NULL) /* XXX lclint */
|
|
||||||
while ((i = rpmfiNext(fi)) >= 0) {
|
while ((i = rpmfiNext(fi)) >= 0) {
|
||||||
const char * fdn, * fbn;
|
const char * fdn, * fbn;
|
||||||
rpm_mode_t fFMode;
|
rpm_mode_t fFMode;
|
||||||
|
@ -908,7 +906,6 @@ static void addFingerprints(rpmts ts, uint64_t fileCount, rpmFpHash ht, fingerPr
|
||||||
rpmfiFpLookup(fi, fpc);
|
rpmfiFpLookup(fi, fpc);
|
||||||
/* collect symbolic links */
|
/* collect symbolic links */
|
||||||
fi = rpmfiInit(fi, 0);
|
fi = rpmfiInit(fi, 0);
|
||||||
if (fi != NULL) /* XXX lclint */
|
|
||||||
while ((i = rpmfiNext(fi)) >= 0) {
|
while ((i = rpmfiNext(fi)) >= 0) {
|
||||||
struct rpmffi_s ffi;
|
struct rpmffi_s ffi;
|
||||||
char const *linktarget;
|
char const *linktarget;
|
||||||
|
@ -939,7 +936,6 @@ static void addFingerprints(rpmts ts, uint64_t fileCount, rpmFpHash ht, fingerPr
|
||||||
continue; /* XXX can't happen */
|
continue; /* XXX can't happen */
|
||||||
fi = rpmfiInit(fi, 0);
|
fi = rpmfiInit(fi, 0);
|
||||||
(void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), 0);
|
(void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), 0);
|
||||||
if (fi != NULL) /* XXX lclint */
|
|
||||||
while ((i = rpmfiNext(fi)) >= 0) {
|
while ((i = rpmfiNext(fi)) >= 0) {
|
||||||
if (XFA_SKIPPING(rpmfsGetAction(rpmteGetFileStates(p), i)))
|
if (XFA_SKIPPING(rpmfsGetAction(rpmteGetFileStates(p), i)))
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -48,7 +48,6 @@ int main(int argc, char *argv[])
|
||||||
vsflags |= RPMVSF_NOHDRCHK;
|
vsflags |= RPMVSF_NOHDRCHK;
|
||||||
(void) rpmtsSetVSFlags(ts, vsflags);
|
(void) rpmtsSetVSFlags(ts, vsflags);
|
||||||
|
|
||||||
/* LCL: segfault */
|
|
||||||
rc = rpmReadPackageFile(ts, fdi, "rpm2cpio", &h);
|
rc = rpmReadPackageFile(ts, fdi, "rpm2cpio", &h);
|
||||||
|
|
||||||
ts = rpmtsFree(ts);
|
ts = rpmtsFree(ts);
|
||||||
|
|
Loading…
Reference in New Issue