summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-10-16 17:42:18 +0000
committerjbj <devnull@localhost>2001-10-16 17:42:18 +0000
commit96a3f7a55d444296f97c3e28c8d810e220e1cb9f (patch)
tree01eb83731cd7193dda21a7ab3d8e741c41c0914f
parent9f45bcd3ecf3f3548ed7a8490b882a6ca9ffeb94 (diff)
downloadrpm-96a3f7a55d444296f97c3e28c8d810e220e1cb9f.tar.gz
rpm-96a3f7a55d444296f97c3e28c8d810e220e1cb9f.tar.bz2
rpm-96a3f7a55d444296f97c3e28c8d810e220e1cb9f.zip
Factor -type problems into explicit code annotations.
CVS patchset: 5117 CVS date: 2001/10/16 17:42:18
-rw-r--r--.lclintrc8
-rw-r--r--beecrypt/base64.c4
-rw-r--r--beecrypt/beecrypt.c10
-rw-r--r--beecrypt/entropy.c4
-rw-r--r--beecrypt/hmacmd5.c2
-rw-r--r--beecrypt/hmacsha1.c2
-rw-r--r--beecrypt/hmacsha256.c2
-rw-r--r--beecrypt/mp32barrett.c20
-rw-r--r--build/build.c2
-rw-r--r--build/files.c4
-rw-r--r--build/pack.c6
-rw-r--r--build/parseSpec.c2
-rw-r--r--build/spec.c8
-rw-r--r--lib/depends.c6
-rw-r--r--lib/formats.c2
-rw-r--r--lib/fsm.c10
-rw-r--r--lib/hdrinline.h2
-rw-r--r--lib/header.c6
-rw-r--r--lib/header_internal.c2
-rw-r--r--lib/header_internal.h2
-rw-r--r--lib/manifest.c2
-rw-r--r--lib/misc.c2
-rw-r--r--lib/poptBT.c6
-rw-r--r--lib/poptI.c6
-rw-r--r--lib/poptK.c2
-rw-r--r--lib/poptQV.c4
-rw-r--r--lib/rpmchecksig.c12
-rw-r--r--lib/rpminstall.c4
-rw-r--r--lib/rpmlead.c2
-rw-r--r--lib/signature.c12
-rw-r--r--lib/transaction.c4
-rw-r--r--lib/verify.c7
-rw-r--r--popt/popt.h10
-rw-r--r--popt/poptconfig.c7
-rw-r--r--popt/popthelp.c2
-rw-r--r--rpmdb/db1.c2
-rw-r--r--rpmdb/db3.c2
-rw-r--r--rpmdb/falloc.c2
-rw-r--r--rpmdb/rpmdb.c2
-rw-r--r--rpmio/digest.c4
-rw-r--r--rpmio/rpmio.c2
-rw-r--r--rpmio/rpmpgp.c2
-rw-r--r--rpmio/rpmpgp.h2
-rw-r--r--rpmio/rpmrpc.c2
-rw-r--r--rpmio/url.c2
-rwxr-xr-xrpmqv.c2
46 files changed, 184 insertions, 26 deletions
diff --git a/.lclintrc b/.lclintrc
index 539f9cd8b..f689d7fc4 100644
--- a/.lclintrc
+++ b/.lclintrc
@@ -31,7 +31,6 @@
-numenummembers 1024 # RPMTAG has 138 members
-numstructfields 256 # Java jni.h has 229 fields
-ptrarith # tedious
-#-sizeoftype # ~240 occurences, <sys/select.h> tedium, more
-strictops
-strictusereleased
-stringliterallen 4096 # redhat*PubKey's are big
@@ -59,4 +58,9 @@
# --- not-yet at standard level
-boolops # 1898 occurences
-predboolint # 1248 occurences
--type # 3019 occurences
+#-type # 3019 occurences
++boolint
++charint
++ignorequals
++ignoresigns
++matchanyintegral
diff --git a/beecrypt/base64.c b/beecrypt/base64.c
index 7c44d0fa3..f9ed04785 100644
--- a/beecrypt/base64.c
+++ b/beecrypt/base64.c
@@ -333,9 +333,9 @@ fprintf(stderr, "%7u %02x %02x %02x -> %02x %02x %02x %02x\n",
*te = '\0';
}
- /*@-mustfree@*/
+ /*@-mustfree -compdef @*/
return t;
- /*@=mustfree@*/
+ /*@=mustfree =compdef @*/
}
/*@=internalglobs =modfilesys @*/
diff --git a/beecrypt/beecrypt.c b/beecrypt/beecrypt.c
index c888cfa2a..21f88924a 100644
--- a/beecrypt/beecrypt.c
+++ b/beecrypt/beecrypt.c
@@ -67,6 +67,7 @@ typedef struct
#include "blowfish.h"
#include "blockmode.h"
+/*@-type@*/ /* FIX: cast? */
/*@observer@*/ /*@unchecked@*/
static entropySource entropySourceList[] =
{
@@ -92,6 +93,7 @@ static entropySource entropySourceList[] =
# endif
#endif
};
+/*@=type@*/
#define ENTROPYSOURCES (sizeof(entropySourceList) / sizeof(entropySource))
@@ -156,12 +158,14 @@ int entropyGatherNext(uint32* data, int size)
return -1;
}
+/*@-type@*/ /* FIX: cast? */
/*@observer@*/ /*@unchecked@*/
static const randomGenerator* randomGeneratorList[] =
{
&fips186prng,
&mtprng
};
+/*@=type@*/
#define RANDOMGENERATORS (sizeof(randomGeneratorList) / sizeof(randomGenerator*))
@@ -258,6 +262,7 @@ int randomGeneratorContextNext(randomGeneratorContext* ctxt, uint32* data, int s
return ctxt->rng->next(ctxt->param, data, size);
}
+/*@-type@*/ /* FIX: cast? */
/*@observer@*/ /*@unchecked@*/
static const hashFunction* hashFunctionList[] =
{
@@ -265,6 +270,7 @@ static const hashFunction* hashFunctionList[] =
&sha1,
&sha256
};
+/*@=type@*/
#define HASHFUNCTIONS (sizeof(hashFunctionList) / sizeof(hashFunction*))
@@ -472,6 +478,7 @@ int hashFunctionContextDigestMatch(hashFunctionContext* ctxt, const mp32number*
/*@=mustfree@*/
}
+/*@-type@*/ /* FIX: cast? */
/*@observer@*/ /*@unchecked@*/
static const keyedHashFunction* keyedHashFunctionList[] =
{
@@ -479,6 +486,7 @@ static const keyedHashFunction* keyedHashFunctionList[] =
&hmacsha1,
&hmacsha256
};
+/*@=type@*/
#define KEYEDHASHFUNCTIONS (sizeof(keyedHashFunctionList) / sizeof(keyedHashFunction*))
@@ -708,11 +716,13 @@ int keyedHashFunctionContextDigestMatch(keyedHashFunctionContext* ctxt, const mp
}
+/*@-type@*/ /* FIX: cast? */
/*@observer@*/ /*@unchecked@*/
static const blockCipher* blockCipherList[] =
{
&blowfish
};
+/*@=type@*/
#define BLOCKCIPHERS (sizeof(blockCipherList) / sizeof(blockCipher*))
diff --git a/beecrypt/entropy.c b/beecrypt/entropy.c
index 04689641f..942d42717 100644
--- a/beecrypt/entropy.c
+++ b/beecrypt/entropy.c
@@ -1,4 +1,4 @@
-/*@-sizeoftype@*/
+/*@-sizeoftype -type@*/
/** \ingroup ES_m
* \file entropy.c
*
@@ -1610,4 +1610,4 @@ dev_tty_end:
#endif
#endif
-/*@=sizeoftype@*/
+/*@=sizeoftype =type@*/
diff --git a/beecrypt/hmacmd5.c b/beecrypt/hmacmd5.c
index 2fb7caff0..8c0fcf388 100644
--- a/beecrypt/hmacmd5.c
+++ b/beecrypt/hmacmd5.c
@@ -33,6 +33,7 @@
const keyedHashFunction hmacmd5 = { "HMAC-MD5", sizeof(hmacmd5Param), 64, 4 * sizeof(uint32), 64, 512, 32, (const keyedHashFunctionSetup) hmacmd5Setup, (const keyedHashFunctionReset) hmacmd5Reset, (const keyedHashFunctionUpdate) hmacmd5Update, (const keyedHashFunctionDigest) hmacmd5Digest };
/*@=sizeoftype@*/
+/*@-type@*/
int hmacmd5Setup (hmacmd5Param* sp, const uint32* key, int keybits)
{
return hmacSetup((hmacParam*) sp, &md5, &sp->param, key, keybits);
@@ -52,3 +53,4 @@ int hmacmd5Digest(hmacmd5Param* sp, uint32* data)
{
return hmacDigest((hmacParam*) sp, &md5, &sp->param, data);
}
+/*@=type@*/
diff --git a/beecrypt/hmacsha1.c b/beecrypt/hmacsha1.c
index 7cd69939e..198dd346f 100644
--- a/beecrypt/hmacsha1.c
+++ b/beecrypt/hmacsha1.c
@@ -33,6 +33,7 @@
const keyedHashFunction hmacsha1 = { "HMAC-SHA-1", sizeof(hmacsha1Param), 64, 5 * sizeof(uint32), 64, 512, 32, (keyedHashFunctionSetup) hmacsha1Setup, (keyedHashFunctionReset) hmacsha1Reset, (keyedHashFunctionUpdate) hmacsha1Update, (keyedHashFunctionDigest) hmacsha1Digest };
/*@=sizeoftype@*/
+/*@-type@*/
int hmacsha1Setup (hmacsha1Param* sp, const uint32* key, int keybits)
{
return hmacSetup((hmacParam*) sp, &sha1, &sp->param, key, keybits);
@@ -52,3 +53,4 @@ int hmacsha1Digest(hmacsha1Param* sp, uint32* data)
{
return hmacDigest((hmacParam*) sp, &sha1, &sp->param, data);
}
+/*@=type@*/
diff --git a/beecrypt/hmacsha256.c b/beecrypt/hmacsha256.c
index 8eaeb8c71..900368923 100644
--- a/beecrypt/hmacsha256.c
+++ b/beecrypt/hmacsha256.c
@@ -33,6 +33,7 @@
const keyedHashFunction hmacsha256 = { "HMAC-SHA-256", sizeof(hmacsha256Param), 64, 8 * sizeof(uint32), 64, 512, 32, (keyedHashFunctionSetup) hmacsha256Setup, (keyedHashFunctionReset) hmacsha256Reset, (keyedHashFunctionUpdate) hmacsha256Update, (keyedHashFunctionDigest) hmacsha256Digest };
/*@=sizeoftype@*/
+/*@-type@*/
int hmacsha256Setup (hmacsha256Param* sp, const uint32* key, int keybits)
{
return hmacSetup((hmacParam*) sp, &sha256, &sp->param, key, keybits);
@@ -52,3 +53,4 @@ int hmacsha256Digest(hmacsha256Param* sp, uint32* data)
{
return hmacDigest((hmacParam*) sp, &sha256, &sp->param, data);
}
+/*@=type@*/
diff --git a/beecrypt/mp32barrett.c b/beecrypt/mp32barrett.c
index 78e50b6de..8f2a3dd6a 100644
--- a/beecrypt/mp32barrett.c
+++ b/beecrypt/mp32barrett.c
@@ -1,4 +1,4 @@
-/*@-sizeoftype@*/
+/*@-sizeoftype -type@*/
/** \ingroup MP_m
* \file mp32barrett.c
*
@@ -460,7 +460,9 @@ void mp32bmulmod_w(const mp32barrett* b, uint32 xsize, const uint32* xdata, uint
mp32zero(fill, temp);
mp32mul(temp+fill, xsize, xdata, ysize, ydata);
+ /*@-compdef@*/ /* *temp undefined */
mp32bmod_w(b, temp, result, wksp);
+ /*@=compdef@*/
}
/**
@@ -478,7 +480,9 @@ void mp32bsqrmod_w(const mp32barrett* b, uint32 xsize, const uint32* xdata, uint
mp32zero(fill, temp);
mp32sqr(temp+fill, xsize, xdata);
+ /*@-compdef@*/ /* *temp undefined */
mp32bmod_w(b, temp, result, wksp);
+ /*@=compdef@*/
}
/**
@@ -980,7 +984,9 @@ void mp32bnmulmod(const mp32barrett* b, const mp32number* x, const mp32number* y
/* xsize and ysize must be <= b->size */
register uint32 fill = 2*size-x->size-y->size;
+ /*@-nullptrarith@*/ /* temp may be NULL */
register uint32* opnd = temp+size*2+2;
+ /*@=nullptrarith@*/
mp32nfree(result);
mp32nsize(result, size);
@@ -990,9 +996,9 @@ void mp32bnmulmod(const mp32barrett* b, const mp32number* x, const mp32number* y
mp32mul(opnd+fill, x->size, x->data, y->size, y->data);
/*@-nullpass@*/ /* temp may be NULL */
- /*@-usedef@*/ /* result->data unallocated? */
+ /*@-usedef -compdef @*/ /* result->data unallocated? */
mp32bmod_w(b, opnd, result->data, temp);
- /*@=usedef@*/
+ /*@=usedef =compdef @*/
free(temp);
/*@=nullpass@*/
@@ -1005,7 +1011,9 @@ void mp32bnsqrmod(const mp32barrett* b, const mp32number* x, mp32number* result)
/* xsize must be <= b->size */
register uint32 fill = 2*(size-x->size);
+ /*@-nullptrarith@*/ /* temp may be NULL */
register uint32* opnd = temp + size*2+2;
+ /*@=nullptrarith@*/
mp32nfree(result);
mp32nsize(result, size);
@@ -1015,9 +1023,9 @@ void mp32bnsqrmod(const mp32barrett* b, const mp32number* x, mp32number* result)
mp32sqr(opnd+fill, x->size, x->data);
/*@-nullpass@*/ /* temp may be NULL */
- /*@-usedef@*/ /* result->data unallocated? */
+ /*@-usedef -compdef @*/ /* result->data unallocated? */
mp32bmod_w(b, opnd, result->data, temp);
- /*@=usedef@*/
+ /*@=usedef =compdef @*/
free(temp);
/*@=nullpass@*/
@@ -1054,4 +1062,4 @@ void mp32bnpowmodsld(const mp32barrett* b, const uint32* slide, const mp32number
free(temp);
/*@=nullpass@*/
}
-/*@=sizeoftype@*/
+/*@=sizeoftype =type@*/
diff --git a/build/build.c b/build/build.c
index 18ac635dc..a92541043 100644
--- a/build/build.c
+++ b/build/build.c
@@ -145,10 +145,12 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test)
xfd = fd;
/*@=branchstate@*/
+ /*@-type@*/ /* FIX: cast? */
if ((fp = fdGetFp(xfd)) == NULL) {
rc = RPMERR_SCRIPT;
goto exit;
}
+ /*@=type@*/
(void) urlPath(rootURL, &rootDir);
/*@-branchstate@*/
diff --git a/build/files.c b/build/files.c
index fa44e1b66..2e45354b5 100644
--- a/build/files.c
+++ b/build/files.c
@@ -2200,7 +2200,9 @@ static StringBuf getOutputFrom(char * dir, char * argv[],
StringBuf readBuff;
int done;
+ /*@-type@*/ /* FIX: cast? */
oldhandler = signal(SIGPIPE, SIG_IGN);
+ /*@=type@*/
toProg[0] = toProg[1] = 0;
(void) pipe(toProg);
@@ -2305,7 +2307,9 @@ top:
(void) close(toProg[1]);
if (fromProg[0] >= 0)
(void) close(fromProg[0]);
+ /*@-type@*/ /* FIX: cast? */
(void) signal(SIGPIPE, oldhandler);
+ /*@=type@*/
/* Collect status from prog */
(void)waitpid(progPID, &status, 0);
diff --git a/build/pack.c b/build/pack.c
index 9a7e9b714..fc238dd6c 100644
--- a/build/pack.c
+++ b/build/pack.c
@@ -141,7 +141,9 @@ static /*@only@*/ /*@null@*/ StringBuf addFileToTagAux(Spec spec,
sb = freeStringBuf(sb);
return NULL;
}
+ /*@-type@*/ /* FIX: cast? */
if ((f = fdGetFp(fd)) != NULL)
+ /*@=type@*/
while (fgets(buf, sizeof(buf), f)) {
/* XXX display fn in error msg */
if (expandMacros(spec, spec->macros, buf, sizeof(buf))) {
@@ -766,12 +768,14 @@ int packageBinaries(Spec spec)
memset(csa, 0, sizeof(*csa));
csa->cpioArchiveSize = 0;
+ /*@-type@*/ /* LCL: function typedefs */
csa->cpioFdIn = fdNew("init (packageBinaries)");
csa->cpioList = pkg->cpioList;
rc = writeRPM(&pkg->header, fn, RPMLEAD_BINARY,
csa, spec->passPhrase, NULL);
csa->cpioFdIn = fdFree(csa->cpioFdIn, "init (packageBinaries)");
+ /*@=type@*/
fn = _free(fn);
if (rc)
return rc;
@@ -803,12 +807,14 @@ int packageSources(Spec spec)
memset(csa, 0, sizeof(*csa));
csa->cpioArchiveSize = 0;
+ /*@-type@*/ /* LCL: function typedefs */
csa->cpioFdIn = fdNew("init (packageSources)");
csa->cpioList = spec->sourceCpioList;
rc = writeRPM(&spec->sourceHeader, fn, RPMLEAD_SOURCE,
csa, spec->passPhrase, &(spec->cookie));
csa->cpioFdIn = fdFree(csa->cpioFdIn, "init (packageSources)");
+ /*@=type@*/
fn = _free(fn);
}
return rc;
diff --git a/build/parseSpec.c b/build/parseSpec.c
index 67a7a87c1..1727b1d3c 100644
--- a/build/parseSpec.c
+++ b/build/parseSpec.c
@@ -203,7 +203,9 @@ retry:
/* Make sure we have something in the read buffer */
if (!(ofi->readPtr && *(ofi->readPtr))) {
+ /*@-type@*/ /* FIX: cast? */
FILE * f = fdGetFp(ofi->fd);
+ /*@=type@*/
if (f == NULL || !fgets(ofi->readBuf, BUFSIZ, f)) {
/* EOF */
if (spec->readStack->next) {
diff --git a/build/spec.c b/build/spec.c
index c515b6e3c..53a26e4ab 100644
--- a/build/spec.c
+++ b/build/spec.c
@@ -159,9 +159,9 @@ Package freePackage(Package pkg)
pkg->fileList = freeStringBuf(pkg->fileList);
pkg->fileFile = _free(pkg->fileFile);
if (pkg->cpioList) {
- TFI_t fi = pkg->cpioList;
+ void * fi = pkg->cpioList;
pkg->cpioList = NULL;
- freeFi(fi);
+/*@i@*/ freeFi((TFI_t)fi);
fi = _free(fi);
}
@@ -505,9 +505,9 @@ Spec freeSpec(Spec spec)
spec->sourceHeader = headerFree(spec->sourceHeader);
if (spec->sourceCpioList) {
- TFI_t fi = spec->sourceCpioList;
+ void * fi = spec->sourceCpioList;
spec->sourceCpioList = NULL;
- freeFi(fi);
+/*@i@*/ freeFi(fi);
fi = _free(fi);
}
diff --git a/lib/depends.c b/lib/depends.c
index 54172a533..44728e091 100644
--- a/lib/depends.c
+++ b/lib/depends.c
@@ -193,8 +193,10 @@ static void alFree(availableList al)
}
p->relocs = _free(p->relocs);
}
+ /*@-type@*/ /* FIX: cast? */
if (p->fd != NULL)
p->fd = fdFree(p->fd, "alAddPackage (alFree)");
+ /*@=type@*/
}
if (al->dirs != NULL)
@@ -398,7 +400,9 @@ alAddPackage(availableList al,
}
p->key = key;
+ /*@-type@*/ /* FIX: cast? */
p->fd = (fd != NULL ? fdLink(fd, "alAddPackage") : NULL);
+ /*@=type@*/
if (relocs) {
for (i = 0, r = relocs; r->oldPath || r->newPath; i++, r++)
@@ -933,9 +937,11 @@ rpmTransactionSet rpmtransFree(rpmTransactionSet ts)
ts->di = _free(ts->di);
ts->removedPackages = _free(ts->removedPackages);
ts->order = _free(ts->order);
+ /*@-type@*/ /* FIX: cast? */
if (ts->scriptFd != NULL)
ts->scriptFd =
fdFree(ts->scriptFd, "rpmtransSetScriptFd (rpmtransFree");
+ /*@=type@*/
ts->rootDir = _free(ts->rootDir);
ts->currDir = _free(ts->currDir);
diff --git a/lib/formats.c b/lib/formats.c
index 73c45d468..3e35628cf 100644
--- a/lib/formats.c
+++ b/lib/formats.c
@@ -591,6 +591,7 @@ static int groupTag(Header h, /*@out@*/ rpmTagType * type,
return i18nTag(h, RPMTAG_GROUP, type, data, count, freeData);
}
+/*@-type@*/ /* FIX: cast? */
const struct headerSprintfExtension_s rpmHeaderFormats[] = {
{ HEADER_EXT_TAG, "RPMTAG_GROUP", { groupTag } },
{ HEADER_EXT_TAG, "RPMTAG_DESCRIPTION", { descriptionTag } },
@@ -611,3 +612,4 @@ const struct headerSprintfExtension_s rpmHeaderFormats[] = {
{ HEADER_EXT_FORMAT, "triggertype", { triggertypeFormat } },
{ HEADER_EXT_MORE, NULL, { (void *) headerDefaultFormats } }
} ;
+/*@=type@*/
diff --git a/lib/fsm.c b/lib/fsm.c
index 8dd97ec4e..60ae1cfc8 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -478,7 +478,9 @@ int fsmSetup(FSM_t fsm, fileStage goal,
fsm->goal = goal;
if (cfd) {
+ /*@-type@*/ /* FIX: cast? */
fsm->cfd = fdLink(cfd, "persist (fsm)");
+ /*@=type@*/
pos = fdGetCpioPos(fsm->cfd);
fdSetCpioPos(fsm->cfd, 0);
}
@@ -486,10 +488,12 @@ int fsmSetup(FSM_t fsm, fileStage goal,
if (fsm->goal == FSM_PKGINSTALL) {
if (ts && ts->notify) {
+ /*@-type@*/ /* FIX: cast? */
/*@-noeffectuncon @*/ /* FIX: check rc */
(void)ts->notify(fi->h, RPMCALLBACK_INST_START, 0, fi->archiveSize,
(fi->ap ? fi->ap->key : NULL), ts->notifyData);
/*@=noeffectuncon @*/
+ /*@=type@*/
}
}
@@ -529,7 +533,9 @@ int fsmTeardown(FSM_t fsm) {
fsm->iter = mapFreeIterator(fsm->iter);
if (fsm->cfd) {
+ /*@-type@*/ /* FIX: cast? */
fsm->cfd = fdFree(fsm->cfd, "persist (fsm)");
+ /*@=type@*/
fsm->cfd = NULL;
}
fsm->failedFile = NULL;
@@ -857,10 +863,12 @@ static int writeFile(/*@special@*/ FSM_t fsm, int writeData)
TFI_t fi = fsmGetFi(fsm);
if (ts && ts->notify && fi) {
size_t size = (fdGetCpioPos(fsm->cfd) - pos);
+ /*@-type@*/ /* FIX: cast? */
/*@-noeffectuncon @*/ /* FIX: check rc */
(void)ts->notify(fi->h, RPMCALLBACK_INST_PROGRESS, size, size,
(fi->ap ? fi->ap->key : NULL), ts->notifyData);
/*@=noeffectuncon @*/
+ /*@=type@*/
}
}
@@ -1633,11 +1641,13 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break;
rpmTransactionSet ts = fsmGetTs(fsm);
TFI_t fi = fsmGetFi(fsm);
if (ts && ts->notify && fi) {
+ /*@-type@*/ /* FIX: cast? */
/*@-noeffectuncon @*/ /* FIX: check rc */
(void)ts->notify(fi->h, RPMCALLBACK_INST_PROGRESS,
fdGetCpioPos(fsm->cfd), fi->archiveSize,
(fi->ap ? fi->ap->key : NULL), ts->notifyData);
/*@=noeffectuncon @*/
+ /*@=type@*/
}
}
break;
diff --git a/lib/hdrinline.h b/lib/hdrinline.h
index 1374c4107..e7be8592d 100644
--- a/lib/hdrinline.h
+++ b/lib/hdrinline.h
@@ -1,3 +1,4 @@
+/*@-type@*/ /* FIX: cast to HV_t bogus */
#ifndef H_HDRINLINE
#define H_HDRINLINE
@@ -492,3 +493,4 @@ int headerNextIterator(HeaderIterator hi,
#endif
#endif /* H_HDRINLINE */
+/*@=type@*/
diff --git a/lib/header.c b/lib/header.c
index d72509a51..3b16425c6 100644
--- a/lib/header.c
+++ b/lib/header.c
@@ -1117,8 +1117,10 @@ Header headerRead(FD_t fd, enum hMagic magicp)
if (magicp == HEADER_MAGIC_YES)
i += 2;
+ /*@-type@*/ /* FIX: cast? */
if (timedRead(fd, (char *)block, i*sizeof(*block)) != (i * sizeof(*block)))
goto exit;
+ /*@=type@*/
i = 0;
@@ -1143,8 +1145,10 @@ Header headerRead(FD_t fd, enum hMagic magicp)
ei[1] = htonl(dl);
len -= sizeof(il) + sizeof(dl);
+ /*@-type@*/ /* FIX: cast? */
if (timedRead(fd, (char *)&ei[2], len) != len)
goto exit;
+ /*@=type@*/
h = headerLoad(ei);
@@ -2986,6 +2990,7 @@ static char * shescapeFormat(int_32 type, hPTR_t data,
return result;
}
+/*@-type@*/ /* FIX: cast? */
const struct headerSprintfExtension_s headerDefaultFormats[] = {
{ HEADER_EXT_FORMAT, "octal", { octalFormat } },
{ HEADER_EXT_FORMAT, "hex", { hexFormat } },
@@ -2994,6 +2999,7 @@ const struct headerSprintfExtension_s headerDefaultFormats[] = {
{ HEADER_EXT_FORMAT, "shescape", { shescapeFormat } },
{ HEADER_EXT_LAST, NULL, { NULL } }
};
+/*@=type@*/
/** \ingroup header
* Duplicate tag values from one header into another.
diff --git a/lib/header_internal.c b/lib/header_internal.c
index 30ea43e4f..309b453de 100644
--- a/lib/header_internal.c
+++ b/lib/header_internal.c
@@ -28,6 +28,7 @@ char ** headerGetLangs(Header h)
/*@-nullret@*/ return table; /*@=nullret@*/ /* LCL: double indirection? */
}
+/*@-type@*/ /* FIX: shrug */
void headerDump(Header h, FILE *f, int flags,
const struct headerTagTableEntry_s * tags)
{
@@ -165,4 +166,5 @@ void headerDump(Header h, FILE *f, int flags,
p++;
}
}
+/*@=type@*/
/*@=sizeoftype@*/
diff --git a/lib/header_internal.h b/lib/header_internal.h
index d6fd351fb..913b8730a 100644
--- a/lib/header_internal.h
+++ b/lib/header_internal.h
@@ -161,9 +161,11 @@ int headerGetRawEntry(Header h, int_32 tag,
* @param h header
* @return no. of references
*/
+/*@-type@*/ /* FIX: cast? */
/*@unused@*/ static inline int headerUsageCount(Header h) /*@*/ {
return h->nrefs;
}
+/*@=type@*/
/** \ingroup header
* Dump a header in human readable format (for debugging).
diff --git a/lib/manifest.c b/lib/manifest.c
index 2ffb6e6c6..fb3822bdc 100644
--- a/lib/manifest.c
+++ b/lib/manifest.c
@@ -67,7 +67,9 @@ int rpmReadPackageManifest(FD_t fd, int * argcPtr, const char *** argvPtr)
const char ** av = NULL;
int argc = (argcPtr ? *argcPtr : 0);
const char ** argv = (argvPtr ? *argvPtr : NULL);
+ /*@-type@*/ /* FIX: cast? */
FILE * f = fdGetFp(fd);
+ /*@=type@*/
int rc = 0;
int i;
diff --git a/lib/misc.c b/lib/misc.c
index 44ecdbaf1..197973cec 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -461,11 +461,13 @@ static void doBuildFileList(Header h, /*@out@*/ const char *** fileListPtr,
fileNames = xmalloc(size);
data = ((char *) fileNames) + (sizeof(*fileNames) * count);
+ /*@-branchstate@*/
for (i = 0; i < count; i++) {
fileNames[i] = data;
data = stpcpy( stpcpy(data, dirNames[dirIndexes[i]]), baseNames[i]);
*data++ = '\0';
}
+ /*@=branchstate@*/
baseNames = hfd(baseNames, bnt);
dirNames = hfd(dirNames, dnt);
diff --git a/lib/poptBT.c b/lib/poptBT.c
index 4ec6981ce..885723da8 100644
--- a/lib/poptBT.c
+++ b/lib/poptBT.c
@@ -127,11 +127,13 @@ static void buildArgCallback( /*@unused@*/ poptContext con,
/**
*/
-/*@-bitwisesigned -compmempass@*/
+/*@-bitwisesigned -compmempass @*/
/*@unchecked@*/
struct poptOption rpmBuildPoptTable[] = {
+/*@-type@*/ /* FIX: cast? */
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA,
buildArgCallback, 0, NULL, NULL },
+/*@=type@*/
{ "bp", 0, POPT_ARGFLAG_ONEDASH, 0, POPT_BP,
N_("build through %prep (unpack sources and apply patches) from <specfile>"),
@@ -218,4 +220,4 @@ struct poptOption rpmBuildPoptTable[] = {
POPT_TABLEEND
};
-/*@=bitwisesigned =compmempass@*/
+/*@=bitwisesigned =compmempass @*/
diff --git a/lib/poptI.c b/lib/poptI.c
index 8d99f1dbf..69c901882 100644
--- a/lib/poptI.c
+++ b/lib/poptI.c
@@ -87,11 +87,13 @@ static void installArgCallback( /*@unused@*/ poptContext con,
/**
*/
-/*@-bitwisesigned -compmempass@*/
+/*@-bitwisesigned -compmempass @*/
/*@unchecked@*/
struct poptOption rpmInstallPoptTable[] = {
+/*@-type@*/ /* FIX: cast? */
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA,
installArgCallback, 0, NULL, NULL },
+/*@=type@*/
{ "allfiles", '\0', POPT_BIT_SET,
&rpmIArgs.transFlags, RPMTRANS_FLAG_ALLFILES,
@@ -220,4 +222,4 @@ struct poptOption rpmInstallPoptTable[] = {
POPT_TABLEEND
};
-/*@=bitwisesigned =compmempass@*/
+/*@=bitwisesigned =compmempass @*/
diff --git a/lib/poptK.c b/lib/poptK.c
index 942cb6098..167c640b4 100644
--- a/lib/poptK.c
+++ b/lib/poptK.c
@@ -48,8 +48,10 @@ static void signArgCallback( /*@unused@*/ poptContext con,
*/
/*@unchecked@*/
struct poptOption rpmSignPoptTable[] = {
+/*@-type@*/ /* FIX: cast? */
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA,
signArgCallback, 0, NULL, NULL },
+/*@=type@*/
{ "addsign", '\0', 0, 0, POPT_ADDSIGN,
N_("add a signature to a package"), NULL },
{ "resign", '\0', 0, 0, POPT_RESIGN,
diff --git a/lib/poptQV.c b/lib/poptQV.c
index d8f07746f..e7d106ce4 100644
--- a/lib/poptQV.c
+++ b/lib/poptQV.c
@@ -70,8 +70,10 @@ static void rpmQVSourceArgCallback( /*@unused@*/ poptContext con,
*/
/*@unchecked@*/
struct poptOption rpmQVSourcePoptTable[] = {
+/*@-type@*/ /* FIX: cast? */
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA,
rpmQVSourceArgCallback, 0, NULL, NULL },
+/*@=type@*/
{ "all", 'a', 0, 0, 'a',
N_("query/verify all packages"), NULL },
{ "file", 'f', 0, 0, 'f',
@@ -150,8 +152,10 @@ static void queryArgCallback(/*@unused@*/poptContext con,
*/
/*@unchecked@*/
struct poptOption rpmQueryPoptTable[] = {
+/*@-type@*/ /* FIX: cast? */
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA,
queryArgCallback, 0, NULL, NULL },
+/*@=type@*/
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQVSourcePoptTable, 0,
NULL, NULL },
{ "configfiles", 'c', 0, 0, 'c',
diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c
index 8e2a5782e..24b857d20 100644
--- a/lib/rpmchecksig.c
+++ b/lib/rpmchecksig.c
@@ -58,8 +58,10 @@ static int manageFile(FD_t *fdp, const char **fnp, int flags,
}
if (fnp)
*fnp = fn;
+ /*@-type@*/ /* FIX: cast? */
*fdp = fdLink(fd, "manageFile return");
fdFree(fd, "manageFile return");
+ /*@=type@*/
return 0;
}
@@ -86,14 +88,18 @@ static int copyFile(FD_t *sfdp, const char **sfnp,
if (manageFile(tfdp, tfnp, O_WRONLY|O_CREAT|O_TRUNC, 0))
goto exit;
+ /*@-type@*/ /* FIX: cast? */
if (dig != NULL) {
dig->md5ctx = rpmDigestInit(RPMDIGEST_MD5);
(void) fdInitSHA1(*sfdp, 0);
}
+ /*@=type@*/
while ((count = Fread(buffer, sizeof(buffer[0]), sizeof(buffer), *sfdp)) > 0) {
+ /*@-type@*/ /* FIX: cast? */
if (dig)
rpmDigestUpdate(dig->md5ctx, buffer, count);
+ /*@=type@*/
if (Fwrite(buffer, sizeof(buffer[0]), count, *tfdp) != count) {
rpmError(RPMERR_FWRITE, _("%s: Fwrite failed: %s\n"), *tfnp,
@@ -106,11 +112,13 @@ static int copyFile(FD_t *sfdp, const char **sfnp,
goto exit;
}
+ /*@-type@*/ /* FIX: cast? */
if (dig != NULL) {
dig->sha1ctx = _free(dig->sha1ctx);
dig->sha1ctx = (*sfdp)->digest;
(*sfdp)->digest = NULL;
}
+ /*@=type@*/
rc = 0;
@@ -345,6 +353,7 @@ int rpmCheckSig(rpmCheckSigFlags flags, const char ** argv)
if (rpmIsVerbose())
fprintf(stderr, "========================= Package RSA Signature\n");
(void) pgpPrtPkts(ptr, count, dig, rpmIsVerbose());
+ /*@-type@*/ /* FIX: cast? */
{ DIGEST_CTX ctx = rpmDigestDup(dig->md5ctx);
rpmDigestUpdate(ctx, &dig->sig.v3.sigtype, dig->sig.v3.hashlen);
@@ -352,6 +361,7 @@ fprintf(stderr, "========================= Package RSA Signature\n");
/* XXX compare leading 16 bits of digest for quick check. */
}
+ /*@=type@*/
/* XXX retrieve by keyid from signature. */
if (pgppk == NULL) {
(void) b64decode(redhatPubKeyRSA, (void **)&pgppk, &pgppklen);
@@ -388,11 +398,13 @@ fprintf(stderr, "========================= Red Hat RSA Public Key\n");
if (rpmIsVerbose())
fprintf(stderr, "========================= Package DSA Signature\n");
(void) pgpPrtPkts(ptr, count, dig, rpmIsVerbose());
+ /*@-type@*/ /* FIX: cast? */
{ DIGEST_CTX ctx = rpmDigestDup(dig->sha1ctx);
rpmDigestUpdate(ctx, &dig->sig.v3.sigtype, dig->sig.v3.hashlen);
rpmDigestFinal(ctx, (void **)&dig->sha1, &dig->sha1len, 1);
mp32nzero(&dig->hm); mp32nsethex(&dig->hm, dig->sha1);
}
+ /*@=type@*/
/* XXX retrieve by keyid from signature. */
if (gpgpk == NULL) {
(void) b64decode(redhatPubKeyDSA, (void **)&gpgpk, &gpgpklen);
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
index 33318a0c4..f754c9e5e 100644
--- a/lib/rpminstall.c
+++ b/lib/rpminstall.c
@@ -92,13 +92,17 @@ void * rpmShowProgress(/*@null@*/ const void * arg,
if (filename == NULL || filename[0] == '\0')
return NULL;
fd = Fopen(filename, "r.ufdio");
+ /*@-type@*/ /* FIX: still necessary? */
if (fd)
fd = fdLink(fd, "persist (showProgress)");
+ /*@=type@*/
return fd;
/*@notreached@*/ break;
case RPMCALLBACK_INST_CLOSE_FILE:
+ /*@-type@*/ /* FIX: still necessary? */
fd = fdFree(fd, "persist (showProgress)");
+ /*@=type@*/
if (fd) {
(void) Fclose(fd);
fd = NULL;
diff --git a/lib/rpmlead.c b/lib/rpmlead.c
index ddc77445d..9a19e8b4b 100644
--- a/lib/rpmlead.c
+++ b/lib/rpmlead.c
@@ -45,11 +45,13 @@ int writeLead(FD_t fd, const struct rpmlead *lead)
int readLead(FD_t fd, struct rpmlead *lead)
{
memset(lead, 0, sizeof(*lead));
+ /*@-type@*/ /* FIX: remove timed read */
if (timedRead(fd, (char *)lead, sizeof(*lead)) != sizeof(*lead)) {
rpmError(RPMERR_READ, _("read failed: %s (%d)\n"), Fstrerror(fd),
errno);
return 1;
}
+ /*@=type@*/
lead->type = ntohs(lead->type);
lead->archnum = ntohs(lead->archnum);
diff --git a/lib/signature.c b/lib/signature.c
index 751c2b015..4a81ed6a4 100644
--- a/lib/signature.c
+++ b/lib/signature.c
@@ -161,8 +161,10 @@ rpmRC rpmReadSignature(FD_t fd, Header * headerp, sigType sig_type)
case RPMSIGTYPE_PGP262_1024:
rpmMessage(RPMMESS_DEBUG, _("Old PGP signature\n"));
/* These are always 256 bytes */
+ /*@-type@*/ /* FIX: eliminate timedRead @*/
if (timedRead(fd, buf, 256) != 256)
break;
+ /*@=type@*/
h = headerNew();
(void) headerAddEntry(h, RPMSIGTAG_PGP, RPM_BIN_TYPE, buf, 152);
rc = RPMRC_OK;
@@ -193,8 +195,10 @@ rpmRC rpmReadSignature(FD_t fd, Header * headerp, sigType sig_type)
break;
rc = checkSize(fd, sigSize, pad, *archSize);
}
+ /*@-type@*/ /* FIX: eliminate timedRead @*/
if (pad && timedRead(fd, buf, pad) != pad)
rc = RPMRC_SHORTREAD;
+ /*@=type@*/
break;
default:
break;
@@ -318,7 +322,9 @@ static int makePGPSignature(const char * file, /*@out@*/ void ** sig,
int rc = 0;
fd = Fopen(sigfile, "r.fdio");
if (fd != NULL && !Ferror(fd)) {
+ /*@-type@*/ /* FIX: eliminate timedRead @*/
rc = timedRead(fd, *sig, *size);
+ /*@=type@*/
if (sigfile) (void) unlink(sigfile);
(void) Fclose(fd);
}
@@ -402,7 +408,9 @@ static int makeGPGSignature(const char * file, /*@out@*/ void ** sig,
int rc = 0;
fd = Fopen(sigfile, "r.fdio");
if (fd != NULL && !Ferror(fd)) {
+ /*@-type@*/ /* FIX: eliminate timedRead @*/
rc = timedRead(fd, *sig, *size);
+ /*@=type@*/
if (sigfile) (void) unlink(sigfile);
(void) Fclose(fd);
}
@@ -537,6 +545,7 @@ verifyPGPSignature(const char * datafile, const byte * sig, int count,
pgpVersion pgpVer;
int rc;
+/*@-type@*/
rc = rsavrfy(&dig->rsa_pk, &dig->rsahm, &dig->c);
if (rc == 0 || rpmIsVerbose()) {
@@ -549,6 +558,7 @@ fprintf(stderr, "=============================== RSA verify %s: rc %d\n",
printf("\t c = "); (void)fflush(stdout); mp32println(dig->c.size, dig->c.data);
printf("\t m = "); (void)fflush(stdout); mp32println(dig->rsahm.size, dig->rsahm.data);
}
+/*@=type@*/
/* What version do we have? */
if ((path = rpmDetectPGPVersion(&pgpVer)) == NULL) {
@@ -680,6 +690,7 @@ verifyGPGSignature(const char * datafile, const byte * sig, int count,
int res = RPMSIG_OK;
int rc;
+/*@-type@*/
rc = dsavrfy(&dig->p, &dig->q, &dig->g, &dig->hm,
&dig->y, &dig->r, &dig->s);
@@ -696,6 +707,7 @@ fprintf(stderr, "=============================== DSA verify %s: rc %d\n",
printf("\t s = "); (void)fflush(stdout); mp32println(dig->s.size, dig->s.data);
printf("\thm = "); (void)fflush(stdout); mp32println(dig->hm.size, dig->hm.data);
}
+/*@=type@*/
/* Write out the signature */
#ifdef DYING
diff --git a/lib/transaction.c b/lib/transaction.c
index 43420ddf3..125125a40 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -99,7 +99,9 @@ static /*@null@*/ void * freeFl(rpmTransactionSet ts,
void rpmtransSetScriptFd(rpmTransactionSet ts, FD_t fd)
{
+ /*@-type@*/ /* FIX: cast? */
ts->scriptFd = (fd ? fdLink(fd, "rpmtransSetScriptFd") : NULL);
+ /*@=type@*/
}
int rpmtransGetKeys(const rpmTransactionSet ts, const void *** ep, int * nep)
@@ -1409,7 +1411,7 @@ static void skipFiles(const rpmTransactionSet ts, TFI_t fi)
*/
if (fi->flangs && languages && *fi->flangs[i]) {
const char **lang, *l, *le;
- for (lang = languages; *lang != '\0'; lang++) {
+ for (lang = languages; *lang != NULL; lang++) {
if (!strcmp(*lang, "all"))
/*@innerbreak@*/ break;
for (l = fi->flangs[i]; *l != '\0'; l = le) {
diff --git a/lib/verify.c b/lib/verify.c
index e2d5254d4..0f55fcf2e 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -284,8 +284,10 @@ int rpmVerifyScript(const char * rootDir, Header h, /*@null@*/ FD_t scriptFd)
PSM_t psm = &psmbuf;
int rc;
+ /*@-type@*/ /* FIX: cast? */
if (scriptFd != NULL)
ts->scriptFd = fdLink(scriptFd, "rpmVerifyScript");
+ /*@=type@*/
fi->magic = TFIMAGIC;
loadFi(h, fi);
memset(psm, 0, sizeof(*psm));
@@ -369,7 +371,9 @@ static int verifyHeader(QVA_t qva, Header h)
int count;
int_32 * fileFlags = NULL;
rpmVerifyAttrs verifyResult = 0;
+ /*@-type@*/ /* FIX: union? */
rpmVerifyAttrs omitMask = ((qva->qva_flags & VERIFY_ATTRS) ^ VERIFY_ATTRS);
+ /*@=type@*/
int ec = 0; /* assume no problems */
int i;
@@ -488,6 +492,7 @@ static int verifyDependencies(rpmdb db, Header h)
int nb = 512;
(void) headerNVR(h, &n, &v, &r);
+ /*@-type@*/ /* FIX: rpmDependencyConflict usage */
for (i = 0; i < numConflicts; i++) {
nb += strlen(conflicts[i].needsName) + sizeof(", ") - 1;
if (conflicts[i].needsFlags)
@@ -511,6 +516,8 @@ static int verifyDependencies(rpmdb db, Header h)
}
}
conflicts = rpmdepFreeConflicts(conflicts, numConflicts);
+ /*@=type@*/
+
if (te > t) {
*te++ = '\n';
*te = '\0';
diff --git a/popt/popt.h b/popt/popt.h
index 436f9f4f5..bb6a867b6 100644
--- a/popt/popt.h
+++ b/popt/popt.h
@@ -9,10 +9,6 @@
#ifndef H_POPT
#define H_POPT
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdio.h> /* for FILE * */
#define POPT_OPTION_DEPTH 10
@@ -184,6 +180,11 @@ enum poptCallbackReason { POPT_CALLBACK_REASON_PRE,
POPT_CALLBACK_REASON_POST,
POPT_CALLBACK_REASON_OPTION };
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*@-type@*/
+
/** \ingroup popt
* Table callback prototype.
* @param con context
@@ -437,6 +438,7 @@ int poptStrippedArgv(poptContext con, int argc, char ** argv)
/*@modifies *argv @*/;
/*@=fcnuse@*/
+/*@=type@*/
#ifdef __cplusplus
}
#endif
diff --git a/popt/poptconfig.c b/popt/poptconfig.c
index bc902d4e7..e553f86de 100644
--- a/popt/poptconfig.c
+++ b/popt/poptconfig.c
@@ -13,7 +13,9 @@
static void configLine(poptContext con, char * line)
/*@modifies con @*/
{
+ /*@-type@*/
int nameLength = strlen(con->appName);
+ /*@=type@*/
const char * entryType;
const char * opt;
poptItem item = alloca(sizeof(*item));
@@ -21,7 +23,10 @@ static void configLine(poptContext con, char * line)
memset(item, 0, sizeof(*item));
+ /*@-type@*/
if (strncmp(line, con->appName, nameLength)) return;
+ /*@=type@*/
+
line += nameLength;
if (*line == '\0' || !isspace(*line)) return;
@@ -151,7 +156,9 @@ int poptReadDefaultConfig(poptContext con, /*@unused@*/ int useEnv) {
char * fn, * home;
int rc;
+ /*@-type@*/
if (!con->appName) return 0;
+ /*@=type@*/
rc = poptReadConfigFile(con, "/etc/popt");
if (rc) return rc;
diff --git a/popt/popthelp.c b/popt/popthelp.c
index 853f5299a..e2e2eef9a 100644
--- a/popt/popthelp.c
+++ b/popt/popthelp.c
@@ -1,5 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/*@-type@*/
/** \ingroup popt
* \file popt/popthelp.c
*/
@@ -650,3 +651,4 @@ void poptSetOtherOptionHelp(poptContext con, const char * text)
con->otherHelp = _free(con->otherHelp);
con->otherHelp = xstrdup(text);
}
+/*@=type@*/
diff --git a/rpmdb/db1.c b/rpmdb/db1.c
index 08b181e12..d9a3eabf1 100644
--- a/rpmdb/db1.c
+++ b/rpmdb/db1.c
@@ -1,3 +1,4 @@
+/*@-type@*/ /* FIX: shrug */
/** \ingroup db1
* \file rpmdb/db1.c
*/
@@ -620,3 +621,4 @@ struct _dbiVec db1vec = {
db1ccount, db1byteswapped, db1stat
};
/*@=exportheadervar@*/
+/*@=type@*/
diff --git a/rpmdb/db3.c b/rpmdb/db3.c
index 671ff2683..0c30147d9 100644
--- a/rpmdb/db3.c
+++ b/rpmdb/db3.c
@@ -1,3 +1,4 @@
+/*@-type@*/ /* FIX: annotate db3 methods */
/** \ingroup db3
* \file rpmdb/db3.c
*/
@@ -1229,3 +1230,4 @@ struct _dbiVec db3vec = {
db3ccount, db3byteswapped, db3stat
};
/*@=exportheadervar@*/
+/*@=type@*/
diff --git a/rpmdb/falloc.c b/rpmdb/falloc.c
index 117d19500..021249ebb 100644
--- a/rpmdb/falloc.c
+++ b/rpmdb/falloc.c
@@ -60,7 +60,9 @@ FD_t fadOpen(const char * path, int flags, mode_t perms)
if (flags & O_WRONLY)
return NULL;
+ /*@-type@*/ /* FIX: cast? */
fd = ufdio->_open(path, flags, perms);
+ /*@=type@*/
if (Ferror(fd))
/* XXX Fstrerror */
return NULL;
diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c
index 0eab91a40..4c1640646 100644
--- a/rpmdb/rpmdb.c
+++ b/rpmdb/rpmdb.c
@@ -1796,7 +1796,9 @@ int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTag tag,
case RPMMIRE_STRCMP:
break;
case RPMMIRE_REGEX:
+ /*@-type@*/
preg = xcalloc(1, sizeof(*preg));
+ /*@=type@*/
cflags = (REG_EXTENDED | REG_NOSUB);
rc = regcomp(preg, allpat, cflags);
if (rc) {
diff --git a/rpmio/digest.c b/rpmio/digest.c
index 06d5ac394..4c51914ee 100644
--- a/rpmio/digest.c
+++ b/rpmio/digest.c
@@ -55,9 +55,11 @@ rpmDigestInit(rpmDigestFlags flags)
/*@-sizeoftype@*/ /* FIX: union, not void pointer */
ctx->param = xcalloc(1, sizeof(md5Param));
/*@=sizeoftype@*/
+ /*@-type@*/ /* FIX: cast? */
ctx->Reset = (void *) md5Reset;
ctx->Update = (void *) md5Update;
ctx->Digest = (void *) md5Digest;
+ /*@=type@*/
}
if (flags & RPMDIGEST_SHA1) {
@@ -66,9 +68,11 @@ rpmDigestInit(rpmDigestFlags flags)
/*@-sizeoftype@*/ /* FIX: union, not void pointer */
ctx->param = xcalloc(1, sizeof(sha1Param));
/*@=sizeoftype@*/
+ /*@-type@*/ /* FIX: cast? */
ctx->Reset = (void *) sha1Reset;
ctx->Update = (void *) sha1Update;
ctx->Digest = (void *) sha1Digest;
+ /*@=type@*/
}
/*@-noeffectuncon@*/ /* FIX: check rc */
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
index e6014a401..fbfe0858e 100644
--- a/rpmio/rpmio.c
+++ b/rpmio/rpmio.c
@@ -1,3 +1,4 @@
+/*@-type@*/ /* LCL: function typedefs */
/** \ingroup rpmio
* \file rpmio/rpmio.c
*/
@@ -3063,3 +3064,4 @@ static struct FDIO_s fpio_s = {
ufdOpen, NULL, fdGetFp, NULL, Mkdir, Chdir, Rmdir, Rename, Unlink
};
FDIO_t fpio = /*@-compmempass@*/ &fpio_s /*@=compmempass@*/ ;
+/*@=type@*/
diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c
index d608fd9e8..a9c7f262a 100644
--- a/rpmio/rpmpgp.c
+++ b/rpmio/rpmpgp.c
@@ -808,7 +808,9 @@ printf("\t y = "), mp32println(_dig->y.size, _dig->y.data);
/*@innerbreak@*/ break;
case 0x03:
pgpPrtVal(" iterated/salted ", pgpHashTbl, p[2]);
+ /*@-shiftsigned@*/ /* FIX: unsigned cast */
i = (16 + (p[11] & 0xf)) << ((p[11] >> 4) + 6);
+ /*@=shiftsigned@*/
pgpPrtHex("", p+3, 8);
pgpPrtInt(" iter", i);
p += 11;
diff --git a/rpmio/rpmpgp.h b/rpmio/rpmpgp.h
index e2de75395..fb5f2b5da 100644
--- a/rpmio/rpmpgp.h
+++ b/rpmio/rpmpgp.h
@@ -914,7 +914,7 @@ int pgpLen(const byte *s, /*@out@*/ unsigned int *lenp)
(*lenp) = *s++;
return 1;
} else if (*s < 255) {
- (*lenp) = ((s[0] - 192) << 8) + s[1] + 192;
+ (*lenp) = ((((unsigned)s[0]) - 192) << 8) + s[1] + 192;
return 2;
} else {
(*lenp) = pgpGrab(s+1, 4);
diff --git a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c
index 4ddf79771..2d5fa1901 100644
--- a/rpmio/rpmrpc.c
+++ b/rpmio/rpmrpc.c
@@ -1,3 +1,4 @@
+/*@-type@*/ /* LCL: function typedefs */
/** \ingroup rpmio
* \file rpmio/rpmrpc.c
*/
@@ -1230,3 +1231,4 @@ fprintf(stderr, "*** Closedir(%p)\n", (void *)dir);
return closedir(dir);
}
/*@=voidabstract@*/
+/*@=type@*/
diff --git a/rpmio/url.c b/rpmio/url.c
index 3d9393173..f2775e1a2 100644
--- a/rpmio/url.c
+++ b/rpmio/url.c
@@ -1,3 +1,4 @@
+/*@-type@*/ /* LCL: function typedefs */
/** \ingroup rpmio
* \file rpmio/url.c
*/
@@ -547,3 +548,4 @@ exit:
return rc;
}
+/*@=type@*/
diff --git a/rpmqv.c b/rpmqv.c
index 5fc675f63..0d64cb0be 100755
--- a/rpmqv.c
+++ b/rpmqv.c
@@ -384,8 +384,10 @@ int main(int argc, const char ** argv)
/* XXX Eliminate query linkage loop */
specedit = 0;
+ /*@-type@*/ /* FIX: casts? */
parseSpecVec = parseSpec;
freeSpecVec = freeSpec;
+ /*@=type@*/
/* set up the correct locale */
(void) setlocale(LC_ALL, "" );