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