RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [email protected] Module: rpm Date: 10-Dec-2009 19:52:19 Branch: HEAD Handle: 2009121018521800 Modified files: rpm/lib .splintrc depends.c fsm.c poptALL.c poptI.c psm.c rpmds.c rpmfc.c rpmfi.c rpmgi.c rpmrc.c rpmts.h transaction.c verify.c Log: - lib: rescusitate splint. Summary: Revision Changes Path 2.22 +1 -1 rpm/lib/.splintrc 1.453 +3 -3 rpm/lib/depends.c 2.193 +4 -0 rpm/lib/fsm.c 2.138 +2 -1 rpm/lib/poptALL.c 2.57 +2 -2 rpm/lib/poptI.c 2.386 +9 -9 rpm/lib/psm.c 2.164 +3 -3 rpm/lib/rpmds.c 1.70 +4 -2 rpm/lib/rpmfc.c 2.152 +2 -0 rpm/lib/rpmfi.c 2.72 +6 -8 rpm/lib/rpmgi.c 2.289 +2 -0 rpm/lib/rpmrc.c 2.126 +4 -6 rpm/lib/rpmts.h 1.410 +19 -6 rpm/lib/transaction.c 2.199 +8 -4 rpm/lib/verify.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/lib/.splintrc ============================================================================ $ cvs diff -u -r2.21 -r2.22 .splintrc --- rpm/lib/.splintrc 27 Mar 2009 21:17:42 -0000 2.21 +++ rpm/lib/.splintrc 10 Dec 2009 18:52:18 -0000 2.22 @@ -1,4 +1,4 @@ --I. -I.. -I../build -I../rpmdb -I../rpmio -I../db3 -I../xar/include -I/usr/include/beecrypt -I/usr/include/nss3 -I/usr/include/nspr4 -DHAVE_CONFIG_H -D_GNU_SOURCE -D__STDC__=1 +-I. -I.. -I../build -I../rpmdb -I../rpmio -I../db3 -I../syck/lib -I../xar/include -I/usr/include/beecrypt -I/usr/include/nss3 -I/usr/include/nspr4 -DHAVE_CONFIG_H -D_GNU_SOURCE -D__STDC__=1 +partial +forcehints @@ . patch -p0 <<'@@ .' Index: rpm/lib/depends.c ============================================================================ $ cvs diff -u -r1.452 -r1.453 depends.c --- rpm/lib/depends.c 8 Dec 2009 18:25:39 -0000 1.452 +++ rpm/lib/depends.c 10 Dec 2009 18:52:18 -0000 1.453 @@ -121,7 +121,7 @@ } assert(ts->removedPackages != NULL); /* XXX can't happen. */ - rpmbfAdd(ts->rbf, &hdrNum, sizeof(hdrNum)); + (void) rpmbfAdd(ts->rbf, &hdrNum, sizeof(hdrNum)); ts->removedPackages[ts->numRemovedPackages] = hdrNum; ts->numRemovedPackages++; if (ts->numRemovedPackages > 1) @@ -861,9 +861,9 @@ * @return 0 if satisfied, 1 if not satisfied, 2 if error */ static int unsatisfiedDepend(rpmts ts, rpmds dep, int adding) - /*...@globals rpmGlobalMacroContext, h_errno, + /*...@globals _cacheDependsRC, rpmGlobalMacroContext, h_errno, sysinfo_path, fileSystem, internalState @*/ - /*...@modifies ts, dep, rpmGlobalMacroContext, + /*...@modifies ts, dep, _cacheDependsRC, rpmGlobalMacroContext, sysinfo_path, fileSystem, internalState @*/ { DBT * key = alloca(sizeof(*key)); @@ . patch -p0 <<'@@ .' Index: rpm/lib/fsm.c ============================================================================ $ cvs diff -u -r2.192 -r2.193 fsm.c --- rpm/lib/fsm.c 12 Oct 2009 23:05:39 -0000 2.192 +++ rpm/lib/fsm.c 10 Dec 2009 18:52:18 -0000 2.193 @@ -2157,7 +2157,9 @@ rc = fsmMapFContext(fsm); if (!rc) rc = fsmNext(fsm, IOSM_LSETFCON); +/*...@-dependenttrans -observertrans @*/ /* FIX: use the SELinux free wrapper */ fsm->fcontext = _free(fsm->fcontext); +/*...@=dependenttrans =observertrans @*/ } if (S_ISLNK(st->st_mode)) { if (!rc && !getuid()) @@ -2296,7 +2298,9 @@ mode = sb.st_mode; rc = rpmlioUnlink(rpmtsGetRdb(fsmGetTs(fsm)), fn, mode, b, blen, d, dlen, dalgo); if (fd != NULL) { +/*...@-observertrans@*/ /* FIX: b should be initialized to NULL, not "" */ (void)munmap(b, blen); +/*...@=observertrans@*/ (void) Fclose(fd); fd = NULL; } @@ . patch -p0 <<'@@ .' Index: rpm/lib/poptALL.c ============================================================================ $ cvs diff -u -r2.137 -r2.138 poptALL.c --- rpm/lib/poptALL.c 22 Oct 2009 18:13:39 -0000 2.137 +++ rpm/lib/poptALL.c 10 Dec 2009 18:52:18 -0000 2.138 @@ -201,7 +201,8 @@ /* ========== all-rpm-modes popt args */ static const char * rpmcliEvalSlurp(const char * arg) - /*...@*/ + /*...@globals rpmGlobalMacroContext @*/ + /*...@modifies rpmGlobalMacroContext @*/ { const char * pre = ""; const char * post = ""; @@ . patch -p0 <<'@@ .' Index: rpm/lib/poptI.c ============================================================================ $ cvs diff -u -r2.56 -r2.57 poptI.c --- rpm/lib/poptI.c 6 Sep 2009 17:29:34 -0000 2.56 +++ rpm/lib/poptI.c 10 Dec 2009 18:52:18 -0000 2.57 @@ -61,8 +61,8 @@ /*...@unused@*/ enum poptCallbackReason reason, const struct poptOption * opt, const char * arg, /*...@unused@*/ const void * data) - /*...@globals rpmIArgs, stderr, fileSystem @*/ - /*...@modifies rpmIArgs, stderr, fileSystem @*/ + /*...@globals rpmIArgs, stderr @*/ + /*...@modifies rpmIArgs, stderr @*/ { QVA_t ia = &rpmIArgs; int xx; @@ . patch -p0 <<'@@ .' Index: rpm/lib/psm.c ============================================================================ $ cvs diff -u -r2.385 -r2.386 psm.c --- rpm/lib/psm.c 17 Nov 2009 00:23:05 -0000 2.385 +++ rpm/lib/psm.c 10 Dec 2009 18:52:18 -0000 2.386 @@ -538,7 +538,7 @@ */ static rpmRC runLuaScript(rpmpsm psm, const char * sln, HE_t Phe, const char *script, int arg1, int arg2) - /*...@globals h_errno, fileSystem, internalState @*/ + /*...@globals fileSystem, internalState @*/ /*...@modifies psm, fileSystem, internalState @*/ { rpmRC rc = RPMRC_OK; @@ -592,7 +592,7 @@ #if defined(WITH_LUA) || defined(WITH_AUGEAS) || defined(WITH_FICL) || defined(WITH_JS) || defined(WITH_PERLEMBED) || defined(WITH_PYTHONEMBED) || defined(WITH_RUBYEMBED) || defined(WITH_SEMANAGE) || defined(WITH_SQUIRREL) || defined(WITH_TCL) static int enterChroot(rpmpsm psm, int * fdnop) /*...@globals fileSystem, internalState @*/ - /*...@modifies *fdnop, fileSystem, internalState @*/ + /*...@modifies psm, *fdnop, fileSystem, internalState @*/ { const rpmts ts = psm->ts; int inChroot; @@ -623,7 +623,7 @@ static int exitChroot(rpmpsm psm, int inChroot, int rootFdno) /*...@globals fileSystem, internalState @*/ - /*...@modifies fileSystem, internalState @*/ + /*...@modifies psm, fileSystem, internalState @*/ { const rpmts ts = psm->ts; const char *rootDir = rpmtsRootDir(ts); @@ -658,7 +658,7 @@ */ static rpmRC runEmbeddedScript(rpmpsm psm, const char * sln, HE_t Phe, const char *script, int arg1, int arg2) - /*...@globals h_errno, fileSystem, internalState @*/ + /*...@globals fileSystem, internalState @*/ /*...@modifies psm, fileSystem, internalState @*/ { char * av[] = { NULL, NULL, NULL, NULL }; @@ -991,16 +991,16 @@ default: break; case RPMTAG_PREIN: - rpmlioPrein(rpmtsGetRdb(ts), argv, body); + (void) rpmlioPrein(rpmtsGetRdb(ts), argv, body); break; case RPMTAG_POSTIN: - rpmlioPostin(rpmtsGetRdb(ts), argv, body); + (void) rpmlioPostin(rpmtsGetRdb(ts), argv, body); break; case RPMTAG_PREUN: - rpmlioPreun(rpmtsGetRdb(ts), argv, body); + (void) rpmlioPreun(rpmtsGetRdb(ts), argv, body); break; case RPMTAG_POSTUN: - rpmlioPostun(rpmtsGetRdb(ts), argv, body); + (void) rpmlioPostun(rpmtsGetRdb(ts), argv, body); break; } @@ -2117,7 +2117,7 @@ */ static int postPopulateInstallHeader(/*...@unused@*/ const rpmts ts, const rpmpsm psm, rpmfi fi) - /*...@modifies fi @*/ + /*...@modifies psm, fi @*/ { HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he)); int fc = rpmfiFC(fi); @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmds.c ============================================================================ $ cvs diff -u -r2.163 -r2.164 rpmds.c --- rpm/lib/rpmds.c 14 Sep 2009 21:32:21 -0000 2.163 +++ rpm/lib/rpmds.c 10 Dec 2009 18:52:18 -0000 2.164 @@ -2997,7 +2997,7 @@ const char *name = ((char *)data->d_buf) + name_offset; const char *desc = ((char *)data->d_buf) + desc_offset; if (memchr(name, '\0', nhdr.n_namesz) == NULL) - continue; + /*...@innercontinue@*/ continue; switch (nhdr.n_type) { default: /*...@innercontinue@*/ continue; #if !defined(NT_GNU_BUILD_ID) @@ -3010,8 +3010,8 @@ buf[0] = '\0'; t = buf; for (i = 0; i < nhdr.n_descsz; ++i) { - *t++ = hex[ ((desc[i] >> 4) & 0x0f) ]; - *t++ = hex[ ((desc[i] ) & 0x0f) ]; + *t++ = hex[ (((unsigned)desc[i] >> 4) & 0x0f) ]; + *t++ = hex[ (((unsigned)desc[i] ) & 0x0f) ]; } *t = '\0'; /* Add next buildid. */ @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmfc.c ============================================================================ $ cvs diff -u -r1.69 -r1.70 rpmfc.c --- rpm/lib/rpmfc.c 7 Dec 2009 21:39:04 -0000 1.69 +++ rpm/lib/rpmfc.c 10 Dec 2009 18:52:18 -0000 1.70 @@ -862,7 +862,9 @@ if (is_executable) xx = rpmfcHelper(fc, 'R', "mono"); } +/*...@-observertrans@*/ defaultdocdir = _free(defaultdocdir) ; +/*...@=observertrans@*/ return 0; } @@ -1257,8 +1259,8 @@ mg = rpmmgFree(mg); rpmlog(RPMLOG_DEBUG, - D_("categorized %d files into %d classes (using %s).\n"), - fc->nfiles, argvCount(fc->cdict), magicfile); + D_("categorized %d files into %u classes (using %s).\n"), + (unsigned)fc->nfiles, argvCount(fc->cdict), magicfile); magicfile = _free(magicfile); return RPMRC_OK; @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmfi.c ============================================================================ $ cvs diff -u -r2.151 -r2.152 rpmfi.c --- rpm/lib/rpmfi.c 5 Dec 2009 18:15:32 -0000 2.151 +++ rpm/lib/rpmfi.c 10 Dec 2009 18:52:18 -0000 2.152 @@ -1334,6 +1334,7 @@ xx = headerGet((_h), he, 0); \ _data = he->p.ptr; +/*...@-strictusereleased@*/ rpmfi rpmfiNew(const void * _ts, Header h, rpmTag tagN, int flags) { /*...@-castexpose@*/ @@ -1654,6 +1655,7 @@ return rpmfiLink(fi, (fi ? fi->Type : NULL)); /*...@=compdef =nullst...@*/ } +/*...@=strictusereleased@*/ int rpmfiAddRelocation(rpmRelocation * relp, int * nrelp, const char * oldPath, const char * newPath) @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmgi.c ============================================================================ $ cvs diff -u -r2.71 -r2.72 rpmgi.c --- rpm/lib/rpmgi.c 10 Dec 2009 09:53:44 -0000 2.71 +++ rpm/lib/rpmgi.c 10 Dec 2009 18:52:18 -0000 2.72 @@ -457,8 +457,7 @@ /*...@-mustmod@*/ static void rpmgiFini(void * _gi) - /*...@globals rpmGlobalMacroContext @*/ - /*...@modifies _gi, rpmGlobalMacroContext @*/ + /*...@modifies _gi @*/ { rpmgi gi = _gi; int xx; @@ -583,7 +582,8 @@ if (h != NULL) { if (!(gi->flags & RPMGI_NOHEADER)) gi->h = headerLink(h); - sprintf(hnum, "%u", rpmmiInstance(gi->mi)); + /* XXX use h->origin instead. */ + sprintf(hnum, "%u", (unsigned)rpmmiInstance(gi->mi)); gi->hdrPath = rpmExpand("rpmdb h# ", hnum, NULL); rpmrc = RPMRC_OK; /* XXX header reference held by iterator, so no headerFree */ @@ -609,7 +609,8 @@ if (h != NULL) { if (!(gi->flags & RPMGI_NOHEADER)) gi->h = headerLink(h); - sprintf(hnum, "%u", rpmmiInstance(gi->mi)); + /* XXX use h->origin instead. */ + sprintf(hnum, "%u", (unsigned)rpmmiInstance(gi->mi)); gi->hdrPath = rpmExpand("rpmdb h# ", hnum, NULL); rpmrc = RPMRC_OK; /* XXX header reference held by iterator, so no headerFree */ @@ -729,10 +730,7 @@ if ((gi->flags & RPMGI_TSADD) && gi->h != NULL) { /* XXX rpmgi hack: Save header in transaction element. */ if (gi->flags & RPMGI_ERASING) { - static int hdrx = 0; - rpmuint32_t hdrNum = headerGetInstance(gi->h); - if (hdrNum <= 0) - hdrNum = --hdrx; + uint32_t hdrNum = headerGetInstance(gi->h); xx = rpmtsAddEraseElement(gi->ts, gi->h, hdrNum); } else xx = rpmtsAddInstallElement(gi->ts, gi->h, (fnpyKey)gi->hdrPath, 2, NULL); @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmrc.c ============================================================================ $ cvs diff -u -r2.288 -r2.289 rpmrc.c --- rpm/lib/rpmrc.c 20 Aug 2009 16:10:20 -0000 2.288 +++ rpm/lib/rpmrc.c 10 Dec 2009 18:52:18 -0000 2.289 @@ -1246,6 +1246,7 @@ #endif fprintf(fp, _("Features provided by current cpuinfo (from %s):\n"), fn); +/*...@-mods@*/ cpuinfoP = rpmdsInit(cpuinfoP); while (rpmdsNext(cpuinfoP) >= 0) { const char * DNEVR = rpmdsDNEVR(cpuinfoP); @@ -1254,6 +1255,7 @@ } (void)rpmdsFree(cpuinfoP); cpuinfoP = NULL; +/*...@=mods@*/ fprintf(fp, "\n"); } @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmts.h ============================================================================ $ cvs diff -u -r2.125 -r2.126 rpmts.h --- rpm/lib/rpmts.h 4 Dec 2009 04:51:43 -0000 2.125 +++ rpm/lib/rpmts.h 10 Dec 2009 18:52:18 -0000 2.126 @@ -451,9 +451,8 @@ * @return 0 on success */ static inline /*...@unused@*/ -int rpmtsInitDB(rpmts ts, int dbmode) - /*...@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*...@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ +int rpmtsInitDB(/*...@unused@*/ rpmts ts, /*...@unused@*/ int dbmode) + /*...@*/ { return -1; } @@ -474,9 +473,8 @@ * @return 0 on success */ static inline /*...@unused@*/ -int rpmtsVerifyDB(rpmts ts) - /*...@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*...@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ +int rpmtsVerifyDB(/*...@unused@*/ rpmts ts) + /*...@*/ { return -1; } @@ . patch -p0 <<'@@ .' Index: rpm/lib/transaction.c ============================================================================ $ cvs diff -u -r1.409 -r1.410 transaction.c --- rpm/lib/transaction.c 4 Dec 2009 13:58:25 -0000 1.409 +++ rpm/lib/transaction.c 10 Dec 2009 18:52:18 -0000 1.410 @@ -1364,7 +1364,7 @@ /* Open database RDWR for installing packages. */ if (rpmtsOpenDB(ts, dbmode)) { lock = rpmtsFreeLock(lock); - if (sx) sx = rpmsxFree(sx); + if (sx != NULL) sx = rpmsxFree(sx); return -1; /* XXX W2DO? */ } } @@ -1416,6 +1416,7 @@ } if (!(rpmtsFilterFlags(ts) & RPMPROB_FILTER_REPLACEPKG)) { +#ifdef DYING mi = rpmtsInitIterator(ts, RPMTAG_NAME, rpmteN(p), 0); xx = rpmmiAddPattern(mi, RPMTAG_EPOCH, RPMMIRE_STRCMP, rpmteE(p)); @@ -1442,6 +1443,18 @@ /*...@innerbreak@*/ break; } mi = rpmmiFree(mi); +#else + ARGV_t keys = NULL; + int xx = rpmdbMireApply(rpmtsGetRdb(ts), RPMTAG_NVRA, + RPMMIRE_STRCMP, rpmteNEVRA(p), &keys); + int nkeys = argvCount(keys); + if (nkeys > 0) + rpmpsAppend(ps, RPMPROB_PKG_INSTALLED, + rpmteNEVR(p), rpmteKey(p), + NULL, NULL, + NULL, 0); + keys = argvFree(keys); +#endif } /* Count no. of files (if any). */ @@ -1676,7 +1689,7 @@ if (rpmdbFindFpList(rpmtsGetRdb(ts), fi->fps, matches, fc, exclude)) { ps = rpmpsFree(ps); lock = rpmtsFreeLock(lock); - if (sx) sx = rpmsxFree(sx); + if (sx != NULL) sx = rpmsxFree(sx); return 1; /* XXX WTFO? */ } @@ -1831,7 +1844,7 @@ ) { lock = rpmtsFreeLock(lock); - if (sx) sx = rpmsxFree(sx); + if (sx != NULL) sx = rpmsxFree(sx); return ts->orderCount; } @@ -2146,16 +2159,16 @@ } lock = rpmtsFreeLock(lock); - if (sx) sx = rpmsxFree(sx); + if (sx != NULL) sx = rpmsxFree(sx); /*...@-nullstate@*/ /* FIX: ts->flList may be NULL */ if (ourrc) { - if (ts->txn) + if (ts->txn != NULL) xx = rpmtxnAbort(ts->txn); ts->txn = NULL; return -1; } else { - if (ts->txn) + if (ts->txn != NULL) xx = rpmtxnCommit(ts->txn); ts->txn = NULL; xx = rpmtxnCheckpoint(rpmtsGetRdb(ts)); @@ . patch -p0 <<'@@ .' Index: rpm/lib/verify.c ============================================================================ $ cvs diff -u -r2.198 -r2.199 verify.c --- rpm/lib/verify.c 10 Dec 2009 09:53:44 -0000 2.198 +++ rpm/lib/verify.c 10 Dec 2009 18:52:18 -0000 2.199 @@ -49,13 +49,14 @@ const unsigned char * digest; const char * fuser; const char * fgroup; -#if defined(__LCLINT__) +#if defined(__LCLINT__NOTYET) /*...@refs@*/ int nrefs; /*!< (unused) keep splint happy */ #endif }; -static rpmvf rpmvfFree(rpmvf vf) +static rpmvf rpmvfFree(/*...@only@*/ rpmvf vf) + /*...@modifies vf @*/ { if (vf) { #ifdef NOTYET @@ -76,7 +77,9 @@ return NULL; } +/*...@only@*/ static rpmvf rpmvfNew(rpmts ts, rpmfi fi, int i, rpmVerifyAttrs omitMask) + /*...@*/ { rpmvf vf = xcalloc(1, sizeof(*vf)); @@ -85,7 +88,9 @@ vf->_item.pool = NULL; #endif +/*...@-mods@*/ vf->fn = rpmGetPath(rpmtsRootDir(ts), fi->dnl[fi->dil[i]], fi->bnl[i], NULL); +/*...@=mods@*/ vf->flink = fi->flinks[i]; vf->fuser = fi->fuser[i]; vf->fgroup = fi->fgroup[i]; @@ -138,8 +143,7 @@ */ static int rpmvfVerify(rpmvf vf, int spew) /*...@globals h_errno, fileSystem, internalState @*/ - /*...@modifies vf, te, fileSystem, internalState @*/ - /*...@requires maxSet(res) >= 0 @*/ + /*...@modifies vf, fileSystem, internalState @*/ { rpmVerifyAttrs res = RPMVERIFY_NONE; struct stat sb; @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository [email protected]
