summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-12-07 21:27:09 +0000
committerjbj <devnull@localhost>2002-12-07 21:27:09 +0000
commitbb2c78fdba1cc6ea151936c5547e8cee92d02169 (patch)
treeec322e0bf720d891c06a8b124d8b0e5e5aca8d8c /build
parent92dee513d21e94a3aa7ee455d12cffed82db2ff2 (diff)
downloadrpm-bb2c78fdba1cc6ea151936c5547e8cee92d02169.tar.gz
rpm-bb2c78fdba1cc6ea151936c5547e8cee92d02169.tar.bz2
rpm-bb2c78fdba1cc6ea151936c5547e8cee92d02169.zip
Splint fiddles.
CVS patchset: 5920 CVS date: 2002/12/07 21:27:09
Diffstat (limited to 'build')
-rw-r--r--build/rpmfc.c19
-rw-r--r--build/rpmfc.h16
2 files changed, 30 insertions, 5 deletions
diff --git a/build/rpmfc.c b/build/rpmfc.c
index 8c7f3afbf..2dae2c530 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -274,12 +274,16 @@ static int rpmfcSaveArg(/*@out@*/ ARGV_t * argvp, const char * key)
return rc;
}
-static char * rpmfcFileDep(char * buf, int ix, rpmds this)
+static char * rpmfcFileDep(/*@returned@*/ char * buf, int ix,
+ /*@null@*/ rpmds this)
/*@modifies buf @*/
{
int_32 tagN = rpmdsTagN(this);
char deptype = 'X';
+/*@-boundswrite@*/
+ buf[0] = '\0';
+/*@=boundswrite@*/
switch (tagN) {
case RPMTAG_PROVIDENAME:
deptype = 'P';
@@ -288,8 +292,11 @@ static char * rpmfcFileDep(char * buf, int ix, rpmds this)
deptype = 'R';
break;
}
- sprintf(buf, "%08d%c %s %s 0x%08x", ix, deptype,
+/*@-nullpass@*/
+ if (this != NULL)
+ sprintf(buf, "%08d%c %s %s 0x%08x", ix, deptype,
rpmdsN(this), rpmdsEVR(this), rpmdsFlags(this));
+/*@=nullpass@*/
return buf;
};
@@ -356,6 +363,7 @@ static int rpmfcHelper(rpmfc fc, unsigned char deptype, const char * nsdep)
N = pav[i];
EVR = "";
Flags = dsContext;
+/*@-branchstate@*/
if (pav[i+1] && strchr("=<>", *pav[i+1])) {
i++;
for (s = pav[i]; *s; s++) {
@@ -378,6 +386,7 @@ assert(*s != '\0');
EVR = pav[i];
assert(EVR != NULL);
}
+/*@=branchstate@*/
this = rpmdsSingle(tagN, N, EVR, Flags);
xx = rpmdsMerge(depsp, this);
@@ -1319,14 +1328,14 @@ int rpmfcGenerateDepends(const Spec spec, Package pkg)
/* Copy (and delete) manually generated dependencies to dictionary. */
ds = rpmdsNew(pkg->header, RPMTAG_PROVIDENAME, scareMem);
- rpmdsMerge(&fc->provides, ds);
+ xx = rpmdsMerge(&fc->provides, ds);
ds = rpmdsFree(ds);
xx = headerRemoveEntry(pkg->header, RPMTAG_PROVIDENAME);
xx = headerRemoveEntry(pkg->header, RPMTAG_PROVIDEVERSION);
xx = headerRemoveEntry(pkg->header, RPMTAG_PROVIDEFLAGS);
ds = rpmdsNew(pkg->header, RPMTAG_REQUIRENAME, scareMem);
- rpmdsMerge(&fc->requires, ds);
+ xx = rpmdsMerge(&fc->requires, ds);
ds = rpmdsFree(ds);
xx = headerRemoveEntry(pkg->header, RPMTAG_REQUIRENAME);
xx = headerRemoveEntry(pkg->header, RPMTAG_REQUIREVERSION);
@@ -1362,6 +1371,7 @@ assert(ac == c);
p, c);
/* Add Provides: */
+/*@-branchstate@*/
if (fc->provides != NULL && (c = fc->provides->Count) > 0) {
p = (const void **) fc->provides->N;
xx = headerAddEntry(pkg->header, RPMTAG_PROVIDENAME, RPM_STRING_ARRAY_TYPE,
@@ -1386,6 +1396,7 @@ assert(ac == c);
xx = headerAddEntry(pkg->header, RPMTAG_REQUIREFLAGS, RPM_INT32_TYPE,
p, c);
}
+/*@=branchstate@*/
/* Add dependency dictionary(#dependencies) */
p = (const void **) argiData(fc->ddictx);
diff --git a/build/rpmfc.h b/build/rpmfc.h
index a682bae00..1f91fb0ef 100644
--- a/build/rpmfc.h
+++ b/build/rpmfc.h
@@ -29,7 +29,9 @@ struct rpmfc_s {
ARGV_t ddict; /*!< (#dependencies) file depends dictionary */
ARGI_t ddictx; /*!< (#dependencies) file->dependency mapping */
+/*@relnull@*/
rpmds provides; /*!< (#provides) package provides */
+/*@relnull@*/
rpmds requires; /*!< (#requires) package requires */
StringBuf sb_java; /*!< concatenated list of java colored files. */
@@ -84,6 +86,8 @@ struct rpmfcTokens_s {
int colors;
};
+/**
+ */
typedef struct rpmfcTokens_s * rpmfcToken;
#ifdef __cplusplus
@@ -110,39 +114,49 @@ int rpmfcColoring(const char * fmstr)
*/
void rpmfcPrint(const char * msg, rpmfc fc, FILE * fp)
/*@globals fileSystem @*/
- /*@modifies *fp, fileSystem @*/;
+ /*@modifies *fp, fc, fileSystem @*/;
+
/**
* Destroy a file classifier.
* @param fc file classifier
* @return NULL always
*/
+/*@-exportlocal@*/
/*@null@*/
rpmfc rpmfcFree(/*@only@*/ /*@null@*/ rpmfc fc)
/*@modifies fc @*/;
+/*@=exportlocal@*/
/**
* Create a file classifier.
* @return new file classifier
*/
+/*@-exportlocal@*/
rpmfc rpmfcNew(void)
/*@*/;
+/*@=exportlocal@*/
/**
* Build file class dictionary and mappings.
* @param fc file classifier
+ * @param argv files to classify
* @return 0 on success
*/
+/*@-exportlocal@*/
int rpmfcClassify(rpmfc fc, ARGV_t argv)
/*@globals global_fmagic, fileSystem, internalState @*/
/*@modifies fc, global_fmagic, fileSystem, internalState @*/;
+/*@=exportlocal@*/
/**
* Build file/package dependency dictionary and mappings.
* @param fc file classifier
* @return 0 on success
*/
+/*@-exportlocal@*/
int rpmfcApply(rpmfc fc)
/*@modifies fc @*/;
+/*@=exportlocal@*/
/**
* Generate package dependencies.