summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2003-01-20 23:52:04 +0000
committerjbj <devnull@localhost>2003-01-20 23:52:04 +0000
commitd6ea2fbf22bd4828bf30e2fd3248d2a191ce27d5 (patch)
tree0b077f1fbec5dd29e8dffc489750f41011101c91 /lib
parentfc1b33b66f0502ad1d9ccf0e3a2112e7aeb8b478 (diff)
downloadlibrpm-tizen-d6ea2fbf22bd4828bf30e2fd3248d2a191ce27d5.tar.gz
librpm-tizen-d6ea2fbf22bd4828bf30e2fd3248d2a191ce27d5.tar.bz2
librpm-tizen-d6ea2fbf22bd4828bf30e2fd3248d2a191ce27d5.zip
Splint fiddles.
CVS patchset: 6018 CVS date: 2003/01/20 23:52:04
Diffstat (limited to 'lib')
-rw-r--r--lib/psm.c1
-rw-r--r--lib/query.c2
-rw-r--r--lib/rpmds.h34
-rw-r--r--lib/rpmte.c13
-rw-r--r--lib/rpmte.h2
-rw-r--r--lib/rpmts.c2
-rw-r--r--lib/rpmts.h21
-rw-r--r--lib/transaction.c6
8 files changed, 20 insertions, 61 deletions
diff --git a/lib/psm.c b/lib/psm.c
index 3764d7e57..f5fd426e8 100644
--- 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 */
diff --git a/lib/query.c b/lib/query.c
index ac03fec8d..95daa7f3f 100644
--- a/lib/query.c
+++ b/lib/query.c
@@ -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;
diff --git a/lib/rpmds.h b/lib/rpmds.h
index 853029189..ec44887f2 100644
--- a/lib/rpmds.h
+++ b/lib/rpmds.h
@@ -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?
diff --git a/lib/rpmte.c b/lib/rpmte.c
index 0fb74c756..6e373b9d7 100644
--- a/lib/rpmte.c
+++ b/lib/rpmte.c
@@ -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@*/
diff --git a/lib/rpmte.h b/lib/rpmte.h
index 7451ee60a..fd4f29d35 100644
--- a/lib/rpmte.h
+++ b/lib/rpmte.h
@@ -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.
diff --git a/lib/rpmts.c b/lib/rpmts.c
index 29c344143..97a44c927 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -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;
diff --git a/lib/rpmts.h b/lib/rpmts.h
index 7f82e1e82..fb40a5c4c 100644
--- a/lib/rpmts.h
+++ b/lib/rpmts.h
@@ -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.
*
diff --git a/lib/transaction.c b/lib/transaction.c
index a465494fa..cd55bbe18 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -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);