diff options
author | jbj <devnull@localhost> | 2002-12-24 04:04:20 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-12-24 04:04:20 +0000 |
commit | b7129ca89835ca7819b104f38d18970004fb0064 (patch) | |
tree | fb7ce4c36c8b6b4b572511987336e9ac5a788ec6 | |
parent | 415b3e6ff241d1c7120ee12ddb28bb1ad25c2e0d (diff) | |
download | rpm-b7129ca89835ca7819b104f38d18970004fb0064.tar.gz rpm-b7129ca89835ca7819b104f38d18970004fb0064.tar.bz2 rpm-b7129ca89835ca7819b104f38d18970004fb0064.zip |
splint fiddles.
CVS patchset: 5962
CVS date: 2002/12/24 04:04:20
-rw-r--r-- | build/files.c | 5 | ||||
-rw-r--r-- | build/pack.c | 15 | ||||
-rw-r--r-- | build/parseSpec.c | 6 | ||||
-rw-r--r-- | build/rpmbuild.h | 19 | ||||
-rw-r--r-- | build/rpmspec.h | 2 | ||||
-rw-r--r-- | build/spec.c | 2 | ||||
-rw-r--r-- | lib/rpmfi.h | 2 | ||||
-rw-r--r-- | lib/rpmts.c | 4 | ||||
-rw-r--r-- | lib/rpmts.h | 2 |
9 files changed, 33 insertions, 24 deletions
diff --git a/build/files.c b/build/files.c index c7b5c774a..71c7f6113 100644 --- a/build/files.c +++ b/build/files.c @@ -1370,6 +1370,7 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, fi->fgids = xcalloc(sizeof(*fi->fgids), fi->fc); /* Make the cpio list */ + if (fi->dil != NULL) /* XXX can't happen */ for (i = 0, flp = fl->fileList; i < fi->fc; i++, flp++) { char * b; @@ -1425,12 +1426,12 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, fi->fmapflags[i] |= CPIO_FOLLOW_SYMLINKS; } - /*@-branchstate@*/ + /*@-branchstate -compdef@*/ if (fip) *fip = fi; else fi = rpmfiFree(fi); - /*@=branchstate@*/ + /*@=branchstate =compdef@*/ } } /*@=bounds@*/ diff --git a/build/pack.c b/build/pack.c index 93668f5c1..d092bf5da 100644 --- a/build/pack.c +++ b/build/pack.c @@ -698,14 +698,13 @@ exit: /* XXX Fish the pkgid out of the signature header. */ if (sig != NULL && pkgidp != NULL) { - HGE_t hge = (HGE_t)headerGetEntry; - unsigned char * md5 = NULL; - rpmTagType type; + int_32 tagType; + unsigned char * MD5 = NULL; int_32 c; int xx; - xx = hge(sig, RPMSIGTAG_MD5, &type, (void **)&md5, &c); - if (type == RPM_BIN_TYPE && md5 != NULL && c == 16) - *pkgidp = md5; + xx = headerGetEntry(sig, RPMSIGTAG_MD5, &tagType, (void **)&MD5, &c); + if (tagType == RPM_BIN_TYPE && MD5 != NULL && c == 16) + *pkgidp = MD5; } sig = rpmFreeSignature(sig); @@ -834,7 +833,7 @@ int packageBinaries(Spec spec) rc = writeRPM(&pkg->header, NULL, fn, RPMLEAD_BINARY, csa, spec->passPhrase, NULL); - csa->cpioList = rpmfiFree(pkg->cpioList); + csa->cpioList = rpmfiFree(csa->cpioList); csa->cpioFdIn = fdFree(csa->cpioFdIn, "init (packageBinaries)"); /*@=type@*/ fn = _free(fn); @@ -880,7 +879,7 @@ int packageSources(Spec spec) rc = writeRPM(&spec->sourceHeader, &spec->sourcePkgId, fn, RPMLEAD_SOURCE, csa, spec->passPhrase, &(spec->cookie)); - csa->cpioList = rpmfiFree(spec->sourceCpioList); + csa->cpioList = rpmfiFree(csa->cpioList); csa->cpioFdIn = fdFree(csa->cpioFdIn, "init (packageSources)"); /*@=type@*/ fn = _free(fn); diff --git a/build/parseSpec.c b/build/parseSpec.c index fda62e0ef..305d81e9b 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -525,8 +525,10 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootURL, || (spec->BASpecs[index] = rpmtsSetSpec(ts, NULL)) == NULL) { spec->BACount = index; +/*@-nullstate@*/ spec = freeSpec(spec); return RPMERR_BADSPEC; +/*@=nullstate@*/ } #ifdef DYING rpmSetMachine(saveArch, NULL); @@ -539,10 +541,12 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootURL, spec->BACount = index; if (! index) { - spec = freeSpec(spec); rpmError(RPMERR_BADSPEC, _("No compatible architectures found for build\n")); +/*@-nullstate@*/ + spec = freeSpec(spec); return RPMERR_BADSPEC; +/*@=nullstate@*/ } /* diff --git a/build/rpmbuild.h b/build/rpmbuild.h index d1dd71cce..abe994d71 100644 --- a/build/rpmbuild.h +++ b/build/rpmbuild.h @@ -471,10 +471,8 @@ int parseSpec(rpmts ts, const char * specFile, /*@null@*/ const char * passPhrase, /*@null@*/ char * cookie, int anyarch, int force) - /*@globals rpmGlobalMacroContext, - fileSystem, internalState @*/ - /*@modifies *specp, - rpmGlobalMacroContext, fileSystem, internalState @*/; + /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmbuild * Build stages state machine driver. @@ -484,8 +482,7 @@ int parseSpec(rpmts ts, const char * specFile, * @return 0 on success */ int buildSpec(Spec spec, int what, int test) - /*@globals rpmGlobalMacroContext, - fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ /*@modifies spec->sourceHeader, spec->sourceCpioList, spec->cookie, spec->sourceRpmName, spec->sourcePkgId, spec->macros, spec->BASpecs, @@ -500,9 +497,8 @@ int buildSpec(Spec spec, int what, int test) * @return 0 on success */ int packageBinaries(Spec spec) - /*@globals rpmGlobalMacroContext, - fileSystem, internalState @*/ - /*@modifies spec->packages->header, + /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@modifies spec->packages->header, spec->packages->cpioList, spec->sourceRpmName, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -512,9 +508,8 @@ int packageBinaries(Spec spec) * @return 0 on success */ int packageSources(Spec spec) - /*@globals rpmGlobalMacroContext, - fileSystem, internalState @*/ - /*@modifies spec->sourceHeader, spec->cookie, + /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@modifies spec->sourceHeader, spec->cookie, spec->sourceCpioList, spec->sourceRpmName, spec->sourcePkgId, rpmGlobalMacroContext, fileSystem, internalState @*/; diff --git a/build/rpmspec.h b/build/rpmspec.h index a71b698ce..d14ffa8ef 100644 --- a/build/rpmspec.h +++ b/build/rpmspec.h @@ -148,6 +148,7 @@ struct Spec_s { unsigned char * sourcePkgId; /*@refcounted@*/ Header sourceHeader; +/*@refcounted@*/ rpmfi sourceCpioList; /*@dependent@*/ /*@null@*/ MacroContext macros; @@ -175,6 +176,7 @@ struct Package_s { Header header; /*@refcounted@*/ rpmds this; +/*@refcounted@*/ rpmfi cpioList; /*@owned@*/ diff --git a/build/spec.c b/build/spec.c index e162ce012..37f9aa248 100644 --- a/build/spec.c +++ b/build/spec.c @@ -705,6 +705,7 @@ int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg) if (qva->qva_showPackage == NULL) goto exit; +/*@-branchstate@*/ /*@-mods@*/ /* FIX: make spec abstract */ if (parseSpec(ts, arg, "/", buildRoot, recursing, passPhrase, cookie, anyarch, force) @@ -715,6 +716,7 @@ int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg) goto exit; } /*@=mods@*/ +/*@=branchstate@*/ res = 0; if (specedit) { diff --git a/lib/rpmfi.h b/lib/rpmfi.h index 2ac8924ce..26e8da2e3 100644 --- a/lib/rpmfi.h +++ b/lib/rpmfi.h @@ -51,7 +51,7 @@ struct rpmfi_s { /*@only@*/ /*@null@*/ const char ** flangs; /*!< File lang(s) (from header) */ -/*@only@*/ /*?null?*/ +/*@only@*/ /*@relnull@*/ uint_32 * dil; /*!< Directory indice(s) (from header) */ /*@only@*/ /*?null?*/ const uint_32 * fflags; /*!< File flag(s) (from header) */ diff --git a/lib/rpmts.c b/lib/rpmts.c index 38606e018..b39b078ff 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -1103,13 +1103,17 @@ rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags) Spec rpmtsSpec(rpmts ts) { +/*@-compdef -retexpose -usereleased@*/ return ts->spec; +/*@=compdef =retexpose =usereleased@*/ } Spec rpmtsSetSpec(rpmts ts, Spec spec) { Spec ospec = ts->spec; +/*@-assignexpose -temptrans@*/ ts->spec = spec; +/*@=assignexpose =temptrans@*/ return ospec; } diff --git a/lib/rpmts.h b/lib/rpmts.h index ddcd6a4e1..712769e2a 100644 --- a/lib/rpmts.h +++ b/lib/rpmts.h @@ -741,6 +741,7 @@ rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags) * @param ts transaction set * @return spec control structure */ +/*@null@*/ Spec rpmtsSpec(rpmts ts) /*@*/; @@ -750,6 +751,7 @@ Spec rpmtsSpec(rpmts ts) * @param spec new spec control structure * @return previous spec control structure */ +/*@null@*/ Spec rpmtsSetSpec(rpmts ts, /*@null@*/ Spec spec) /*@modifies ts @*/; |