Splint fiddles.
authorjbj <devnull@localhost>
Mon, 20 Jan 2003 23:52:04 +0000 (23:52 +0000)
committerjbj <devnull@localhost>
Mon, 20 Jan 2003 23:52:04 +0000 (23:52 +0000)
CVS patchset: 6018
CVS date: 2003/01/20 23:52:04

build/rpmfc.c
lib/psm.c
lib/query.c
lib/rpmds.h
lib/rpmte.c
lib/rpmte.h
lib/rpmts.c
lib/rpmts.h
lib/transaction.c

index 92f8d73..39a3a80 100644 (file)
@@ -983,14 +983,18 @@ assert(s != NULL);
        else
            s = fn;
 
+/*@-boundswrite@*/
        buf[0] = '\0';
        t = buf;
+/*@-nullpass@*/ /* LCL: s is not null. */
        t = stpcpy(t, s);
+/*@=nullpass@*/
 
 #if !defined(__alpha__)
        if (isElf64)
            t = stpcpy(t, "()(64bit)");
 #endif
+/*@=boundswrite@*/
        t++;
 
        /* Add to package dependencies. */
@@ -998,7 +1002,9 @@ assert(s != NULL);
        xx = rpmdsMerge(depsp, ds);
 
        /* Add to file dependencies. */
+/*@-boundswrite@*/
        xx = rpmfcSaveArg(&fc->ddict, rpmfcFileDep(t, fc->ix, ds));
+/*@=boundswrite@*/
 
        ds = rpmdsFree(ds);
     }
index 3764d7e..f5fd426 100644 (file)
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -1852,7 +1852,6 @@ psm->te->h = headerLink(fi->h);
 
        if (psm->goal == PSM_PKGINSTALL) {
            int_32 installTime = (int_32) time(NULL);
-           int_32 tscolor = rpmtsColor(ts);
            int fc = rpmfiFC(fi);
 
            if (fi->h == NULL) break;   /* XXX can't happen */
index ac03fec..95daa7f 100644 (file)
@@ -126,7 +126,7 @@ static inline /*@null@*/ const char * queryHeader(Header h, const char * qfmt)
 int showQueryPackage(QVA_t qva, rpmts ts, Header h)
 {
     uint_32 tscolor = rpmtsColor(ts);
-    int scareMem = 1;
+    int scareMem = 0;
     rpmfi fi = NULL;
     char * t, * te;
     char * prefix = NULL;
index 8530291..ec44887 100644 (file)
@@ -233,40 +233,6 @@ int rpmdsNoPromote(/*@null@*/ const rpmds ds)
        /*@*/;
 
 /**
- * Return current dependency color.
- * @param ds           dependency set
- * @return             current dependency color
- */
-uint_32 rpmdsColor(/*@null@*/ const rpmds ds)
-       /*@*/;
-
-/**
- * Return current dependency color.
- * @param ds           dependency set
- * @param color                new dependency color
- * @return             previous dependency color
- */
-uint_32 rpmdsSetColor(/*@null@*/ const rpmds ds, uint_32 color)
-       /*@modifies ds @*/;
-
-/**
- * Return current dependency file refs.
- * @param ds           dependency set
- * @return             current dependency file refs, -1 on global
- */
-int_32 rpmdsRefs(/*@null@*/ const rpmds ds)
-       /*@*/;
-
-/**
- * Return current dependency color.
- * @param ds           dependency set
- * @param refs         new dependency refs
- * @return             previous dependency refs
- */
-int_32 rpmdsSetRefs(/*@null@*/ const rpmds ds, int_32 refs)
-       /*@modifies ds @*/;
-
-/**
  * Set "Don't promote Epoch:" flag.
  * @param ds           dependency set
  * @param nopromote    Should an unspecified Epoch: be treated as Epoch: 0?
index 0fb74c7..6e373b9 100644 (file)
@@ -116,9 +116,13 @@ static void addTE(rpmts ts, rpmte p, Header h,
 
     nb = strlen(p->NEVR) + 1;
     if (p->arch)
-       nb += strlen(arch) + 1;
-    p->NEVRA = t = xmalloc(nb);
-    (void) stpcpy( stpcpy( stpcpy(t, p->NEVR), "."), p->arch);
+       nb += strlen(p->arch) + 1;
+    t = xmalloc(nb);
+    p->NEVRA = t;
+    *t = '\0';
+    t = stpcpy(t, p->NEVR);
+    if (p->arch)
+       t = stpcpy( stpcpy( t, "."), p->arch);
 
     ep = NULL;
     xx = hge(h, RPMTAG_EPOCH, NULL, (void **)&ep, NULL);
@@ -163,6 +167,9 @@ static void addTE(rpmts ts, rpmte p, Header h,
 
     rpmteColorDS(p, RPMTAG_PROVIDENAME);
     rpmteColorDS(p, RPMTAG_REQUIRENAME);
+/*@-compdef@*/
+    return;
+/*@=compdef@*/
 }
 /*@=bounds@*/
 
index 7451ee6..fd4f29d 100644 (file)
@@ -415,9 +415,11 @@ extern const char * rpmteNEVR(rpmte te)
  * @param te           transaction element
  * @return             name-version-release.arch string
  */
+/*@-exportlocal@*/
 /*@observer@*/
 extern const char * rpmteNEVRA(rpmte te)
        /*@*/;
+/*@=exportlocal@*/
 
 /**
  * Retrieve file handle from transaction element.
index 29c3441..97a44c9 100644 (file)
@@ -97,8 +97,10 @@ uint_32 hGetColor(Header h)
     if (hge(h, RPMTAG_FILECOLORS, NULL, (void **)&fcolors, &ncolors)
      && fcolors != NULL && ncolors > 0)
     {
+/*@-boundsread@*/
        for (i = 0; i < ncolors; i++)
            hcolor |= fcolors[i];
+/*@=boundsread@*/
     }
     hcolor &= 0x0f;
 
