Splint fiddles.

CVS patchset: 6018
CVS date: 2003/01/20 23:52:04
This commit is contained in:
jbj 2003-01-20 23:52:04 +00:00
parent fc1b33b66f
commit d6ea2fbf22
9 changed files with 26 additions and 61 deletions

View 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);
}

View File

@ -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 */

View 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;

View File

@ -232,40 +232,6 @@ rpmTag rpmdsTagN(/*@null@*/ const rpmds ds)
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

View 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@*/

View 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.

View 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;

View 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.
*

View 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);