splint fiddles.
authorjbj <devnull@localhost>
Tue, 24 Dec 2002 04:04:20 +0000 (04:04 +0000)
committerjbj <devnull@localhost>
Tue, 24 Dec 2002 04:04:20 +0000 (04:04 +0000)
CVS patchset: 5962
CVS date: 2002/12/24 04:04:20

build/files.c
build/pack.c
build/parseSpec.c
build/rpmbuild.h
build/rpmspec.h
build/spec.c
lib/rpmfi.h
lib/rpmts.c
lib/rpmts.h

index c7b5c77..71c7f61 100644 (file)
@@ -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@*/
index 93668f5..d092bf5 100644 (file)
@@ -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);
index fda62e0..305d81e 100644 (file)
@@ -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@*/
            }
 
            /*
index d1dd71c..abe994d 100644 (file)
@@ -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 @*/;
 
index a71b698..d14ffa8 100644 (file)
@@ -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@*/
index e162ce0..37f9aa2 100644 (file)
@@ -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) {
index 2ac8924..26e8da2 100644 (file)
@@ -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) */
index 38606e0..b39b078 100644 (file)
@@ -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;
 }
 
index ddcd6a4..712769e 100644 (file)
@@ -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 @*/;