diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.am | 4 | ||||
-rw-r--r-- | lib/depends.c | 58 | ||||
-rw-r--r-- | lib/formats.c | 20 | ||||
-rw-r--r-- | lib/fsm.c | 13 | ||||
-rw-r--r-- | lib/getdate.c | 4 | ||||
-rw-r--r-- | lib/hdrinline.h | 6 | ||||
-rw-r--r-- | lib/header.c | 2 | ||||
-rw-r--r-- | lib/header_internal.c | 2 | ||||
-rw-r--r-- | lib/misc.c | 45 | ||||
-rw-r--r-- | lib/package.c | 6 | ||||
-rw-r--r-- | lib/psm.c | 182 | ||||
-rw-r--r-- | lib/query.c | 5 | ||||
-rw-r--r-- | lib/rpmlead.c | 2 | ||||
-rw-r--r-- | lib/rpmrc.c | 6 | ||||
-rw-r--r-- | lib/signature.c | 12 | ||||
-rw-r--r-- | lib/stringbuf.c | 2 | ||||
-rw-r--r-- | lib/transaction.c | 94 | ||||
-rw-r--r-- | lib/verify.c | 7 |
18 files changed, 260 insertions, 210 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index 89739a2a3..a58169777 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -67,7 +67,7 @@ getdate.c: getdate.y -@if test -f y.tab.c; then \ { echo "/*@-globstate -statictrans -unqualifiedtrans -noparams @*/";\ echo "/*@-retvalint -usedef -varuse -nullderef -nullassign @*/";\ - echo "/*@-readonlytrans -modunconnomods -compdef @*/";\ + echo "/*@-readonlytrans -modunconnomods -compdef -noeffectuncon @*/";\ echo "/*@-globs -evalorderuncon -modobserveruncon -modnomods @*/";\ sed -e 's,y.tab.c,getdate.c,' y.tab.c \ -e 's,^YYSTYPE ,static &,' \ @@ -76,7 +76,7 @@ getdate.c: getdate.y -e 's,^int yydebug,/*@unused@*/ static &,' \ -e 's,^int ,static &,' ;\ echo "/*@=globs =evalorderuncon =modobserveruncon =modnomods @*/";\ - echo "/*@=readonlytrans =modunconnomods =compdef @*/";\ + echo "/*@=readonlytrans =modunconnomods =compdef =noeffectuncon @*/";\ echo "/*@=retvalint =usedef =varuse =nullderef =nullassign @*/";\ echo "/*@=globstate =statictrans =unqualifiedtrans =noparams @*/";\ } > getdate.c ;\ diff --git a/lib/depends.c b/lib/depends.c index 48d7f0b0c..54172a533 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -249,7 +249,7 @@ alAddPackage(availableList al, rpmTagType dnt, bnt; struct availablePackage * p; rpmRelocation * r; - int i; + int i, xx; int_32 * dirIndexes; const char ** dirNames; int numDirs, dirNum; @@ -275,7 +275,7 @@ alAddPackage(availableList al, memset(&p->tsi, 0, sizeof(p->tsi)); p->multiLib = 0; /* MULTILIB */ - (void) headerNVR(p->h, &p->name, &p->version, &p->release); + xx = headerNVR(p->h, &p->name, &p->version, &p->release); /* XXX This should be added always so that packages look alike. * XXX However, there is logic in files.c/depends.c that checks for @@ -333,9 +333,9 @@ alAddPackage(availableList al, p->filesCount = 0; p->baseNames = NULL; } else { - (void) hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, &numDirs); - (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); - (void) hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlags, NULL); + xx = hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, &numDirs); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + xx = hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlags, NULL); /* XXX FIXME: We ought to relocate the directory list here */ @@ -619,7 +619,7 @@ static int rangeMatchesDepFlags (Header h, int_32 * provideFlags; int providesCount; int result; - int i; + int i, xx; if (!(reqFlags & RPMSENSE_SENSEMASK) || !reqEVR || !strlen(reqEVR)) return 1; @@ -633,7 +633,7 @@ static int rangeMatchesDepFlags (Header h, (void **) &providesEVR, &providesCount)) return 1; - (void) hge(h, RPMTAG_PROVIDEFLAGS, NULL, (void **) &provideFlags, NULL); + xx = hge(h, RPMTAG_PROVIDEFLAGS, NULL, (void **) &provideFlags, NULL); if (!hge(h, RPMTAG_PROVIDENAME, &pnt, (void **) &provides, &providesCount)) { @@ -770,19 +770,20 @@ static int removePackage(rpmTransactionSet ts, int dboffset, int depends) /* Filter out duplicate erasures. */ if (ts->numRemovedPackages > 0 && ts->removedPackages != NULL) { if (bsearch(&dboffset, ts->removedPackages, ts->numRemovedPackages, - sizeof(int), intcmp) != NULL) + sizeof(*ts->removedPackages), intcmp) != NULL) return 0; } if (ts->numRemovedPackages == ts->allocedRemovedPackages) { ts->allocedRemovedPackages += ts->delta; ts->removedPackages = xrealloc(ts->removedPackages, - sizeof(int *) * ts->allocedRemovedPackages); + sizeof(ts->removedPackages) * ts->allocedRemovedPackages); } if (ts->removedPackages != NULL) { /* XXX can't happen. */ ts->removedPackages[ts->numRemovedPackages++] = dboffset; - qsort(ts->removedPackages, ts->numRemovedPackages, sizeof(int), intcmp); + qsort(ts->removedPackages, ts->numRemovedPackages, + sizeof(*ts->removedPackages), intcmp); } if (ts->orderCount == ts->orderAlloced) { @@ -808,6 +809,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, int count; const char ** obsoletes; int alNum; + int xx; /* * FIXME: handling upgrades like this is *almost* okay. It doesn't @@ -836,7 +838,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, if (headerIsEntry(h, RPMTAG_SOURCEPACKAGE)) return 0; - (void) headerNVR(h, &name, NULL, NULL); + xx = headerNVR(h, &name, NULL, NULL); { rpmdbMatchIterator mi; Header h2; @@ -845,7 +847,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, while((h2 = rpmdbNextIterator(mi)) != NULL) { /*@-branchstate@*/ if (rpmVersionCompare(h, h2)) - (void) removePackage(ts, rpmdbGetIteratorOffset(mi), alNum); + xx = removePackage(ts, rpmdbGetIteratorOffset(mi), alNum); else { uint_32 *p, multiLibMask = 0, oldmultiLibMask = 0; @@ -868,9 +870,9 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, int_32 * obsoletesFlags; int j; - (void) hge(h, RPMTAG_OBSOLETEVERSION, &ovt, (void **) &obsoletesEVR, + xx = hge(h, RPMTAG_OBSOLETEVERSION, &ovt, (void **) &obsoletesEVR, NULL); - (void) hge(h, RPMTAG_OBSOLETEFLAGS, NULL, (void **) &obsoletesFlags, + xx = hge(h, RPMTAG_OBSOLETEFLAGS, NULL, (void **) &obsoletesFlags, NULL); for (j = 0; j < count; j++) { @@ -884,7 +886,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, obsoletes[j], 0); - (void) rpmdbPruneIterator(mi, + xx = rpmdbPruneIterator(mi, ts->removedPackages, ts->numRemovedPackages, 1); while((h2 = rpmdbNextIterator(mi)) != NULL) { @@ -897,7 +899,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, headerMatchesDepFlags(h2, obsoletes[j], obsoletesEVR[j], obsoletesFlags[j])) { - (void) removePackage(ts, rpmdbGetIteratorOffset(mi), alNum); + xx = removePackage(ts, rpmdbGetIteratorOffset(mi), alNum); } /*@=branchstate@*/ } @@ -1402,19 +1404,19 @@ static int checkPackageDeps(rpmTransactionSet ts, problemsSet psp, int_32 * conflictFlags = NULL; int conflictsCount = 0; rpmTagType type; - int i, rc; + int i, rc, xx; int ourrc = 0; struct availablePackage ** suggestion; - (void) headerNVR(h, &name, &version, &release); + xx = headerNVR(h, &name, &version, &release); if (!hge(h, RPMTAG_REQUIRENAME, &rnt, (void **) &requires, &requiresCount)) { requiresCount = 0; rvt = RPM_STRING_ARRAY_TYPE; } else { - (void)hge(h, RPMTAG_REQUIREFLAGS, NULL, (void **) &requireFlags, NULL); - (void)hge(h, RPMTAG_REQUIREVERSION, &rvt, (void **) &requiresEVR, NULL); + xx = hge(h, RPMTAG_REQUIREFLAGS, NULL, (void **) &requireFlags, NULL); + xx = hge(h, RPMTAG_REQUIREVERSION, &rvt, (void **) &requiresEVR, NULL); } for (i = 0; i < requiresCount && !ourrc; i++) { @@ -1492,9 +1494,9 @@ static int checkPackageDeps(rpmTransactionSet ts, problemsSet psp, conflictsCount = 0; cvt = RPM_STRING_ARRAY_TYPE; } else { - (void) hge(h, RPMTAG_CONFLICTFLAGS, &type, + xx = hge(h, RPMTAG_CONFLICTFLAGS, &type, (void **) &conflictFlags, &conflictsCount); - (void) hge(h, RPMTAG_CONFLICTVERSION, &cvt, + xx = hge(h, RPMTAG_CONFLICTVERSION, &cvt, (void **) &conflictsEVR, &conflictsCount); } @@ -2215,7 +2217,7 @@ int rpmdepCheck(rpmTransactionSet ts, struct availablePackage * p; problemsSet ps; int npkgs; - int i, j; + int i, j, xx; int rc; npkgs = ts->addedPackages.size; @@ -2271,12 +2273,12 @@ int rpmdepCheck(rpmTransactionSet ts, /*@-branchstate@*/ if (ts->numRemovedPackages > 0) { mi = rpmdbInitIterator(ts->rpmdb, RPMDBI_PACKAGES, NULL, 0); - (void) rpmdbAppendIterator(mi, + xx = rpmdbAppendIterator(mi, ts->removedPackages, ts->numRemovedPackages); while ((h = rpmdbNextIterator(mi)) != NULL) { { const char * name, * version, * release; - (void) headerNVR(h, &name, &version, &release); + xx = headerNVR(h, &name, &version, &release); rpmMessage(RPMMESS_DEBUG, "========== --- %s-%s-%s\n" , name, version, release); @@ -2317,8 +2319,8 @@ int rpmdepCheck(rpmTransactionSet ts, if (hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, &fileCount)) { - (void) hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); - (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, + xx = hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); rc = 0; for (j = 0; j < fileCount; j++) { @@ -2363,7 +2365,7 @@ exit: ps = _free(ps); /*@-branchstate@*/ if (_cacheDependsRC) - (void) rpmdbCloseDBI(ts->rpmdb, RPMDBI_DEPENDS); + xx = rpmdbCloseDBI(ts->rpmdb, RPMDBI_DEPENDS); /*@=branchstate@*/ return rc; } diff --git a/lib/formats.c b/lib/formats.c index 3e597ba8d..73c45d468 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -315,7 +315,7 @@ static int triggercondsTag(Header h, /*@out@*/ rpmTagType * type, char ** conds, ** s; char * item, * flagsStr; char * chptr; - int i, j; + int i, j, xx; char buf[5]; if (!hge(h, RPMTAG_TRIGGERNAME, &tnt, (void **) &names, &numNames)) { @@ -323,14 +323,14 @@ static int triggercondsTag(Header h, /*@out@*/ rpmTagType * type, return 0; } - (void) hge(h, RPMTAG_TRIGGERINDEX, NULL, (void **) &indices, NULL); - (void) hge(h, RPMTAG_TRIGGERFLAGS, NULL, (void **) &flags, NULL); - (void) hge(h, RPMTAG_TRIGGERVERSION, &tvt, (void **) &versions, NULL); - (void) hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &s, &numScripts); + xx = hge(h, RPMTAG_TRIGGERINDEX, NULL, (void **) &indices, NULL); + xx = hge(h, RPMTAG_TRIGGERFLAGS, NULL, (void **) &flags, NULL); + xx = hge(h, RPMTAG_TRIGGERVERSION, &tvt, (void **) &versions, NULL); + xx = hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &s, &numScripts); s = hfd(s, tst); *freeData = 1; - *data = conds = xmalloc(sizeof(char * ) * numScripts); + *data = conds = xmalloc(sizeof(*conds) * numScripts); *count = numScripts; *type = RPM_STRING_ARRAY_TYPE; for (i = 0; i < numScripts; i++) { @@ -384,7 +384,7 @@ static int triggertypeTag(Header h, /*@out@*/ rpmTagType * type, int_32 * indices, * flags; const char ** conds; const char ** s; - int i, j; + int i, j, xx; int numScripts, numNames; if (!hge(h, RPMTAG_TRIGGERINDEX, NULL, (void **) &indices, &numNames)) { @@ -392,12 +392,12 @@ static int triggertypeTag(Header h, /*@out@*/ rpmTagType * type, return 1; } - (void) hge(h, RPMTAG_TRIGGERFLAGS, NULL, (void **) &flags, NULL); - (void) hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &s, &numScripts); + xx = hge(h, RPMTAG_TRIGGERFLAGS, NULL, (void **) &flags, NULL); + xx = hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &s, &numScripts); s = hfd(s, tst); *freeData = 1; - *data = conds = xmalloc(sizeof(char * ) * numScripts); + *data = conds = xmalloc(sizeof(*conds) * numScripts); *count = numScripts; *type = RPM_STRING_ARRAY_TYPE; for (i = 0; i < numScripts; i++) { @@ -486,8 +486,10 @@ int fsmSetup(FSM_t fsm, fileStage goal, if (fsm->goal == FSM_PKGINSTALL) { if (ts && ts->notify) { + /*@-noeffectuncon @*/ /* FIX: check rc */ (void)ts->notify(fi->h, RPMCALLBACK_INST_START, 0, fi->archiveSize, (fi->ap ? fi->ap->key : NULL), ts->notifyData); + /*@=noeffectuncon @*/ } } @@ -853,12 +855,12 @@ static int writeFile(/*@special@*/ FSM_t fsm, int writeData) { const rpmTransactionSet ts = fsmGetTs(fsm); TFI_t fi = fsmGetFi(fsm); - if (ts && fi && ts->notify) { + if (ts && ts->notify && fi) { size_t size = (fdGetCpioPos(fsm->cfd) - pos); - /*@-modunconnomods@*/ + /*@-noeffectuncon @*/ /* FIX: check rc */ (void)ts->notify(fi->h, RPMCALLBACK_INST_PROGRESS, size, size, (fi->ap ? fi->ap->key : NULL), ts->notifyData); - /*@=modunconnomods@*/ + /*@=noeffectuncon @*/ } } @@ -1630,10 +1632,13 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; if (fsm->goal == FSM_PKGINSTALL || fsm->goal == FSM_PKGBUILD) { rpmTransactionSet ts = fsmGetTs(fsm); TFI_t fi = fsmGetFi(fsm); - if (ts && ts->notify && fi) + if (ts && ts->notify && fi) { + /*@-noeffectuncon @*/ /* FIX: check rc */ (void)ts->notify(fi->h, RPMCALLBACK_INST_PROGRESS, fdGetCpioPos(fsm->cfd), fi->archiveSize, (fi->ap ? fi->ap->key : NULL), ts->notifyData); + /*@=noeffectuncon @*/ + } } break; case FSM_UNDO: diff --git a/lib/getdate.c b/lib/getdate.c index e0fe26343..0cf1223ba 100644 --- a/lib/getdate.c +++ b/lib/getdate.c @@ -1,6 +1,6 @@ /*@-globstate -statictrans -unqualifiedtrans -noparams @*/ /*@-retvalint -usedef -varuse -nullderef -nullassign @*/ -/*@-readonlytrans -modunconnomods -compdef @*/ +/*@-readonlytrans -modunconnomods -compdef -noeffectuncon @*/ /*@-globs -evalorderuncon -modobserveruncon -modnomods @*/ #ifndef lint static char const @@ -1595,6 +1595,6 @@ yyaccept: return (0); } /*@=globs =evalorderuncon =modobserveruncon =modnomods @*/ -/*@=readonlytrans =modunconnomods =compdef @*/ +/*@=readonlytrans =modunconnomods =compdef =noeffectuncon @*/ /*@=retvalint =usedef =varuse =nullderef =nullassign @*/ /*@=globstate =statictrans =unqualifiedtrans =noparams @*/ diff --git a/lib/hdrinline.h b/lib/hdrinline.h index 883fe04ec..1374c4107 100644 --- a/lib/hdrinline.h +++ b/lib/hdrinline.h @@ -73,7 +73,9 @@ Header headerLink(Header h) void headerSort(Header h) /*@modifies h @*/ { +/*@-noeffectuncon@*/ /* FIX: add rc */ (h2hv(h)->hdrsort) (h); +/*@=noeffectuncon@*/ return; } @@ -85,7 +87,9 @@ void headerSort(Header h) void headerUnsort(Header h) /*@modifies h @*/ { +/*@-noeffectuncon@*/ /* FIX: add rc */ (h2hv(h)->hdrunsort) (h); +/*@=noeffectuncon@*/ return; } /*@=exportlocal@*/ @@ -431,7 +435,9 @@ int headerRemoveEntry(Header h, int_32 tag) void headerCopyTags(Header headerFrom, Header headerTo, hTAG_t tagstocopy) /*@modifies headerFrom, headerTo @*/ { +/*@-noeffectuncon@*/ /* FIX: add rc */ hdrVec->hdrcopytags(headerFrom, headerTo, tagstocopy); +/*@=noeffectuncon@*/ return; } diff --git a/lib/header.c b/lib/header.c index 4a36acfda..d72509a51 100644 --- a/lib/header.c +++ b/lib/header.c @@ -1,3 +1,4 @@ +/*@-sizeoftype@*/ /** \ingroup header * \file lib/header.c */ @@ -3171,3 +3172,4 @@ static struct HV_s hdrVec1 = { /*@observer@*/ /*@unchecked@*/ HV_t hdrVec = &hdrVec1; /*@=compmempass =redef@*/ +/*@=sizeoftype@*/ diff --git a/lib/header_internal.c b/lib/header_internal.c index 9c30d1351..30ea43e4f 100644 --- a/lib/header_internal.c +++ b/lib/header_internal.c @@ -1,3 +1,4 @@ +/*@-sizeoftype@*/ /** \ingroup header * \file lib/header_internal.c */ @@ -164,3 +165,4 @@ void headerDump(Header h, FILE *f, int flags, p++; } } +/*@=sizeoftype@*/ diff --git a/lib/misc.c b/lib/misc.c index 47719197d..44ecdbaf1 100644 --- a/lib/misc.c +++ b/lib/misc.c @@ -74,7 +74,7 @@ char ** splitString(const char * str, int length, char sep) *dest = '\0'; - list = xmalloc(sizeof(char *) * (fields + 1)); + list = xmalloc(sizeof(*list) * (fields + 1)); dest = s; list[0] = dest; @@ -348,7 +348,7 @@ void compressFilelist(Header h) int_32 * dirIndexes; rpmTagType fnt; int count; - int i; + int i, xx; int dirIndex = -1; /* @@ -358,7 +358,7 @@ void compressFilelist(Header h) */ if (headerIsEntry(h, RPMTAG_DIRNAMES)) { - (void) hre(h, RPMTAG_OLDFILENAMES); + xx = hre(h, RPMTAG_OLDFILENAMES); return; /* Already converted. */ } @@ -413,16 +413,16 @@ void compressFilelist(Header h) exit: if (count > 0) { - (void) hae(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, dirIndexes, count); - (void) hae(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, + xx = hae(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, dirIndexes, count); + xx = hae(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, baseNames, count); - (void) hae(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, + xx = hae(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, dirNames, dirIndex + 1); } fileNames = hfd(fileNames, fnt); - (void) hre(h, RPMTAG_OLDFILENAMES); + xx = hre(h, RPMTAG_OLDFILENAMES); } /* @@ -444,7 +444,7 @@ static void doBuildFileList(Header h, /*@out@*/ const char *** fileListPtr, int size; rpmTagType bnt, dnt; char * data; - int i; + int i, xx; if (!hge(h, baseNameTag, &bnt, (void **) &baseNames, &count)) { if (fileListPtr) *fileListPtr = NULL; @@ -452,8 +452,8 @@ static void doBuildFileList(Header h, /*@out@*/ const char *** fileListPtr, return; /* no file list */ } - (void) hge(h, dirNameTag, &dnt, (void **) &dirNames, NULL); - (void) hge(h, dirIndexesTag, NULL, (void **) &dirIndexes, &count); + xx = hge(h, dirNameTag, &dnt, (void **) &dirNames, NULL); + xx = hge(h, dirIndexesTag, NULL, (void **) &dirIndexes, &count); size = sizeof(*fileNames) * count; for (i = 0; i < count; i++) @@ -484,6 +484,7 @@ void expandFilelist(Header h) HRE_t hre = (HRE_t)headerRemoveEntry; const char ** fileNames = NULL; int count = 0; + int xx; /*@-branchstate@*/ if (!headerIsEntry(h, RPMTAG_OLDFILENAMES)) { @@ -491,15 +492,15 @@ void expandFilelist(Header h) RPMTAG_DIRNAMES, RPMTAG_DIRINDEXES); if (fileNames == NULL || count <= 0) return; - (void) hae(h, RPMTAG_OLDFILENAMES, RPM_STRING_ARRAY_TYPE, + xx = hae(h, RPMTAG_OLDFILENAMES, RPM_STRING_ARRAY_TYPE, fileNames, count); fileNames = _free(fileNames); } /*@=branchstate@*/ - (void) hre(h, RPMTAG_DIRNAMES); - (void) hre(h, RPMTAG_BASENAMES); - (void) hre(h, RPMTAG_DIRINDEXES); + xx = hre(h, RPMTAG_DIRNAMES); + xx = hre(h, RPMTAG_BASENAMES); + xx = hre(h, RPMTAG_DIRINDEXES); } @@ -764,11 +765,11 @@ void providePackageNVR(Header h) rpmTagType pnt, pvt; int_32 * provideFlags = NULL; int providesCount; - int i; + int i, xx; int bingo = 1; /* Generate provides for this package name-version-release. */ - (void) headerNVR(h, &name, &version, &release); + xx = headerNVR(h, &name, &version, &release); if (!(name && version && release)) return; pEVR = p = alloca(21 + strlen(version) + 1 + strlen(release) + 1); @@ -794,15 +795,15 @@ void providePackageNVR(Header h) for (i = 0; i < providesCount; i++) { char * vdummy = ""; int_32 fdummy = RPMSENSE_ANY; - (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, + xx = headerAddOrAppendEntry(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, &vdummy, 1); - (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, + xx = headerAddOrAppendEntry(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, &fdummy, 1); } goto exit; } - (void) hge(h, RPMTAG_PROVIDEFLAGS, NULL, (void **) &provideFlags, NULL); + xx = hge(h, RPMTAG_PROVIDEFLAGS, NULL, (void **) &provideFlags, NULL); if (provides && providesEVR && provideFlags) for (i = 0; i < providesCount; i++) { @@ -820,11 +821,11 @@ exit: providesEVR = hfd(providesEVR, pvt); if (bingo) { - (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDENAME, RPM_STRING_ARRAY_TYPE, + xx = headerAddOrAppendEntry(h, RPMTAG_PROVIDENAME, RPM_STRING_ARRAY_TYPE, &name, 1); - (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, + xx = headerAddOrAppendEntry(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, &pFlags, 1); - (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, + xx = headerAddOrAppendEntry(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, &pEVR, 1); } } diff --git a/lib/package.c b/lib/package.c index 42be6dc1b..9c4f989b3 100644 --- a/lib/package.c +++ b/lib/package.c @@ -24,6 +24,7 @@ void headerMergeLegacySigs(Header h, const Header sig) HeaderIterator hi; int_32 tag, type, count; const void * ptr; + int xx; /*@-mods@*/ /* FIX: undocumented modification of sig */ for (hi = headerInitIterator(sig); @@ -60,7 +61,7 @@ void headerMergeLegacySigs(Header h, const Header sig) } if (ptr == NULL) continue; /* XXX can't happen */ if (!headerIsEntry(h, tag)) - (void) hae(h, tag, type, ptr, count); + xx = hae(h, tag, type, ptr, count); } hi = headerFreeIterator(hi); } @@ -72,6 +73,7 @@ Header headerRegenSigHeader(const Header h) HeaderIterator hi; int_32 tag, stag, type, count; const void * ptr; + int xx; /*@-mods@*/ /* FIX: undocumented modification of h */ for (hi = headerInitIterator(h); @@ -109,7 +111,7 @@ Header headerRegenSigHeader(const Header h) } if (ptr == NULL) continue; /* XXX can't happen */ if (!headerIsEntry(sig, stag)) - (void) headerAddEntry(sig, stag, type, ptr, count); + xx = headerAddEntry(sig, stag, type, ptr, count); } hi = headerFreeIterator(hi); return sig; @@ -57,15 +57,15 @@ int rpmVersionCompare(Header first, Header second) return 1; } - (void) headerGetEntry(first, RPMTAG_VERSION, NULL, (void **) &one, NULL); - (void) headerGetEntry(second, RPMTAG_VERSION, NULL, (void **) &two, NULL); + rc = headerGetEntry(first, RPMTAG_VERSION, NULL, (void **) &one, NULL); + rc = headerGetEntry(second, RPMTAG_VERSION, NULL, (void **) &two, NULL); rc = rpmvercmp(one, two); if (rc) return rc; - (void) headerGetEntry(first, RPMTAG_RELEASE, NULL, (void **) &one, NULL); - (void) headerGetEntry(second, RPMTAG_RELEASE, NULL, (void **) &two, NULL); + rc = headerGetEntry(first, RPMTAG_RELEASE, NULL, (void **) &one, NULL); + rc = headerGetEntry(second, RPMTAG_RELEASE, NULL, (void **) &two, NULL); return rpmvercmp(one, two); } @@ -321,7 +321,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) HME_t hme = (HME_t)fi->hme; HFD_t hfd = (fi->hfd ? fi->hfd : headerFreeData); fileAction * actions = fi->actions; - int i, j, k, fc; + int i, j, k, fc, xx; rpmTagType type = 0; int_32 count = 0; int_32 dirNamesCount, dirCount; @@ -354,16 +354,17 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_CONFLICTFLAGS }; - (void) hge(h, RPMTAG_SIZE, NULL, (void **) &fileSizes, NULL); + xx = hge(h, RPMTAG_SIZE, NULL, (void **) &fileSizes, NULL); fileSize = *fileSizes; - (void) hge(newH, RPMTAG_FILESIZES, NULL, (void **) &fileSizes, &count); + xx = hge(newH, RPMTAG_FILESIZES, NULL, (void **) &fileSizes, &count); for (i = 0, fc = 0; i < count; i++) if (actions[i] != FA_SKIPMULTILIB) { fc++; fileSize += fileSizes[i]; } - (void) hme(h, RPMTAG_SIZE, RPM_INT32_TYPE, &fileSize, 1); + xx = hme(h, RPMTAG_SIZE, RPM_INT32_TYPE, &fileSize, 1); + /*@-sizeoftype@*/ for (i = 0; mergeTags[i]; i++) { if (!hge(newH, mergeTags[i], &type, (void **) &data, &count)) continue; @@ -374,7 +375,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) for (j = 0, k = 0; j < count; j++) if (actions[j] != FA_SKIPMULTILIB) ((int_8 *) newdata)[k++] = ((int_8 *) data)[j]; - (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); + xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); /*@switchbreak@*/ break; case RPM_INT16_TYPE: @@ -382,7 +383,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) for (j = 0, k = 0; j < count; j++) if (actions[j] != FA_SKIPMULTILIB) ((int_16 *) newdata)[k++] = ((int_16 *) data)[j]; - (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); + xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); /*@switchbreak@*/ break; case RPM_INT32_TYPE: @@ -390,7 +391,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) for (j = 0, k = 0; j < count; j++) if (actions[j] != FA_SKIPMULTILIB) ((int_32 *) newdata)[k++] = ((int_32 *) data)[j]; - (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); + xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); /*@switchbreak@*/ break; case RPM_STRING_ARRAY_TYPE: @@ -398,7 +399,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) for (j = 0, k = 0; j < count; j++) if (actions[j] != FA_SKIPMULTILIB) ((char **) newdata)[k++] = ((char **) data)[j]; - (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); + xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); /*@switchbreak@*/ break; default: @@ -409,16 +410,17 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) } data = hfd(data, type); } - (void) hge(newH, RPMTAG_DIRINDEXES, NULL, (void **) &newDirIndexes, &count); - (void) hge(newH, RPMTAG_DIRNAMES, NULL, (void **) &newDirNames, NULL); - (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); - (void) hge(h, RPMTAG_DIRNAMES, NULL, (void **) &data, &dirNamesCount); + /*@=sizeoftype@*/ + xx = hge(newH, RPMTAG_DIRINDEXES, NULL, (void **) &newDirIndexes, &count); + xx = hge(newH, RPMTAG_DIRNAMES, NULL, (void **) &newDirNames, NULL); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + xx = hge(h, RPMTAG_DIRNAMES, NULL, (void **) &data, &dirNamesCount); - dirNames = xcalloc(dirNamesCount + fc, sizeof(char *)); + dirNames = xcalloc(dirNamesCount + fc, sizeof(*dirNames)); for (i = 0; i < dirNamesCount; i++) dirNames[i] = ((char **) data)[i]; dirCount = dirNamesCount; - newdata = xcalloc(fc, sizeof(int_32)); + newdata = xcalloc(fc, sizeof(*newDirIndexes)); for (i = 0, k = 0; i < count; i++) { if (actions[i] == FA_SKIPMULTILIB) continue; @@ -429,9 +431,9 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) dirNames[dirCount++] = newDirNames[newDirIndexes[i]]; ((int_32 *) newdata)[k++] = j; } - (void) headerAddOrAppendEntry(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, newdata, fc); + xx = headerAddOrAppendEntry(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, newdata, fc); if (dirCount > dirNamesCount) - (void) headerAddOrAppendEntry(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, + xx = headerAddOrAppendEntry(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, dirNames + dirNamesCount, dirCount - dirNamesCount); data = hfd(data, -1); @@ -448,12 +450,12 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) if (!hge(newH, requireTags[i], &nnt, (void **) &newNames, &newCount)) continue; - (void) hge(newH, requireTags[i+1], &nvt, (void **) &newEVR, NULL); - (void) hge(newH, requireTags[i+2], NULL, (void **) &newFlags, NULL); + xx = hge(newH, requireTags[i+1], &nvt, (void **) &newEVR, NULL); + xx = hge(newH, requireTags[i+2], NULL, (void **) &newFlags, NULL); if (hge(h, requireTags[i], &rnt, (void **) &Names, &Count)) { - (void) hge(h, requireTags[i+1], NULL, (void **) &EVR, NULL); - (void) hge(h, requireTags[i+2], NULL, (void **) &Flags, NULL); + xx = hge(h, requireTags[i+1], NULL, (void **) &EVR, NULL); + xx = hge(h, requireTags[i+2], NULL, (void **) &Flags, NULL); for (j = 0; j < newCount; j++) for (k = 0; k < Count; k++) if (!strcmp (newNames[j], Names[k]) @@ -476,11 +478,11 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) k++; } if (k) { - (void) headerAddOrAppendEntry(h, requireTags[i], + xx = headerAddOrAppendEntry(h, requireTags[i], RPM_STRING_ARRAY_TYPE, newNames, k); - (void) headerAddOrAppendEntry(h, requireTags[i+1], + xx = headerAddOrAppendEntry(h, requireTags[i+1], RPM_STRING_ARRAY_TYPE, newEVR, k); - (void) headerAddOrAppendEntry(h, requireTags[i+2], RPM_INT32_TYPE, + xx = headerAddOrAppendEntry(h, requireTags[i+2], RPM_INT32_TYPE, newFlags, k); } newNames = hfd(newNames, nnt); @@ -508,7 +510,7 @@ static int markReplacedFiles(PSM_t psm) Header h; unsigned int * offsets; unsigned int prev; - int num; + int num, xx; if (!(fi->fc > 0 && fi->replaced)) return 0; @@ -533,8 +535,8 @@ static int markReplacedFiles(PSM_t psm) } mi = rpmdbInitIterator(ts->rpmdb, RPMDBI_PACKAGES, NULL, 0); - (void) rpmdbAppendIterator(mi, offsets, num); - (void) rpmdbSetIteratorRewrite(mi, 1); + xx = rpmdbAppendIterator(mi, offsets, num); + xx = rpmdbSetIteratorRewrite(mi, 1); sfi = replaced; while ((h = rpmdbNextIterator(mi)) != NULL) { @@ -556,7 +558,7 @@ static int markReplacedFiles(PSM_t psm) if (modified == 0) { /* Modified header will be rewritten. */ modified = 1; - (void) rpmdbSetIteratorModified(mi, modified); + xx = rpmdbSetIteratorModified(mi, modified); } num++; } @@ -855,7 +857,7 @@ static int runScript(PSM_t psm, Header h, pid_t child; int status = 0; const char * fn = NULL; - int i; + int i, xx; int freePrefixes = 0; FD_t out; rpmRC rc = RPMRC_OK; @@ -865,16 +867,16 @@ static int runScript(PSM_t psm, Header h, return 0; if (!progArgv) { - argv = alloca(5 * sizeof(char *)); + argv = alloca(5 * sizeof(*argv)); argv[0] = "/bin/sh"; argc = 1; } else { - argv = alloca((progArgc + 4) * sizeof(char *)); - memcpy(argv, progArgv, progArgc * sizeof(char *)); + argv = alloca((progArgc + 4) * sizeof(*argv)); + memcpy(argv, progArgv, progArgc * sizeof(*argv)); argc = progArgc; } - (void) headerNVR(h, &n, &v, &r); + xx = headerNVR(h, &n, &v, &r); if (hge(h, RPMTAG_INSTPREFIXES, &ipt, (void **) &prefixes, &numPrefixes)) { freePrefixes = 1; } else if (hge(h, RPMTAG_INSTALLPREFIX, NULL, (void **) &oldPrefix, NULL)) { @@ -902,10 +904,13 @@ static int runScript(PSM_t psm, Header h, if (rpmIsDebug() && (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash"))) - (void) Fwrite("set -x\n", sizeof(char), 7, fd); + { + static const char set_x[] = "set -x\n"; + xx = Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd); + } - (void) Fwrite(script, sizeof(script[0]), strlen(script), fd); - (void) Fclose(fd); + xx = Fwrite(script, sizeof(script[0]), strlen(script), fd); + xx = Fclose(fd); { const char * sn = fn; if (!ts->chrootDone && @@ -953,25 +958,25 @@ static int runScript(PSM_t psm, Header h, pipes[0] = pipes[1] = 0; /* make stdin inaccessible */ - (void) pipe(pipes); - (void) close(pipes[1]); - (void) dup2(pipes[0], STDIN_FILENO); - (void) close(pipes[0]); + xx = pipe(pipes); + xx = close(pipes[1]); + xx = dup2(pipes[0], STDIN_FILENO); + xx = close(pipes[0]); /*@-branchstate@*/ if (ts->scriptFd != NULL) { int sfdno = Fileno(ts->scriptFd); int ofdno = Fileno(out); if (sfdno != STDERR_FILENO) - (void) dup2(sfdno, STDERR_FILENO); + xx = dup2(sfdno, STDERR_FILENO); if (ofdno != STDOUT_FILENO) - (void) dup2(ofdno, STDOUT_FILENO); + xx = dup2(ofdno, STDOUT_FILENO); /* make sure we don't close stdin/stderr/stdout by mistake! */ if (ofdno > STDERR_FILENO && ofdno != sfdno) { - (void) Fclose (out); + xx = Fclose (out); } if (sfdno > STDERR_FILENO) { - (void) Fclose (ts->scriptFd); + xx = Fclose (ts->scriptFd); } } /*@=branchstate@*/ @@ -983,7 +988,7 @@ static int runScript(PSM_t psm, Header h, if (ipath && ipath[5] != '%') path = ipath; - (void) doputenv(path); + xx = doputenv(path); /*@-modobserver@*/ ipath = _free(ipath); /*@=modobserver@*/ @@ -992,12 +997,12 @@ static int runScript(PSM_t psm, Header h, for (i = 0; i < numPrefixes; i++) { sprintf(prefixBuf, "RPM_INSTALL_PREFIX%d=%s", i, prefixes[i]); - (void) doputenv(prefixBuf); + xx = doputenv(prefixBuf); /* backwards compatibility */ if (i == 0) { sprintf(prefixBuf, "RPM_INSTALL_PREFIX=%s", prefixes[i]); - (void) doputenv(prefixBuf); + xx = doputenv(prefixBuf); } } @@ -1010,11 +1015,11 @@ static int runScript(PSM_t psm, Header h, case URL_IS_UNKNOWN: if (!ts->chrootDone && !(rootDir[0] == '/' && rootDir[1] == '\0')) { /*@-superuser -noeffect @*/ - (void) chroot(rootDir); + xx = chroot(rootDir); /*@=superuser =noeffect @*/ } - (void) chdir("/"); - (void) execv(argv[0], (char *const *)argv); + xx = chdir("/"); + xx = execv(argv[0], (char *const *)argv); break; default: break; @@ -1041,12 +1046,12 @@ static int runScript(PSM_t psm, Header h, if (freePrefixes) prefixes = hfd(prefixes, ipt); - (void) Fclose(out); /* XXX dup'd STDOUT_FILENO */ + xx = Fclose(out); /* XXX dup'd STDOUT_FILENO */ /*@-branchstate@*/ if (script) { if (!rpmIsDebug()) - (void) unlink(fn); + xx = unlink(fn); fn = _free(fn); } /*@=branchstate@*/ @@ -1073,17 +1078,18 @@ static rpmRC runInstScript(PSM_t psm) rpmTagType ptt, stt; const char * script; rpmRC rc = RPMRC_OK; + int xx; /* * headerGetEntry() sets the data pointer to NULL if the entry does * not exist. */ - (void) hge(fi->h, psm->progTag, &ptt, (void **) &programArgv, &programArgc); - (void) hge(fi->h, psm->scriptTag, &stt, (void **) &script, NULL); + xx = hge(fi->h, psm->progTag, &ptt, (void **) &programArgv, &programArgc); + xx = hge(fi->h, psm->scriptTag, &stt, (void **) &script, NULL); /*@-branchstate@*/ if (programArgv && ptt == RPM_STRING_TYPE) { - argv = alloca(sizeof(char *)); + argv = alloca(sizeof(*argv)); *argv = (const char *) programArgv; } else { argv = (const char **) programArgv; @@ -1127,7 +1133,7 @@ static int handleOneTrigger(PSM_t psm, Header sourceH, Header triggeredH, const char * sourceName; int numTriggers; rpmRC rc = RPMRC_OK; - int i; + int i, xx; int skip; if (!( hge(triggeredH, RPMTAG_TRIGGERNAME, &tnt, @@ -1139,7 +1145,7 @@ static int handleOneTrigger(PSM_t psm, Header sourceH, Header triggeredH, ) return 0; - (void) headerNVR(sourceH, &sourceName, NULL, NULL); + xx = headerNVR(sourceH, &sourceName, NULL, NULL); for (i = 0; i < numTriggers; i++) { rpmTagType tit, tst, tpt; @@ -1173,7 +1179,7 @@ static int handleOneTrigger(PSM_t psm, Header sourceH, Header triggeredH, ) continue; - (void) headerNVR(triggeredH, &triggerPackageName, NULL, NULL); + xx = headerNVR(triggeredH, &triggerPackageName, NULL, NULL); { int arg1; int index; @@ -1360,6 +1366,7 @@ int psmStage(PSM_t psm, pkgStage stage) HFD_t hfd = (fi->hfd ? fi->hfd : headerFreeData); rpmRC rc = psm->rc; int saveerrno; + int xx; /*@-branchstate@*/ switch (stage) { @@ -1386,9 +1393,9 @@ int psmStage(PSM_t psm, pkgStage stage) assert(psm->mi == NULL); psm->mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, fi->name, 0); - (void) rpmdbSetIteratorRE(psm->mi, RPMTAG_VERSION, + xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_VERSION, RPMMIRE_DEFAULT, fi->version); - (void) rpmdbSetIteratorRE(psm->mi, RPMTAG_RELEASE, + xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_RELEASE, RPMMIRE_DEFAULT, fi->release); while ((psm->oh = rpmdbNextIterator(psm->mi))) { @@ -1428,10 +1435,10 @@ assert(psm->mi == NULL); rpmBuildFileList(fi->h, &fi->apath, NULL); if (fi->fuser == NULL) - (void) hge(fi->h, RPMTAG_FILEUSERNAME, NULL, + xx = hge(fi->h, RPMTAG_FILEUSERNAME, NULL, (void **) &fi->fuser, NULL); if (fi->fgroup == NULL) - (void) hge(fi->h, RPMTAG_FILEGROUPNAME, NULL, + xx = hge(fi->h, RPMTAG_FILEGROUPNAME, NULL, (void **) &fi->fgroup, NULL); if (fi->fuids == NULL) fi->fuids = xcalloc(sizeof(*fi->fuids), fi->fc); @@ -1526,7 +1533,7 @@ assert(psm->mi == NULL); /* Add remove transaction id to header. */ if (psm->oh) { int_32 tid = ts->id; - (void) headerAddEntry(psm->oh, RPMTAG_REMOVETID, + xx = headerAddEntry(psm->oh, RPMTAG_REMOVETID, RPM_INT32_TYPE, &tid, 1); } @@ -1634,10 +1641,10 @@ assert(psm->mi == NULL); rc = fsmSetup(fi->fsm, FSM_PKGINSTALL, ts, fi, psm->cfd, NULL, &psm->failedFile); - (void) fsmTeardown(fi->fsm); + xx = fsmTeardown(fi->fsm); saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */ - (void) Fclose(psm->cfd); + xx = Fclose(psm->cfd); psm->cfd = NULL; errno = saveerrno; /* XXX FIXME: Fclose with libio destroys errno */ @@ -1656,7 +1663,7 @@ assert(psm->mi == NULL); psm->what = RPMCALLBACK_INST_PROGRESS; psm->amount = (fi->archiveSize ? fi->archiveSize : 100); psm->total = psm->amount; - (void) psmStage(psm, PSM_NOTIFY); + xx = psmStage(psm, PSM_NOTIFY); } if (psm->goal == PSM_PKGERASE) { @@ -1667,16 +1674,16 @@ assert(psm->mi == NULL); psm->what = RPMCALLBACK_UNINST_START; psm->amount = fi->fc; /* XXX W2DO? looks wrong. */ psm->total = fi->fc; - (void) psmStage(psm, PSM_NOTIFY); + xx = psmStage(psm, PSM_NOTIFY); rc = fsmSetup(fi->fsm, FSM_PKGERASE, ts, fi, NULL, NULL, &psm->failedFile); - (void) fsmTeardown(fi->fsm); + xx = fsmTeardown(fi->fsm); psm->what = RPMCALLBACK_UNINST_STOP; psm->amount = 0; /* XXX W2DO? looks wrong. */ psm->total = fi->fc; - (void) psmStage(psm, PSM_NOTIFY); + xx = psmStage(psm, PSM_NOTIFY); } if (psm->goal == PSM_PKGSAVE) { @@ -1691,7 +1698,7 @@ assert(psm->mi == NULL); break; } /*@-nullpass@*/ /* LCL: psm->fd != NULL here. */ - (void) Fflush(psm->fd); + xx = Fflush(psm->fd); psm->cfd = Fdopen(fdDup(Fileno(psm->fd)), psm->rpmio_flags); /*@=nullpass@*/ if (psm->cfd == NULL) { /* XXX can't happen */ @@ -1701,10 +1708,10 @@ assert(psm->mi == NULL); rc = fsmSetup(fi->fsm, FSM_PKGBUILD, ts, fi, psm->cfd, NULL, &psm->failedFile); - (void) fsmTeardown(fi->fsm); + xx = fsmTeardown(fi->fsm); saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */ - (void) Fclose(psm->cfd); + xx = Fclose(psm->cfd); psm->cfd = NULL; errno = saveerrno; @@ -1719,10 +1726,10 @@ assert(psm->mi == NULL); int_32 installTime = (int_32) time(NULL); if (fi->fstates != NULL && fi->fc > 0) - (void) headerAddEntry(fi->h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, + xx = headerAddEntry(fi->h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, fi->fstates, fi->fc); - (void) headerAddEntry(fi->h, RPMTAG_INSTALLTIME, RPM_INT32_TYPE, + xx = headerAddEntry(fi->h, RPMTAG_INSTALLTIME, RPM_INT32_TYPE, &installTime, 1); if (ts->transFlags & RPMTRANS_FLAG_MULTILIB) { @@ -1735,7 +1742,7 @@ assert(psm->mi == NULL); { multiLib = *p; multiLib |= *newMultiLib; - (void) hme(psm->oh, RPMTAG_MULTILIBS, RPM_INT32_TYPE, + xx = hme(psm->oh, RPMTAG_MULTILIBS, RPM_INT32_TYPE, &multiLib, 1); } rc = mergeFiles(fi, psm->oh, fi->h); @@ -1803,17 +1810,17 @@ assert(psm->mi == NULL); } /* Restore root directory if changed. */ - (void) psmStage(psm, PSM_CHROOT_OUT); + xx = psmStage(psm, PSM_CHROOT_OUT); break; case PSM_UNDO: break; case PSM_FINI: /* Restore root directory if changed. */ - (void) psmStage(psm, PSM_CHROOT_OUT); + xx = psmStage(psm, PSM_CHROOT_OUT); if (psm->fd) { saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */ - (void) Fclose(psm->fd); + xx = Fclose(psm->fd); psm->fd = NULL; errno = saveerrno; } @@ -1861,7 +1868,7 @@ assert(psm->mi == NULL); if (!rc) rc = psmStage(psm, PSM_PRE); if (!rc) rc = psmStage(psm, PSM_PROCESS); if (!rc) rc = psmStage(psm, PSM_POST); - (void) psmStage(psm, PSM_FINI); + xx = psmStage(psm, PSM_FINI); break; case PSM_PKGCOMMIT: break; @@ -1869,9 +1876,12 @@ assert(psm->mi == NULL); case PSM_CREATE: break; case PSM_NOTIFY: - if (ts && ts->notify) + if (ts && ts->notify) { + /*@-noeffectuncon @*/ /* FIX: check rc */ (void) ts->notify(fi->h, psm->what, psm->amount, psm->total, (fi->ap ? fi->ap->key : NULL), ts->notifyData); + /*@=noeffectuncon @*/ + } break; case PSM_DESTROY: break; @@ -1881,7 +1891,7 @@ assert(psm->mi == NULL); rc = fsmSetup(fi->fsm, FSM_PKGCOMMIT, ts, fi, NULL, NULL, &psm->failedFile); - (void) fsmTeardown(fi->fsm); + xx = fsmTeardown(fi->fsm); break; case PSM_CHROOT_IN: @@ -1899,7 +1909,7 @@ assert(psm->mi == NULL); _loaded++; } - (void) chdir("/"); + xx = chdir("/"); /*@-superuser@*/ rc = chroot(ts->rootDir); /*@=superuser@*/ @@ -1919,7 +1929,7 @@ assert(psm->mi == NULL); psm->chrootDone = ts->chrootDone = 0; if (ts->rpmdb != NULL) ts->rpmdb->db_chrootDone = 0; chroot_prefix = NULL; - (void) chdir(ts->currDir); + xx = chdir(ts->currDir); } break; case PSM_SCRIPT: diff --git a/lib/query.c b/lib/query.c index cc0da5e89..6225c9f01 100644 --- a/lib/query.c +++ b/lib/query.c @@ -692,8 +692,11 @@ restart: break; } - for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) + for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { + /*@-noeffectuncon@*/ /* FIX: check rc */ (void) showPackage(qva, NULL, pkg->header); + /*@=noeffectuncon@*/ + } spec = freeSpecVec(spec); } break; diff --git a/lib/rpmlead.c b/lib/rpmlead.c index d9e0a44d5..ddc77445d 100644 --- a/lib/rpmlead.c +++ b/lib/rpmlead.c @@ -33,9 +33,11 @@ int writeLead(FD_t fd, const struct rpmlead *lead) l.osnum = htons(l.osnum); l.signature_type = htons(l.signature_type); + /*@-sizeoftype@*/ if (Fwrite(&l, sizeof(char), sizeof(l), fd) != sizeof(l)) { return 1; } + /*@=sizeoftype@*/ return 0; } diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 5105ff4b9..82ddcbd1b 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -332,7 +332,7 @@ static int addCanon(canonEntry * table, int * tableLen, char * line, (*tableLen) += 2; /*@-unqualifiedtrans@*/ - *table = xrealloc(*table, sizeof(struct canonEntry_s) * (*tableLen)); + *table = xrealloc(*table, sizeof(**table) * (*tableLen)); /*@=unqualifiedtrans@*/ t = & ((*table)[*tableLen - 2]); @@ -382,7 +382,7 @@ static int addDefault(defaultEntry * table, int * tableLen, char * line, (*tableLen)++; /*@-unqualifiedtrans@*/ - *table = xrealloc(*table, sizeof(struct defaultEntry_s) * (*tableLen)); + *table = xrealloc(*table, sizeof(**table) * (*tableLen)); /*@=unqualifiedtrans@*/ t = & ((*table)[*tableLen - 1]); @@ -737,7 +737,7 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * urlfn) /* Find keyword in table */ searchOption.name = s; option = bsearch(&searchOption, optionTable, optionTableSize, - sizeof(struct rpmOption), optionCompare); + sizeof(optionTable[0]), optionCompare); if (option) { /* For configuration variables ... */ const char *arch, *val, *fn; diff --git a/lib/signature.c b/lib/signature.c index 22c35ca35..751c2b015 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -125,6 +125,7 @@ static inline rpmRC checkSize(FD_t fd, int siglen, int pad, int datalen) return RPMRC_OK; } + /*@-sizeoftype@*/ rc = (((sizeof(struct rpmlead) + siglen + pad + datalen) - st.st_size) ? RPMRC_BADSIZE : RPMRC_OK); @@ -132,6 +133,7 @@ static inline rpmRC checkSize(FD_t fd, int siglen, int pad, int datalen) _("Expected size: %12d = lead(%d)+sigs(%d)+pad(%d)+data(%d)\n"), (int)sizeof(struct rpmlead)+siglen+pad+datalen, (int)sizeof(struct rpmlead), siglen, pad, datalen); + /*@=sizeoftype@*/ rpmMessage((rc == RPMRC_OK ? RPMMESS_DEBUG : RPMMESS_WARNING), _(" Actual size: %12d\n"), (int)st.st_size); @@ -488,7 +490,9 @@ verifyMD5Signature(const char * datafile, const byte * sig, byte md5sum[16]; memset(md5sum, 0, sizeof(md5sum)); + /*@-noeffectuncon@*/ /* FIX: check rc */ (void) fn(datafile, md5sum); + /*@=noeffectuncon@*/ if (memcmp(md5sum, sig, 16)) { sprintf(result, "MD5 sum mismatch\n" "Expected: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" @@ -518,7 +522,7 @@ verifyMD5Signature(const char * datafile, const byte * sig, /*@=globuse@*/ static rpmVerifySignatureReturn -verifyPGPSignature(const char * datafile, const void * sig, int count, +verifyPGPSignature(const char * datafile, const byte * sig, int count, /*@unused@*/ const rpmDigest dig, /*@out@*/ char * result) /*@globals rpmGlobalMacroContext, fileSystem, internalState@*/ @@ -575,7 +579,7 @@ fprintf(stderr, "=============================== RSA verify %s: rc %d\n", #else { FD_t sfd; if (!makeTempFile(NULL, &sigfile, &sfd)) { - (void) Fwrite(sig, sizeof(char), count, sfd); + (void) Fwrite(sig, sizeof(*sig), count, sfd); (void) Fclose(sfd); sfd = NULL; } @@ -663,7 +667,7 @@ fprintf(stderr, "=============================== RSA verify %s: rc %d\n", } static rpmVerifySignatureReturn -verifyGPGSignature(const char * datafile, const void * sig, int count, +verifyGPGSignature(const char * datafile, const byte * sig, int count, /*@unused@*/ const rpmDigest dig, /*@out@*/ char * result) /*@globals rpmGlobalMacroContext, fileSystem, internalState@*/ @@ -707,7 +711,7 @@ fprintf(stderr, "=============================== DSA verify %s: rc %d\n", #else { FD_t sfd; if (!makeTempFile(NULL, &sigfile, &sfd)) { - (void) Fwrite(sig, sizeof(char), count, sfd); + (void) Fwrite(sig, sizeof(*sig), count, sfd); (void) Fclose(sfd); sfd = NULL; } diff --git a/lib/stringbuf.c b/lib/stringbuf.c index 6e550f461..6cb8169f0 100644 --- a/lib/stringbuf.c +++ b/lib/stringbuf.c @@ -37,7 +37,7 @@ _free(/*@only@*/ /*@null@*/ /*@out@*/ const void * p) /*@modifies *p @*/ StringBuf newStringBuf(void) { - StringBuf sb = xmalloc(sizeof(struct StringBufRec)); + StringBuf sb = xmalloc(sizeof(*sb)); sb->free = sb->allocated = BUF_CHUNK; sb->buf = xcalloc(sb->allocated, sizeof(*sb->buf)); diff --git a/lib/transaction.c b/lib/transaction.c index 641df90f5..43420ddf3 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -367,7 +367,7 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, int haveRelocatedFile = 0; int reldel = 0; int len; - int i, j; + int i, j, xx; if (!hge(origH, RPMTAG_PREFIXES, &validType, (void **) &validRelocations, &numValid)) @@ -388,7 +388,7 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, if (rawRelocations == NULL || numRelocations == 0) { if (numValid) { if (!headerIsEntry(origH, RPMTAG_INSTPREFIXES)) - (void) hae(origH, RPMTAG_INSTPREFIXES, + xx = hae(origH, RPMTAG_INSTPREFIXES, validType, validRelocations, numValid); validRelocations = hfd(validRelocations, validType); } @@ -510,18 +510,18 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, } if (numActual) - (void) hae(h, RPMTAG_INSTPREFIXES, RPM_STRING_ARRAY_TYPE, + xx = hae(h, RPMTAG_INSTPREFIXES, RPM_STRING_ARRAY_TYPE, (void **) actualRelocations, numActual); actualRelocations = _free(actualRelocations); validRelocations = hfd(validRelocations, validType); } - (void) hge(h, RPMTAG_BASENAMES, NULL, (void **) &baseNames, &fileCount); - (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); - (void) hge(h, RPMTAG_DIRNAMES, NULL, (void **) &dirNames, &dirCount); - (void) hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fFlags, NULL); - (void) hge(h, RPMTAG_FILEMODES, NULL, (void **) &fModes, NULL); + xx = hge(h, RPMTAG_BASENAMES, NULL, (void **) &baseNames, &fileCount); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + xx = hge(h, RPMTAG_DIRNAMES, NULL, (void **) &dirNames, &dirCount); + xx = hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fFlags, NULL); + xx = hge(h, RPMTAG_FILEMODES, NULL, (void **) &fModes, NULL); skipDirList = alloca(dirCount * sizeof(*skipDirList)); memset(skipDirList, 0, dirCount * sizeof(*skipDirList)); @@ -718,33 +718,33 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, rpmTagType t; p = NULL; - (void) hge(h, RPMTAG_BASENAMES, &t, &p, &c); - (void) hae(h, RPMTAG_ORIGBASENAMES, t, p, c); + xx = hge(h, RPMTAG_BASENAMES, &t, &p, &c); + xx = hae(h, RPMTAG_ORIGBASENAMES, t, p, c); p = hfd(p, t); p = NULL; - (void) hge(h, RPMTAG_DIRNAMES, &t, &p, &c); - (void) hae(h, RPMTAG_ORIGDIRNAMES, t, p, c); + xx = hge(h, RPMTAG_DIRNAMES, &t, &p, &c); + xx = hae(h, RPMTAG_ORIGDIRNAMES, t, p, c); p = hfd(p, t); p = NULL; - (void) hge(h, RPMTAG_DIRINDEXES, &t, &p, &c); - (void) hae(h, RPMTAG_ORIGDIRINDEXES, t, p, c); + xx = hge(h, RPMTAG_DIRINDEXES, &t, &p, &c); + xx = hae(h, RPMTAG_ORIGDIRINDEXES, t, p, c); p = hfd(p, t); - (void) hme(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, + xx = hme(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, baseNames, fileCount); fi->bnl = hfd(fi->bnl, RPM_STRING_ARRAY_TYPE); - (void) hge(h, RPMTAG_BASENAMES, NULL, (void **) &fi->bnl, &fi->fc); + xx = hge(h, RPMTAG_BASENAMES, NULL, (void **) &fi->bnl, &fi->fc); - (void) hme(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, + xx = hme(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, dirNames, dirCount); fi->dnl = hfd(fi->dnl, RPM_STRING_ARRAY_TYPE); - (void) hge(h, RPMTAG_DIRNAMES, NULL, (void **) &fi->dnl, &fi->dc); + xx = hge(h, RPMTAG_DIRNAMES, NULL, (void **) &fi->dnl, &fi->dc); - (void) hme(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, + xx = hme(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, dirIndexes, fileCount); - (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &fi->dil, NULL); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &fi->dil, NULL); } baseNames = hfd(baseNames, RPM_STRING_ARRAY_TYPE); @@ -961,6 +961,7 @@ static int handleInstInstalledFiles(TFI_t fi, /*@null@*/ rpmdb db, uint_32 * otherSizes; uint_16 * otherModes; int numReplaced = 0; + int xx; rpmdbMatchIterator mi; @@ -971,12 +972,12 @@ static int handleInstInstalledFiles(TFI_t fi, /*@null@*/ rpmdb db, return 1; } - (void) hge(h, RPMTAG_FILEMD5S, &omtype, (void **) &otherMd5s, NULL); - (void) hge(h, RPMTAG_FILELINKTOS, &oltype, (void **) &otherLinks, NULL); - (void) hge(h, RPMTAG_FILESTATES, NULL, (void **) &otherStates, NULL); - (void) hge(h, RPMTAG_FILEMODES, NULL, (void **) &otherModes, NULL); - (void) hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &otherFlags, NULL); - (void) hge(h, RPMTAG_FILESIZES, NULL, (void **) &otherSizes, NULL); + xx = hge(h, RPMTAG_FILEMD5S, &omtype, (void **) &otherMd5s, NULL); + xx = hge(h, RPMTAG_FILELINKTOS, &oltype, (void **) &otherLinks, NULL); + xx = hge(h, RPMTAG_FILESTATES, NULL, (void **) &otherStates, NULL); + xx = hge(h, RPMTAG_FILEMODES, NULL, (void **) &otherModes, NULL); + xx = hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &otherFlags, NULL); + xx = hge(h, RPMTAG_FILESIZES, NULL, (void **) &otherSizes, NULL); fi->replaced = xmalloc(sharedCount * sizeof(*fi->replaced)); @@ -1049,7 +1050,7 @@ static int handleRmvdInstalledFiles(TFI_t fi, /*@null@*/ rpmdb db, HGE_t hge = fi->hge; Header h; const char * otherStates; - int i; + int i, xx; rpmdbMatchIterator mi; @@ -1061,7 +1062,7 @@ static int handleRmvdInstalledFiles(TFI_t fi, /*@null@*/ rpmdb db, return 1; } - (void) hge(h, RPMTAG_FILESTATES, NULL, (void **) &otherStates, NULL); + xx = hge(h, RPMTAG_FILESTATES, NULL, (void **) &otherStates, NULL); for (i = 0; i < sharedCount; i++, shared++) { int otherFileNum, fileNum; @@ -1606,6 +1607,7 @@ int rpmRunTransactions( rpmTransactionSet ts, struct psm_s psmbuf; PSM_t psm = &psmbuf; void * tsi; + int xx; /* FIXME: what if the same package is included in ts twice? */ @@ -1683,7 +1685,7 @@ int rpmRunTransactions( rpmTransactionSet ts, ts->di[i].iavail = !(sfb.f_ffree == 0 && sfb.f_files == 0) ? sfb.f_ffree : -1; - (void) stat(ts->filesystems[i], &sb); + xx = stat(ts->filesystems[i], &sb); ts->di[i].dev = sb.st_dev; } } @@ -1716,7 +1718,7 @@ int rpmRunTransactions( rpmTransactionSet ts, Header oldH; mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, alp->name, 0); while ((oldH = rpmdbNextIterator(mi)) != NULL) - (void) ensureOlder(alp, oldH, ts->probs); + xx = ensureOlder(alp, oldH, ts->probs); mi = rpmdbFreeIterator(mi); } @@ -1724,9 +1726,9 @@ int rpmRunTransactions( rpmTransactionSet ts, if (!(ts->ignoreSet & RPMPROB_FILTER_REPLACEPKG) && !alp->multiLib) { rpmdbMatchIterator mi; mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, alp->name, 0); - (void) rpmdbSetIteratorRE(mi, RPMTAG_VERSION, + xx = rpmdbSetIteratorRE(mi, RPMTAG_VERSION, RPMMIRE_DEFAULT, alp->version); - (void) rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, + xx = rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_DEFAULT, alp->release); while (rpmdbNextIterator(mi) != NULL) { @@ -1749,7 +1751,7 @@ int rpmRunTransactions( rpmTransactionSet ts, int fileCount; mi = rpmdbInitIterator(ts->rpmdb, RPMDBI_PACKAGES, NULL, 0); - (void) rpmdbAppendIterator(mi, ts->removedPackages, ts->numRemovedPackages); + xx = rpmdbAppendIterator(mi, ts->removedPackages, ts->numRemovedPackages); while ((h = rpmdbNextIterator(mi)) != NULL) { if (headerGetEntry(h, RPMTAG_BASENAMES, NULL, NULL, &fileCount)) totalFileCount += fileCount; @@ -1822,9 +1824,9 @@ int rpmRunTransactions( rpmTransactionSet ts, tsi = tsFreeIterator(tsi); if (!ts->chrootDone) { - (void) chdir("/"); + xx = chdir("/"); /*@-superuser -noeffect @*/ - (void) chroot(ts->rootDir); + xx = chroot(ts->rootDir); /*@=superuser =noeffect @*/ ts->chrootDone = 1; if (ts->rpmdb) ts->rpmdb->db_chrootDone = 1; @@ -1852,8 +1854,10 @@ int rpmRunTransactions( rpmTransactionSet ts, } tsi = tsFreeIterator(tsi); + /*@-noeffectuncon @*/ /* FIX: check rc */ NOTIFY(ts, (NULL, RPMCALLBACK_TRANS_START, 6, ts->flEntries, NULL, ts->notifyData)); + /*@=noeffectuncon@*/ /* =============================================== * Compute file disposition for each package in transaction set. @@ -1863,8 +1867,10 @@ int rpmRunTransactions( rpmTransactionSet ts, dbiIndexSet * matches; int knownBad; + /*@-noeffectuncon @*/ /* FIX: check rc */ NOTIFY(ts, (NULL, RPMCALLBACK_TRANS_PROGRESS, (fi - ts->flList), ts->flEntries, NULL, ts->notifyData)); + /*@=noeffectuncon@*/ if (fi->fc == 0) continue; @@ -1938,13 +1944,13 @@ int rpmRunTransactions( rpmTransactionSet ts, /* Determine the fate of each file. */ switch (fi->type) { case TR_ADDED: - (void) handleInstInstalledFiles(fi, ts->rpmdb, shared, nexti - i, + xx = handleInstInstalledFiles(fi, ts->rpmdb, shared, nexti - i, !(beingRemoved || (ts->ignoreSet & RPMPROB_FILTER_REPLACEOLDFILES)), ts->probs, ts->transFlags); /*@switchbreak@*/ break; case TR_REMOVED: if (!beingRemoved) - (void) handleRmvdInstalledFiles(fi, ts->rpmdb, shared, nexti - i); + xx = handleRmvdInstalledFiles(fi, ts->rpmdb, shared, nexti - i); /*@switchbreak@*/ break; } } @@ -1988,16 +1994,18 @@ int rpmRunTransactions( rpmTransactionSet ts, if (ts->chrootDone) { /*@-superuser -noeffect @*/ - (void) chroot("."); + xx = chroot("."); /*@=superuser =noeffect @*/ ts->chrootDone = 0; if (ts->rpmdb) ts->rpmdb->db_chrootDone = 0; chroot_prefix = NULL; - (void) chdir(ts->currDir); + xx = chdir(ts->currDir); } + /*@-noeffectuncon @*/ /* FIX: check rc */ NOTIFY(ts, (NULL, RPMCALLBACK_TRANS_STOP, 6, ts->flEntries, NULL, ts->notifyData)); + /*@=noeffectuncon @*/ /* =============================================== * Free unused memory as soon as possible. @@ -2043,7 +2051,7 @@ int rpmRunTransactions( rpmTransactionSet ts, case TR_REMOVED: /*@-globs@*/ /* FIX: rpmGlobalMacroContext not in <rpmlib.h> */ if (ts->transFlags & RPMTRANS_FLAG_REPACKAGE) - (void) psmStage(psm, PSM_PKGSAVE); + xx = psmStage(psm, PSM_PKGSAVE); /*@=globs@*/ /*@switchbreak@*/ break; } @@ -2083,8 +2091,10 @@ assert(alp == fi->ap); rpmrc = rpmReadPackageHeader(alp->fd, &h, NULL, NULL, NULL); /*@=mustmod@*/ if (!(rpmrc == RPMRC_OK || rpmrc == RPMRC_BADSIZE)) { + /*@-noeffectuncon @*/ /* FIX: check rc */ (void)ts->notify(fi->h, RPMCALLBACK_INST_CLOSE_FILE, 0, 0, alp->key, ts->notifyData); + /*@=noeffectuncon @*/ alp->fd = NULL; ourrc++; } else { @@ -2129,8 +2139,10 @@ assert(alp == fi->ap); h = headerFree(h); if (gotfd) { + /*@-noeffectuncon @*/ /* FIX: check rc */ (void)ts->notify(fi->h, RPMCALLBACK_INST_CLOSE_FILE, 0, 0, alp->key, ts->notifyData); + /*@=noeffectuncon @*/ alp->fd = NULL; } /*@switchbreak@*/ break; @@ -2147,7 +2159,7 @@ assert(alp == fi->ap); /*@switchbreak@*/ break; } - (void) rpmdbSync(ts->rpmdb); + xx = rpmdbSync(ts->rpmdb); } tsi = tsFreeIterator(tsi); diff --git a/lib/verify.c b/lib/verify.c index bce334196..e2d5254d4 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -34,7 +34,7 @@ int rpmVerifyFile(const char * root, Header h, int filenum, int rc; struct stat sb; - (void) hge(h, RPMTAG_FILEMODES, NULL, (void **) &modeList, &count); + rc = hge(h, RPMTAG_FILEMODES, NULL, (void **) &modeList, &count); if (hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlags, NULL)) fileAttrs = fileFlags[filenum]; @@ -145,8 +145,7 @@ int rpmVerifyFile(const char * root, Header h, int filenum, if (!hge(h, RPMTAG_FILEMD5S, &mdt, (void **) &md5List, NULL)) *result |= RPMVERIFY_MD5; else { - rc = mdfile(filespec, md5sum); - + rc = mdfile(filespec, md5sum); if (rc) *result |= (RPMVERIFY_READFAIL|RPMVERIFY_MD5); else if (strcmp(md5sum, md5List[filenum])) @@ -251,7 +250,7 @@ int rpmVerifyFile(const char * root, Header h, int filenum, gid_t gid; if (hge(h, RPMTAG_FILEGROUPNAME, &gnt, (void **) &gnameList, NULL)) { - rc = gnameToGid(gnameList[filenum], &gid); + rc = gnameToGid(gnameList[filenum], &gid); if (rc || (gid != sb.st_gid)) *result |= RPMVERIFY_GROUP; gnameList = hfd(gnameList, gnt); |