summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-08-08 16:06:13 +0000
committerjbj <devnull@localhost>2002-08-08 16:06:13 +0000
commit6106bdb3594e9236854f09b25f2c88c868799fda (patch)
tree264ab0f13c49a6f5446e040d4440a5c12aee873a /lib
parentacfdb7fd57bea6322f922193faf04986e06c6d04 (diff)
downloadlibrpm-tizen-6106bdb3594e9236854f09b25f2c88c868799fda.tar.gz
librpm-tizen-6106bdb3594e9236854f09b25f2c88c868799fda.tar.bz2
librpm-tizen-6106bdb3594e9236854f09b25f2c88c868799fda.zip
lclint fiddles.
CVS patchset: 5615 CVS date: 2002/08/08 16:06:13
Diffstat (limited to 'lib')
-rw-r--r--lib/poptALL.c4
-rw-r--r--lib/psm.c1
-rw-r--r--lib/query.c26
-rw-r--r--lib/rpmcli.h35
-rw-r--r--lib/rpminstall.c26
-rw-r--r--lib/rpmlead.c7
-rw-r--r--lib/rpmts.h8
7 files changed, 61 insertions, 46 deletions
diff --git a/lib/poptALL.c b/lib/poptALL.c
index 31122607c..b278f22ec 100644
--- a/lib/poptALL.c
+++ b/lib/poptALL.c
@@ -95,9 +95,9 @@ static void printVersion(FILE * fp)
*/
/*@mayexit@*/
void rpmcliConfigured(void)
- /*@globals rpmCLIMacroContext, rpmGlobalMacroContext,
+ /*@globals rpmcliInitialized, rpmCLIMacroContext, rpmGlobalMacroContext,
fileSystem, internalState @*/
- /*@modifies rpmCLIMacroContext, rpmGlobalMacroContext,
+ /*@modifies rpmcliInitialized, rpmCLIMacroContext, rpmGlobalMacroContext,
fileSystem, internalState @*/
{
diff --git a/lib/psm.c b/lib/psm.c
index 2b36431b2..cf50bfe06 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -43,6 +43,7 @@
/*@access rpmfi @*/
/*@access rpmte @*/ /* XXX rpmInstallSourcePackage */
+/*@access rpmts @*/ /* XXX ts->notify */
int rpmVersionCompare(Header first, Header second)
{
diff --git a/lib/query.c b/lib/query.c
index 086b8dab7..e34c483f8 100644
--- a/lib/query.c
+++ b/lib/query.c
@@ -483,7 +483,7 @@ void rpmDisplayQueryTags(FILE * fp)
}
}
-int showMatches(QVA_t qva, rpmts ts)
+int rpmcliShowMatches(QVA_t qva, rpmts ts)
{
Header h;
int ec = 0;
@@ -683,7 +683,7 @@ restart:
/*@loopbreak@*/ break;
}
if (!res)
- res = showMatches(qva, ts);
+ res = rpmcliShowMatches(qva, ts);
}
break;
@@ -694,7 +694,7 @@ restart:
_("group %s does not contain any packages\n"), arg);
res = 1;
} else {
- res = showMatches(qva, ts);
+ res = rpmcliShowMatches(qva, ts);
}
break;
@@ -704,7 +704,7 @@ restart:
rpmError(RPMERR_QUERYINFO, _("no package triggers %s\n"), arg);
res = 1;
} else {
- res = showMatches(qva, ts);
+ res = rpmcliShowMatches(qva, ts);
}
break;
@@ -729,7 +729,7 @@ restart:
"pkgid", arg);
res = 1;
} else {
- res = showMatches(qva, ts);
+ res = rpmcliShowMatches(qva, ts);
}
} break;
@@ -747,7 +747,7 @@ restart:
"hdrid", arg);
res = 1;
} else {
- res = showMatches(qva, ts);
+ res = rpmcliShowMatches(qva, ts);
}
break;
@@ -772,7 +772,7 @@ restart:
"fileid", arg);
res = 1;
} else {
- res = showMatches(qva, ts);
+ res = rpmcliShowMatches(qva, ts);
}
} break;
@@ -802,7 +802,7 @@ restart:
"tid", arg);
res = 1;
} else {
- res = showMatches(qva, ts);
+ res = rpmcliShowMatches(qva, ts);
}
} break;
@@ -812,7 +812,7 @@ restart:
rpmError(RPMERR_QUERYINFO, _("no package requires %s\n"), arg);
res = 1;
} else {
- res = showMatches(qva, ts);
+ res = rpmcliShowMatches(qva, ts);
}
break;
@@ -823,7 +823,7 @@ restart:
rpmError(RPMERR_QUERYINFO, _("no package provides %s\n"), arg);
res = 1;
} else {
- res = showMatches(qva, ts);
+ res = rpmcliShowMatches(qva, ts);
}
break;
}
@@ -863,7 +863,7 @@ restart:
}
res = 1;
} else {
- res = showMatches(qva, ts);
+ res = rpmcliShowMatches(qva, ts);
}
fn = _free(fn);
} break;
@@ -896,7 +896,7 @@ restart:
_("record %u could not be read\n"), recOffset);
res = 1;
} else {
- res = showMatches(qva, ts);
+ res = rpmcliShowMatches(qva, ts);
}
} break;
@@ -907,7 +907,7 @@ restart:
rpmError(RPMERR_QUERYINFO, _("package %s is not installed\n"), arg);
res = 1;
} else {
- res = showMatches(qva, ts);
+ res = rpmcliShowMatches(qva, ts);
}
break;
}
diff --git a/lib/rpmcli.h b/lib/rpmcli.h
index 6afc5bf8e..4cd85052c 100644
--- a/lib/rpmcli.h
+++ b/lib/rpmcli.h
@@ -298,9 +298,9 @@ extern struct poptOption rpmVerifyPoptTable[];
* @param ts transaction set
* @return result of last non-zero showPackage() return
*/
-int showMatches(QVA_t qva, rpmts ts)
- /*@globals fileSystem@*/
- /*@modifies qva, fileSystem @*/;
+int rpmcliShowMatches(QVA_t qva, rpmts ts)
+ /*@globals rpmGlobalMacroContext, fileSystem@*/
+ /*@modifies qva, rpmGlobalMacroContext, fileSystem @*/;
/** \ingroup rpmcli
* Display list of tags that can be used in --queryformat.
@@ -545,9 +545,9 @@ struct rpmInstallArguments_s {
*/
int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia,
/*@null@*/ const char ** fileArgv)
- /*@globals packagesTotal, rpmGlobalMacroContext,
+ /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext,
fileSystem, internalState@*/
- /*@modifies ts, ia, packagesTotal, rpmGlobalMacroContext,
+ /*@modifies ts, ia, rpmcliPackagesTotal, rpmGlobalMacroContext,
fileSystem, internalState @*/;
/** \ingroup rpmcli
@@ -594,14 +594,16 @@ typedef /*@abstract@*/ struct IDTindex_s {
* @param idtx id index
* @return NULL always
*/
-/*@null@*/ IDTX IDTXfree(/*@only@*/ /*@null@*/ IDTX idtx)
+/*@null@*/
+IDTX IDTXfree(/*@only@*/ /*@null@*/ IDTX idtx)
/*@modifies idtx @*/;
/**
* Create id index.
* @return new id index
*/
-/*@only@*/ IDTX IDTXnew(void)
+/*@only@*/
+IDTX IDTXnew(void)
/*@*/;
/**
@@ -610,7 +612,8 @@ typedef /*@abstract@*/ struct IDTindex_s {
* @param need additional no. of elements needed
* @return id index (with room for "need" elements)
*/
-/*@only@*/ /*@null@*/ IDTX IDTXgrow(/*@only@*/ /*@null@*/ IDTX idtx, int need)
+/*@only@*/ /*@null@*/
+IDTX IDTXgrow(/*@only@*/ /*@null@*/ IDTX idtx, int need)
/*@modifies idtx @*/;
/**
@@ -618,7 +621,8 @@ typedef /*@abstract@*/ struct IDTindex_s {
* @param idtx id index
* @return id index
*/
-/*@only@*/ /*@null@*/ IDTX IDTXsort(/*@only@*/ /*@null@*/ IDTX idtx)
+/*@only@*/ /*@null@*/
+IDTX IDTXsort(/*@only@*/ /*@null@*/ IDTX idtx)
/*@modifies idtx @*/;
/**
@@ -627,7 +631,8 @@ typedef /*@abstract@*/ struct IDTindex_s {
* @param tag rpm tag
* @return id index
*/
-/*@only@*/ /*@null@*/ IDTX IDTXload(rpmts ts, rpmTag tag)
+/*@only@*/ /*@null@*/
+IDTX IDTXload(rpmts ts, rpmTag tag)
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
@@ -638,8 +643,8 @@ typedef /*@abstract@*/ struct IDTindex_s {
* @param tag rpm tag
* @return id index
*/
-/*@only@*/ /*@null@*/ IDTX IDTXglob(rpmts ts,
- const char * globstr, rpmTag tag)
+/*@only@*/ /*@null@*/
+IDTX IDTXglob(rpmts ts, const char * globstr, rpmTag tag)
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
@@ -652,8 +657,10 @@ typedef /*@abstract@*/ struct IDTindex_s {
*/
int rpmRollback(rpmts ts, struct rpmInstallArguments_s * ia,
/*@null@*/ const char ** argv)
- /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
- /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
+ /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext,
+ fileSystem, internalState @*/
+ /*@modifies ts, ia, rpmcliPackagesTotal, rpmGlobalMacroContext,
+ fileSystem, internalState @*/;
/** \ingroup rpmcli
*/
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
index 5cfeb3907..a11297c26 100644
--- a/lib/rpminstall.c
+++ b/lib/rpminstall.c
@@ -41,8 +41,10 @@ int rpmcliProgressTotal = 0;
* @param total final
*/
static void printHash(const unsigned long amount, const unsigned long total)
- /*@globals rpmcliHashesCurrent, rpmcliProgressCurrent, fileSystem @*/
- /*@modifies rpmcliHashesCurrent, rpmcliProgressCurrent, fileSystem @*/
+ /*@globals rpmcliHashesCurrent, rpmcliHashesTotal,
+ rpmcliProgressCurrent, fileSystem @*/
+ /*@modifies rpmcliHashesCurrent, rpmcliHashesTotal,
+ rpmcliProgressCurrent, fileSystem @*/
{
int hashesNeeded;
@@ -800,8 +802,8 @@ int rpmInstallSource(rpmts ts, const char * arg,
fprintf(stdout, _("Installing %s\n"), arg);
{
- rpmVSFlags ovsflags;
- ovsflags = rpmtsSetVSFlags(ts, (rpmtsVSFlags(ts) | RPMVSF_NEEDPAYLOAD));
+ rpmVSFlags ovsflags =
+ rpmtsSetVSFlags(ts, (rpmtsVSFlags(ts) | RPMVSF_NEEDPAYLOAD));
rpmRC rpmrc = rpmInstallSourcePackage(ts, fd, specFilePtr, cookie);
rc = (rpmrc == RPMRC_OK ? 0 : 1);
ovsflags = rpmtsSetVSFlags(ts, ovsflags);
@@ -1000,9 +1002,7 @@ IDTX IDTXglob(rpmts ts, const char * globstr, rpmTag tag)
}
/** @todo Transaction handling, more, needs work. */
-int rpmRollback(rpmts ts,
- /*@unused@*/ struct rpmInstallArguments_s * ia,
- const char ** argv)
+int rpmRollback(rpmts ts, struct rpmInstallArguments_s * ia, const char ** argv)
{
int ifmask= (INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL|INSTALL_ERASE);
unsigned thistid = 0xffffffff;
@@ -1092,10 +1092,14 @@ int rpmRollback(rpmts ts,
/* Install the previously erased packages for this transaction. */
while (rp != NULL && rp->val.u32 == thistid) {
+/*@-nullpass@*/ /* FIX: rp->key may be NULL */
rpmMessage(RPMMESS_DEBUG, "\t+++ %s\n", rp->key);
+/*@=nullpass@*/
+/*@-abstract@*/
rc = rpmtsAddInstallElement(ts, rp->h, (fnpyKey)rp->key,
0, ia->relocations);
+/*@=abstract@*/
if (rc != 0)
goto exit;
@@ -1176,13 +1180,15 @@ int rpmRollback(rpmts ts,
goto exit;
/* Clean up after successful rollback. */
- if (!rpmIsDebug()) {
+ if (rtids && !rpmIsDebug()) {
int i;
+ if (rtids->idt)
for (i = 0; i < rtids->nidt; i++) {
IDT rrp = rtids->idt + i;
if (rrp->val.u32 != thistid)
- continue;
- (void) unlink(rrp->key);
+ /*@innercontinue@*/ continue;
+ if (rrp->key) /* XXX can't happen */
+ (void) unlink(rrp->key);
}
}
diff --git a/lib/rpmlead.c b/lib/rpmlead.c
index be0b24944..65fa3af0c 100644
--- a/lib/rpmlead.c
+++ b/lib/rpmlead.c
@@ -15,6 +15,7 @@
#include "rpmlead.h"
#include "debug.h"
+/*@unchecked@*/ /*@observer@*/
static unsigned char lead_magic[] = {
RPMLEAD_MAGIC0, RPMLEAD_MAGIC1, RPMLEAD_MAGIC2, RPMLEAD_MAGIC3
};
@@ -26,10 +27,10 @@ int writeLead(FD_t fd, const struct rpmlead *lead)
struct rpmlead l;
/*@-boundswrite@*/
- memcpy(&l, lead, sizeof(*lead));
-/*@=boundswrite@*/
+ memcpy(&l, lead, sizeof(l));
- memcpy(&l.magic, lead_magic, sizeof(lead_magic));
+ memcpy(&l.magic, lead_magic, sizeof(l.magic));
+/*@=boundswrite@*/
l.type = htons(l.type);
l.archnum = htons(l.archnum);
l.osnum = htons(l.osnum);
diff --git a/lib/rpmts.h b/lib/rpmts.h
index 511eecbe8..81ec9f4b1 100644
--- a/lib/rpmts.h
+++ b/lib/rpmts.h
@@ -302,8 +302,8 @@ int rpmtsOpenDB(rpmts ts, int dbmode)
* @return 0 on success
*/
int rpmtsInitDB(rpmts ts, int dbmode)
- /*@globals fileSystem, internalState @*/
- /*@modifies ts, fileSystem, internalState @*/;
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmts
* Rebuild the database used by the transaction.
@@ -320,8 +320,8 @@ int rpmtsRebuildDB(rpmts ts)
* @return 0 on success
*/
int rpmtsVerifyDB(rpmts ts)
- /*@globals fileSystem, internalState @*/
- /*@modifies ts, fileSystem, internalState @*/;
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmts
* Return transaction database iterator.