Splint fiddles.

CVS patchset: 7513
CVS date: 2004/10/26 00:22:10
This commit is contained in:
jbj 2004-10-26 00:22:10 +00:00
parent 0a68012b6f
commit 959434ca80
5 changed files with 35 additions and 16 deletions

View File

@ -177,8 +177,10 @@ int rpmtsAddInstallElement(rpmts ts, Header h,
continue;
/* XXX Never check source headers. */
/*@-type @*/
if (p->isSource)
continue;
/*@=type @*/
if (tscolor) {
if (arch == NULL || (parch = rpmteA(p)) == NULL)

View File

@ -25,6 +25,8 @@
#include "debug.h"
/*@access rpmgi @*/
/**
*/
static void printFileInfo(char * te, const char * name,
@ -361,6 +363,8 @@ void rpmDisplayQueryTags(FILE * fp)
}
static int rpmgiShowMatches(QVA_t qva, rpmts ts)
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies qva, rpmGlobalMacroContext, h_errno, internalState @*/
{
rpmgi gi = qva->qva_gi;
int ec = 0;
@ -370,7 +374,7 @@ static int rpmgiShowMatches(QVA_t qva, rpmts ts)
int rc;
/* XXX delayed spewage. */
if (gi->flags & RPMGI_TSADD)
if (gi != NULL && gi->flags & RPMGI_TSADD)
continue;
h = rpmgiHeader(gi);
@ -718,9 +722,9 @@ int rpmcliArgIter(rpmts ts, QVA_t qva, ARGV_t argv)
rpmtsEmpty(ts);
break;
default:
giFlags |= (RPMGI_NOGLOB|RPMGI_NOHEADER);
qva->qva_gi = rpmgiNew(ts, RPMDBI_ARGLIST, NULL, 0);
qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, 0, giFlags);
qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, ftsOpts,
(giFlags | (RPMGI_NOGLOB|RPMGI_NOHEADER)));
while (rpmgiNext(qva->qva_gi) == RPMRC_OK) {
ec += rpmQueryVerify(qva, ts, rpmgiHdrPath(qva->qva_gi));
rpmtsEmpty(ts);

View File

@ -383,9 +383,9 @@ int showQueryPackage(QVA_t qva, rpmts ts, Header h)
* @return 0 on success, else no. of failures
*/
int rpmcliArgIter(rpmts ts, QVA_t qva, /*@null@*/ ARGV_t argv)
/*@globals rpmGlobalMacroContext, h_errno,
/*@globals ftsOpts, rpmGlobalMacroContext, h_errno,
fileSystem, internalState @*/
/*@modifies ts, qva, rpmGlobalMacroContext,
/*@modifies ts, qva, ftsOpts, rpmGlobalMacroContext,
fileSystem, internalState @*/;
/** \ingroup rpmcli

View File

@ -17,7 +17,10 @@
#include "debug.h"
/*@access fnpyKey @*/
/*@access rpmdbMatchIterator @*/
/*@access rpmts @*/
/*@access rpmps @*/
/*@unchecked@*/
int _rpmgi_debug = 0;
@ -196,8 +199,7 @@ static rpmRC rpmgiLoadReadHeader(rpmgi gi)
*/
/*@null@*/
static rpmRC rpmgiWalkPathFilter(rpmgi gi)
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/
/*@*/
{
FTSENT * fts = gi->fts;
rpmRC rpmrc = RPMRC_NOTFOUND;
@ -260,8 +262,10 @@ static rpmRC rpmgiWalkReadHeader(rpmgi gi)
if (rpmrc == RPMRC_OK) {
Header h = NULL;
if (!(gi->flags & RPMGI_NOHEADER))
h = rpmgiReadHeader(gi, gi->fts->fts_path);
if (!(gi->flags & RPMGI_NOHEADER)) {
if (gi->fts != NULL) /* XXX can't happen */
h = rpmgiReadHeader(gi, gi->fts->fts_path);
}
if (h != NULL)
gi->h = headerLink(h);
h = headerFree(h);
@ -292,7 +296,9 @@ static rpmRC rpmgiGlobArgv(rpmgi gi, /*@null@*/ ARGV_t argv)
if (argv != NULL) {
while (argv[ac] != NULL)
ac++;
/*@-nullstate@*/ /* XXX argv is not NULL */
xx = argvAppend(&gi->argv, argv);
/*@=nullstate@*/
}
gi->argc = ac;
return rpmrc;
@ -317,7 +323,8 @@ static rpmRC rpmgiGlobArgv(rpmgi gi, /*@null@*/ ARGV_t argv)
* @returns RPMRC_OK on success
*/
static rpmRC rpmgiInitFilter(rpmgi gi)
/*@modifies gi @*/
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/
{
rpmRC rpmrc = RPMRC_OK;
ARGV_t av;
@ -338,6 +345,7 @@ fprintf(stderr, "*** gi %p\tmi %p\n", gi, gi->mi);
tag = RPMTAG_NAME;
/* Parse for "tag=pattern" args. */
/*@-branchstate@*/
if ((ae = strchr(a, '=')) != NULL) {
*ae++ = '\0';
tag = tagValue(a);
@ -347,6 +355,7 @@ fprintf(stderr, "*** gi %p\tmi %p\n", gi, gi->mi);
}
pat = ae;
}
/*@=branchstate@*/
if (!res) {
if (_rpmgi_debug < 0)
@ -435,7 +444,9 @@ rpmgi rpmgiNew(rpmts ts, int tag, const void * keyp, size_t keylen)
gi->ts = rpmtsLink(ts, __FUNCTION__);
gi->tag = tag;
/*@-assignexpose@*/
gi->keyp = keyp;
/*@=assignexpose@*/
gi->keylen = keylen;
gi->flags = 0;
@ -607,9 +618,8 @@ enditer:
/*@=branchstate@*/
}
rpmpsFree(ps);
rpmpsFree(ts->probs); /* XXX hackery */
ts->probs = NULL;
ps = rpmpsFree(ps);
ts->probs = rpmpsFree(ts->probs); /* XXX hackery */
xx = rpmtsOrder(ts);

View File

@ -38,6 +38,7 @@ struct rpmgi_s {
/*@refcounted@*/
rpmts ts; /*!< Iterator transaction set. */
int tag; /*!< Iterator type. */
/*@kept@*/ /*@relnull@*/
const void * keyp; /*!< Iterator key. */
size_t keylen; /*!< Iterator key length. */
@ -61,7 +62,7 @@ struct rpmgi_s {
int ftsOpts;
/*@null@*/
FTS * ftsp;
/*@null@*/
/*@relnull@*/
FTSENT * fts;
/*@refs@*/
@ -128,7 +129,8 @@ rpmgi rpmgiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi)
* @return new iterator
*/
/*@null@*/
rpmgi rpmgiNew(rpmts ts, int tag, /*@null@*/ const void * keyp, size_t keylen)
rpmgi rpmgiNew(rpmts ts, int tag, /*@kept@*/ /*@null@*/ const void * keyp,
size_t keylen)
/*@globals internalState @*/
/*@modifies ts, internalState @*/;
@ -178,7 +180,8 @@ rpmts rpmgiTs(/*@null@*/ rpmgi gi)
*/
rpmRC rpmgiSetArgs(rpmgi gi, /*@null@*/ ARGV_t argv,
int ftsOpts, rpmgiFlags flags)
/*@modifies gi @*/;
/*@globals internalState @*/
/*@modifies gi, internalState @*/;
#ifdef __cplusplus
}