index 7f82e1e..fb40a5c 100644 (file)
@@ -80,8 +80,8 @@ struct diskspaceInfo_s {
     signed long bneeded;       /*!< No. of blocks needed. */
     signed long ineeded;       /*!< No. of inodes needed. */
     int bsize;                 /*!< File system block size. */
-    signed long bavail;                /*!< No. of blocks available. */
-    signed long iavail;                /*!< No. of inodes available. */
+    signed long long bavail;   /*!< No. of blocks available. */
+    signed long long iavail;   /*!< No. of inodes available. */
 };
 
 /** \ingroup rpmts
@@ -796,23 +796,6 @@ uint_32 rpmtsSetColor(rpmts ts, uint_32 color)
 rpmte rpmtsSetRelocateElement(rpmts ts, /*@null@*/ rpmte relocateElement)
        /*@modifies ts @*/;
 
-/**
- * Retrieve color bits of transaction set.
- * @param ts           transaction set
- * @return             color bits
- */
-uint_32 rpmtsColor(rpmts ts)
-       /*@*/;
-
-/**
- * Set color bits of transaction set.
- * @param ts           transaction set
- * @param color                new color bits
- * @return             previous color bits
- */
-uint_32 rpmtsSetColor(rpmts ts, uint_32 color)
-       /*@modifies ts @*/;
-
 /** \ingroup rpmts
  * Set transaction notify callback function and argument.
  *
index a465494..cd55bbe 100644 (file)
@@ -238,9 +238,6 @@ static int handleInstInstalledFiles(const rpmts ts,
        mi = rpmdbFreeIterator(mi);
     }
 
-    if (otherFi == NULL)
-       return 1;
-
     /* Compute package color. */
     tecolor = rpmteColor(p);
     tecolor &= tscolor;
@@ -253,6 +250,9 @@ static int handleInstInstalledFiles(const rpmts ts,
        otecolor |= rpmfiFColor(otherFi);
     otecolor &= tscolor;
 
+    if (otherFi == NULL)
+       return 1;
+
     fi->replaced = xcalloc(sharedCount, sizeof(*fi->replaced));
 
     ps = rpmtsProblems(ts);