From 9f45bcd3ecf3f3548ed7a8490b882a6ca9ffeb94 Mon Sep 17 00:00:00 2001 From: jbj Date: Tue, 16 Oct 2001 14:58:57 +0000 Subject: [PATCH] More lclint annotations. CVS patchset: 5116 CVS date: 2001/10/16 14:58:57 --- .lclintrc | 9 +- beecrypt/beecrypt.c | 2 + beecrypt/blowfish.c | 6 +- beecrypt/dhaes.c | 2 + beecrypt/dldp.c | 14 +- beecrypt/dsa.c | 8 +- beecrypt/elgamal.c | 8 +- beecrypt/entropy.c | 34 +++-- beecrypt/fips180.c | 2 + beecrypt/fips186.c | 2 + beecrypt/hmacmd5.c | 2 + beecrypt/hmacsha1.c | 2 + beecrypt/hmacsha256.c | 2 + beecrypt/md5.c | 2 + beecrypt/memchunk.c | 2 +- beecrypt/mp32barrett.c | 2 + beecrypt/mp32number.c | 2 + beecrypt/mtprng.c | 2 + beecrypt/rsa.c | 6 +- beecrypt/rsakp.c | 10 +- beecrypt/rsapk.c | 2 +- beecrypt/sha256.c | 2 + build/expression.c | 4 +- build/files.c | 12 +- build/myftw.c | 2 +- build/pack.c | 2 + build/parsePreamble.c | 18 ++- build/parseSpec.c | 5 +- build/reqprov.c | 15 +- build/spec.c | 4 +- lib/Makefile.am | 4 +- lib/depends.c | 58 ++++---- lib/formats.c | 20 +-- lib/fsm.c | 13 +- lib/getdate.c | 4 +- lib/hdrinline.h | 6 + lib/header.c | 2 + lib/header_internal.c | 2 + lib/misc.c | 45 +++--- lib/package.c | 6 +- lib/psm.c | 182 ++++++++++++----------- lib/query.c | 5 +- lib/rpmlead.c | 2 + lib/rpmrc.c | 6 +- lib/signature.c | 12 +- lib/stringbuf.c | 2 +- lib/transaction.c | 94 ++++++------ lib/verify.c | 7 +- po/rpm.pot | 392 ++++++++++++++++++++++++------------------------- popt/po/popt.pot | 24 +-- popt/popt.c | 22 ++- rpmdb/db3.c | 43 ++++-- rpmdb/dbconfig.c | 13 ++ rpmdb/falloc.c | 8 + rpmdb/fprint.c | 5 +- rpmdb/rpmdb.c | 43 +++--- rpmio/digest.c | 12 ++ rpmio/macro.c | 4 +- rpmio/rpmio.c | 26 +++- rpmio/rpmlog.c | 2 + system.h | 9 -- 61 files changed, 705 insertions(+), 553 deletions(-) diff --git a/.lclintrc b/.lclintrc index c8e67f6..539f9cd 100644 --- a/.lclintrc +++ b/.lclintrc @@ -1,7 +1,7 @@ -I. -I./build -I./lib -I./rpmdb -I./rpmio -I./beecrypt -I./popt -I/usr/lib/gcc-lib/i386-redhat-linux/2.96/include -DHAVE_CONFIG_H -D_GNU_SOURCE -D_REENTRANT -DHAVE_DEV_DSP -DHAVE_SYS_SOUNDCARD #+partial -+forcehints +#+forcehints -warnunixlib -warnposix @@ -28,15 +28,14 @@ -matchfields # heartburn -mods # 281 occurences, errno will be a pita -namechecks # tedious ANSI compliance checks --noeffectuncon # 228 occurences, HGE_t needs special annotations -numenummembers 1024 # RPMTAG has 138 members -numstructfields 256 # Java jni.h has 229 fields -ptrarith # tedious --sizeoftype # ~240 occurences, tedium, more +#-sizeoftype # ~240 occurences, tedium, more -strictops -strictusereleased -stringliterallen 4096 # redhat*PubKey's are big --usedef # 303 occurences, HGE_t needs special annotations +-usedef # 303 occurences, HGE_t needs work -whileblock # tedious # --- random anal-retentive parameters @@ -45,8 +44,6 @@ #+internalglobnoglobs # ??? #+modglobsunchecked # 73 occurences #+warnmissingglobsnomods # ??? -#+impcheckedstrictglobs # 358 occurences -#+impcheckedstrictstatics # 1057 occurences #+strictbranchstate #+strictdestroy #+ansi-reserved-internal diff --git a/beecrypt/beecrypt.c b/beecrypt/beecrypt.c index d287628..c888cfa 100644 --- a/beecrypt/beecrypt.c +++ b/beecrypt/beecrypt.c @@ -1,3 +1,4 @@ +/*@-sizeoftype@*/ /** * \file beecrypt.c * @@ -846,3 +847,4 @@ BOOL WINAPI DllMain(HINSTANCE hInst, DWORD wDataSeg, LPVOID lpReserved) return TRUE; } #endif +/*@=sizeoftype@*/ diff --git a/beecrypt/blowfish.c b/beecrypt/blowfish.c index 9203ed1..7eaec7a 100644 --- a/beecrypt/blowfish.c +++ b/beecrypt/blowfish.c @@ -324,7 +324,9 @@ static const blockMode blowfishModes[2] = { /* CBC */ (blockModeEncrypt) blowfishCBCEncrypt, (blockModeDecrypt) blowfishCBCDecrypt } }; +/*@-sizeoftype@*/ const blockCipher blowfish = { "Blowfish", sizeof(blowfishParam), 8, 64, 448, 32, (blockCipherSetup) blowfishSetup, (blockCipherSetIV) blowfishSetIV, (blockCipherEncrypt) blowfishEncrypt, (blockCipherDecrypt) blowfishDecrypt, blowfishModes }; +/*@=sizeoftype@*/ int blowfishSetup(blowfishParam* bp, const uint32* key, int keybits, /*@unused@*/ cipherOperation op) { @@ -336,8 +338,8 @@ int blowfishSetup(blowfishParam* bp, const uint32* key, int keybits, /*@unused@* uint32 work[2]; - memcpy(p, _bf_p, BLOWFISHPSIZE * sizeof(uint32)); - memcpy(s, _bf_s, 1024 * sizeof(uint32)); + memcpy(p, _bf_p, BLOWFISHPSIZE * sizeof(*p)); + memcpy(s, _bf_s, 1024 * sizeof(*s)); if ((keybits & 31) == 0) { diff --git a/beecrypt/dhaes.c b/beecrypt/dhaes.c index 98e6ea9..da4bd0b 100644 --- a/beecrypt/dhaes.c +++ b/beecrypt/dhaes.c @@ -327,7 +327,9 @@ memchunk* dhaes_pContextDecrypt(dhaes_pContext* ctxt, const mp32number* ephemera goto decrypt_end; /* decrypt the memchunk with CBC mode */ + /*@-sizeoftype@*/ paddedtext = (memchunk*) calloc(1, sizeof(memchunk)); + /*@=sizeoftype@*/ if (paddedtext == (memchunk*) 0) goto decrypt_end; diff --git a/beecrypt/dldp.c b/beecrypt/dldp.c index 79e6b9c..b8c6bd1 100644 --- a/beecrypt/dldp.c +++ b/beecrypt/dldp.c @@ -100,7 +100,7 @@ static int dldp_pValidate(const dldp_p* dp, randomGeneratorContext* rgc) /*@*/ { register uint32 size = dp->p.size; - register uint32* temp = (uint32*) malloc((8*size+2) * sizeof(uint32)); + register uint32* temp = (uint32*) malloc((8*size+2) * sizeof(*temp)); if (temp) { @@ -185,7 +185,7 @@ int dldp_pgoqMake(dldp_p* dp, randomGeneratorContext* rgc, uint32 psize, uint32 * Generate parameters as described by IEEE P1363, A.16.1 */ - register uint32* temp = (uint32*) malloc((8*psize+2) * sizeof(uint32)); + register uint32* temp = (uint32*) malloc((8*psize+2) * sizeof(*temp)); if (temp) { @@ -221,7 +221,7 @@ int dldp_pgoqMakeSafe(dldp_p* dp, randomGeneratorContext* rgc, uint32 psize) * */ - register uint32* temp = (uint32*) malloc((8*psize+2) * sizeof(uint32)); + register uint32* temp = (uint32*) malloc((8*psize+2) * sizeof(*temp)); if (temp) { @@ -280,7 +280,7 @@ int dldp_pgoqGenerator_w(dldp_p* dp, randomGeneratorContext* rgc, uint32* wksp) int dldp_pgoqGenerator(dldp_p* dp, randomGeneratorContext* rgc) { register uint32 size = dp->p.size; - register uint32* temp = (uint32*) malloc((4*size+2)*sizeof(uint32)); + register uint32* temp = (uint32*) malloc((4*size+2) * sizeof(*temp)); if (temp) { @@ -315,7 +315,7 @@ int dldp_pgonMake(dldp_p* dp, randomGeneratorContext* rgc, uint32 psize, uint32 * Generate parameters with a prime p such that p = qr+1, with q prime, and r = 2s, with s prime */ - register uint32* temp = (uint32*) malloc((8*psize+2) * sizeof(uint32)); + register uint32* temp = (uint32*) malloc((8*psize+2) * sizeof(*temp)); if (temp) { @@ -348,7 +348,7 @@ int dldp_pgonMakeSafe(dldp_p* dp, randomGeneratorContext* rgc, uint32 psize) * Generate parameters with a safe prime; i.e. p = 2q+1, where q is prime */ - register uint32* temp = (uint32*) malloc((8*psize+2) * sizeof(uint32)); + register uint32* temp = (uint32*) malloc((8*psize+2) * sizeof(*temp)); if (temp) { @@ -446,7 +446,7 @@ int dldp_pgonGenerator_w(dldp_p* dp, randomGeneratorContext* rgc, uint32* wksp) int dldp_pgonGenerator(dldp_p* dp, randomGeneratorContext* rgc) { register uint32 psize = dp->p.size; - register uint32* temp = (uint32*) malloc((8*psize+2) * sizeof(uint32)); + register uint32* temp = (uint32*) malloc((8*psize+2) * sizeof(*temp)); if (temp) { diff --git a/beecrypt/dsa.c b/beecrypt/dsa.c index 7887462..5d21d50 100644 --- a/beecrypt/dsa.c +++ b/beecrypt/dsa.c @@ -65,10 +65,10 @@ int dsasign(const mp32barrett* p, const mp32barrett* q, const mp32number* g, ran register uint32* qtemp; register int rc = -1; /* assume failure */ - ptemp = (uint32*) malloc((5*psize+2)*sizeof(uint32)); + ptemp = (uint32*) malloc((5*psize+2) * sizeof(*ptemp)); if (ptemp == NULL) return rc; - qtemp = (uint32*) malloc((9*qsize+6)*sizeof(uint32)); + qtemp = (uint32*) malloc((9*qsize+6) * sizeof(*qtemp)); if (qtemp == NULL) { free(ptemp); return rc; @@ -144,11 +144,11 @@ int dsavrfy(const mp32barrett* p, const mp32barrett* q, const mp32number* g, con if (mp32gex(s->size, s->data, qsize, q->modl)) return rc; - ptemp = (uint32*) malloc((6*psize+2)*sizeof(uint32)); + ptemp = (uint32*) malloc((6*psize+2) * sizeof(*ptemp)); if (ptemp == NULL) return rc; - qtemp = (uint32*) malloc((8*qsize+6)*sizeof(uint32)); + qtemp = (uint32*) malloc((8*qsize+6) * sizeof(*qtemp)); if (qtemp == NULL) { free(ptemp); return rc; diff --git a/beecrypt/elgamal.c b/beecrypt/elgamal.c index d0540c9..1d172fc 100644 --- a/beecrypt/elgamal.c +++ b/beecrypt/elgamal.c @@ -70,7 +70,7 @@ int elgv1sign(const mp32barrett* p, const mp32barrett* n, const mp32number* g, randomGeneratorContext* rgc, const mp32number* hm, const mp32number* x, mp32number* r, mp32number* s) { register uint32 size = p->size; - register uint32* temp = (uint32*) malloc((8*size+6)*sizeof(uint32)); + register uint32* temp = (uint32*) malloc((8*size+6) * sizeof(*temp)); if (temp) { @@ -121,7 +121,7 @@ int elgv1vrfy(const mp32barrett* p, const mp32barrett* n, const mp32number* g, c if (mp32gex(s->size, s->data, n->size, n->modl)) return 0; - temp = (uint32*) malloc((6*size+2)*sizeof(uint32)); + temp = (uint32*) malloc((6*size+2) * sizeof(*temp)); if (temp) { @@ -151,7 +151,7 @@ int elgv1vrfy(const mp32barrett* p, const mp32barrett* n, const mp32number* g, c int elgv3sign(const mp32barrett* p, const mp32barrett* n, const mp32number* g, randomGeneratorContext* rgc, const mp32number* hm, const mp32number* x, mp32number* r, mp32number* s) { register uint32 size = p->size; - register uint32* temp = (uint32*) malloc((6*size+2)*sizeof(uint32)); + register uint32* temp = (uint32*) malloc((6*size+2) * sizeof(*temp)); if (temp) { @@ -198,7 +198,7 @@ int elgv3vrfy(const mp32barrett* p, const mp32barrett* n, const mp32number* g, c if (mp32gex(s->size, s->data, n->size, n->modl)) return 0; - temp = (uint32*) malloc((6*size+2)*sizeof(uint32)); + temp = (uint32*) malloc((6*size+2) * sizeof(*temp)); if (temp) { diff --git a/beecrypt/entropy.c b/beecrypt/entropy.c index 2e07a0f..0468964 100644 --- a/beecrypt/entropy.c +++ b/beecrypt/entropy.c @@ -1,3 +1,4 @@ +/*@-sizeoftype@*/ /** \ingroup ES_m * \file entropy.c * @@ -1345,10 +1346,10 @@ int entropy_dev_dsp(uint32 *data, int size) if (mutex_lock(&dev_dsp_lock)) return -1; # elif HAVE_PTHREAD_H - /*@-moduncon@*/ + /*@-moduncon -noeffectuncon @*/ /* FIX: annotate */ if (pthread_mutex_lock(&dev_dsp_lock)) return -1; - /*@=moduncon@*/ + /*@=moduncon =noeffectuncon @*/ # endif #endif @@ -1456,9 +1457,9 @@ dev_dsp_end: # if HAVE_SYNCH_H mutex_unlock(&dev_dsp_lock); # elif HAVE_PTHREAD_H - /*@-moduncon@*/ + /*@-moduncon -noeffectuncon @*/ /* FIX: annotate */ (void) pthread_mutex_unlock(&dev_dsp_lock); - /*@=moduncon@*/ + /*@=moduncon =noeffectuncon @*/ # endif #endif @@ -1480,10 +1481,10 @@ int entropy_dev_random(uint32* data, int size) if (mutex_lock(&dev_random_lock)) return -1; # elif HAVE_PTHREAD_H - /*@-moduncon@*/ + /*@-moduncon -noeffectuncon @*/ /* FIX: annotate */ if (pthread_mutex_lock(&dev_random_lock)) return -1; - /*@=moduncon@*/ + /*@=moduncon =noeffectuncon @*/ # endif #endif @@ -1505,9 +1506,9 @@ dev_random_end: # if HAVE_SYNCH_H mutex_unlock(&dev_random_lock); # elif HAVE_PTHREAD_H - /*@-moduncon@*/ + /*@-moduncon -noeffectuncon @*/ /* FIX: annotate */ (void) pthread_mutex_unlock(&dev_random_lock); - /*@=moduncon@*/ + /*@=moduncon =noeffectuncon @*/ # endif #endif return rc; @@ -1528,10 +1529,10 @@ int entropy_dev_urandom(uint32* data, int size) if (mutex_lock(&dev_urandom_lock)) return -1; # elif HAVE_PTHREAD_H - /*@-moduncon@*/ + /*@-moduncon -noeffectuncon @*/ /* FIX: annotate */ if (pthread_mutex_lock(&dev_urandom_lock)) return -1; - /*@=moduncon@*/ + /*@=moduncon =noeffectuncon @*/ # endif #endif @@ -1553,9 +1554,9 @@ dev_urandom_end: # if HAVE_SYNCH_H mutex_unlock(&dev_urandom_lock); # elif HAVE_PTHREAD_H - /*@-moduncon@*/ + /*@-moduncon -noeffectuncon @*/ /* FIX: annotate */ (void) pthread_mutex_unlock(&dev_urandom_lock); - /*@=moduncon@*/ + /*@=moduncon =noeffectuncon @*/ # endif #endif return rc; @@ -1574,10 +1575,10 @@ int entropy_dev_tty(uint32* data, int size) if (mutex_lock(&dev_tty_lock)) return -1; # elif HAVE_PTHREAD_H - /*@-moduncon@*/ + /*@-moduncon -noeffectuncon @*/ /* FIX: annotate */ if (pthread_mutex_lock(&dev_tty_lock)) return -1; - /*@=moduncon@*/ + /*@=moduncon =noeffectuncon @*/ # endif #endif @@ -1598,9 +1599,9 @@ dev_tty_end: # if HAVE_SYNCH_H mutex_unlock(&dev_tty_lock); # elif HAVE_PTHREAD_H - /*@-moduncon@*/ + /*@-moduncon -noeffectuncon @*/ /* FIX: annotate */ (void) pthread_mutex_unlock(&dev_tty_lock); - /*@=moduncon@*/ + /*@=moduncon =noeffectuncon @*/ # endif #endif @@ -1609,3 +1610,4 @@ dev_tty_end: #endif #endif +/*@=sizeoftype@*/ diff --git a/beecrypt/fips180.c b/beecrypt/fips180.c index 82e0696..7dfb94c 100644 --- a/beecrypt/fips180.c +++ b/beecrypt/fips180.c @@ -44,7 +44,9 @@ static const uint32 k[4] = { 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 }; /*@observer@*/ /*@unchecked@*/ static const uint32 hinit[5] = { 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 }; +/*@-sizeoftype@*/ const hashFunction sha1 = { "SHA-1", sizeof(sha1Param), 64, 5 * sizeof(uint32), (hashFunctionReset) sha1Reset, (hashFunctionUpdate) sha1Update, (hashFunctionDigest) sha1Digest }; +/*@=sizeoftype@*/ int sha1Reset(register sha1Param *p) { diff --git a/beecrypt/fips186.c b/beecrypt/fips186.c index e30fa31..be59082 100644 --- a/beecrypt/fips186.c +++ b/beecrypt/fips186.c @@ -43,7 +43,9 @@ /*@observer@*/ /*@unchecked@*/ static uint32 fips186hinit[5] = { 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, 0x67452301 }; +/*@-sizeoftype@*/ const randomGenerator fips186prng = { "FIPS 186", sizeof(fips186Param), (const randomGeneratorSetup) fips186Setup, (const randomGeneratorSeed) fips186Seed, (const randomGeneratorNext) fips186Next, (const randomGeneratorCleanup) fips186Cleanup }; +/*@=sizeoftype@*/ /** */ diff --git a/beecrypt/hmacmd5.c b/beecrypt/hmacmd5.c index f11ccae..2fb7caf 100644 --- a/beecrypt/hmacmd5.c +++ b/beecrypt/hmacmd5.c @@ -29,7 +29,9 @@ #include "hmacmd5.h" +/*@-sizeoftype@*/ 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@*/ int hmacmd5Setup (hmacmd5Param* sp, const uint32* key, int keybits) { diff --git a/beecrypt/hmacsha1.c b/beecrypt/hmacsha1.c index 25feef0..7cd6993 100644 --- a/beecrypt/hmacsha1.c +++ b/beecrypt/hmacsha1.c @@ -29,7 +29,9 @@ #include "hmacsha1.h" +/*@-sizeoftype@*/ const keyedHashFunction hmacsha1 = { "HMAC-SHA-1", sizeof(hmacsha1Param), 64, 5 * sizeof(uint32), 64, 512, 32, (keyedHashFunctionSetup) hmacsha1Setup, (keyedHashFunctionReset) hmacsha1Reset, (keyedHashFunctionUpdate) hmacsha1Update, (keyedHashFunctionDigest) hmacsha1Digest }; +/*@=sizeoftype@*/ int hmacsha1Setup (hmacsha1Param* sp, const uint32* key, int keybits) { diff --git a/beecrypt/hmacsha256.c b/beecrypt/hmacsha256.c index 97faa2c..8eaeb8c 100644 --- a/beecrypt/hmacsha256.c +++ b/beecrypt/hmacsha256.c @@ -29,7 +29,9 @@ #include "hmacsha256.h" +/*@-sizeoftype@*/ const keyedHashFunction hmacsha256 = { "HMAC-SHA-256", sizeof(hmacsha256Param), 64, 8 * sizeof(uint32), 64, 512, 32, (keyedHashFunctionSetup) hmacsha256Setup, (keyedHashFunctionReset) hmacsha256Reset, (keyedHashFunctionUpdate) hmacsha256Update, (keyedHashFunctionDigest) hmacsha256Digest }; +/*@=sizeoftype@*/ int hmacsha256Setup (hmacsha256Param* sp, const uint32* key, int keybits) { diff --git a/beecrypt/md5.c b/beecrypt/md5.c index 251abe2..07391a9 100644 --- a/beecrypt/md5.c +++ b/beecrypt/md5.c @@ -36,7 +36,9 @@ /*@observer@*/ /*@unchecked@*/ static uint32 md5hinit[4] = { 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476 }; +/*@-sizeoftype@*/ const hashFunction md5 = { "MD5", sizeof(md5Param), 64, 4 * sizeof(uint32), (hashFunctionReset) md5Reset, (hashFunctionUpdate) md5Update, (hashFunctionDigest) md5Digest }; +/*@=sizeoftype@*/ int md5Reset(register md5Param* p) { diff --git a/beecrypt/memchunk.c b/beecrypt/memchunk.c index 2befd60..40597be 100644 --- a/beecrypt/memchunk.c +++ b/beecrypt/memchunk.c @@ -37,7 +37,7 @@ /*@-compdef@*/ /* tmp->data is undefined */ memchunk* memchunkAlloc(int size) { - memchunk* tmp = (memchunk*) calloc(1, sizeof(memchunk)); + memchunk* tmp = (memchunk*) calloc(1, sizeof(*tmp)); if (tmp) { diff --git a/beecrypt/mp32barrett.c b/beecrypt/mp32barrett.c index a9b90e5..78e50b6 100644 --- a/beecrypt/mp32barrett.c +++ b/beecrypt/mp32barrett.c @@ -1,3 +1,4 @@ +/*@-sizeoftype@*/ /** \ingroup MP_m * \file mp32barrett.c * @@ -1053,3 +1054,4 @@ void mp32bnpowmodsld(const mp32barrett* b, const uint32* slide, const mp32number free(temp); /*@=nullpass@*/ } +/*@=sizeoftype@*/ diff --git a/beecrypt/mp32number.c b/beecrypt/mp32number.c index a4c766d..8a205ba 100644 --- a/beecrypt/mp32number.c +++ b/beecrypt/mp32number.c @@ -1,3 +1,4 @@ +/*@-sizeoftype@*/ /** \ingroup MP_m * \file mp32number.c * @@ -229,3 +230,4 @@ void mp32nsethex(mp32number* n, const char* hex) } } /*@=nullstate =compdef @*/ +/*@=sizeoftype@*/ diff --git a/beecrypt/mtprng.c b/beecrypt/mtprng.c index 165c1e2..ada28ec 100644 --- a/beecrypt/mtprng.c +++ b/beecrypt/mtprng.c @@ -53,7 +53,9 @@ #define loBits(a) ((a) & 0x7FFFFFFF) #define mixBits(a, b) (hiBit(a) | loBits(b)) +/*@-sizeoftype@*/ const randomGenerator mtprng = { "Mersenne Twister", sizeof(mtprngParam), (randomGeneratorSetup) mtprngSetup, (randomGeneratorSeed) mtprngSeed, (randomGeneratorNext) mtprngNext, (randomGeneratorCleanup) mtprngCleanup }; +/*@=sizeoftype@*/ /** */ diff --git a/beecrypt/rsa.c b/beecrypt/rsa.c index 177640b..78c0068 100644 --- a/beecrypt/rsa.c +++ b/beecrypt/rsa.c @@ -40,7 +40,7 @@ int rsapri(const rsakp* kp, const mp32number* m, mp32number* c) { register uint32 size = kp->n.size; - register uint32* temp = (uint32*) malloc((4*size+2)*sizeof(uint32)); + register uint32* temp = (uint32*) malloc((4*size+2) * sizeof(*temp)); if (temp) { @@ -61,7 +61,7 @@ int rsapricrt(const rsakp* kp, const mp32number* m, mp32number* c) register uint32 nsize = kp->n.size; register uint32 psize = kp->p.size; register uint32 qsize = kp->q.size; - register uint32* temp = (uint32*) malloc((psize+qsize+(5*nsize+6))*sizeof(uint32)); + register uint32* temp = (uint32*) malloc((psize+qsize+(5*nsize+6))*sizeof(*temp)); register uint32* wksp = temp+psize+qsize+nsize; /* compute j1 = m^d1 mod p */ @@ -116,7 +116,7 @@ int rsavrfy(const rsapk* pk, const mp32number* m, const mp32number* c) { int rc; register uint32 size = pk->n.size; - register uint32* temp = (uint32*) malloc((5*size+2)*sizeof(uint32)); + register uint32* temp = (uint32*) malloc((5*size+2) * sizeof(*temp)); if (temp) { diff --git a/beecrypt/rsakp.c b/beecrypt/rsakp.c index f60f9ec..159ce07 100644 --- a/beecrypt/rsakp.c +++ b/beecrypt/rsakp.c @@ -50,7 +50,7 @@ int rsakpMake(rsakp* kp, randomGeneratorContext* rgc, int nsize) */ register uint32 pqsize = ((uint32)(nsize+1)) >> 1; - register uint32* temp = (uint32*) malloc((16*pqsize+6)*sizeof(uint32)); + register uint32* temp = (uint32*) malloc((16*pqsize+6) * sizeof(*temp)); register uint32 newn = 1; if (temp) @@ -71,9 +71,11 @@ int rsakpMake(rsakp* kp, randomGeneratorContext* rgc, int nsize) /* if p <= q, perform a swap to make p larger than q */ if (mp32le(pqsize, kp->p.modl, kp->q.modl)) { + /*@-sizeoftype@*/ memcpy(&r, &kp->q, sizeof(mp32barrett)); memcpy(&kp->q, &kp->p, sizeof(mp32barrett)); memcpy(&kp->p, &r, sizeof(mp32barrett)); + /*@=sizeoftype@*/ } mp32bzero(&r); @@ -98,15 +100,19 @@ int rsakpMake(rsakp* kp, randomGeneratorContext* rgc, int nsize) if (mp32le(pqsize, kp->p.modl, r.modl)) { mp32bfree(&kp->q); + /*@-sizeoftype@*/ memcpy(&kp->q, &kp->p, sizeof(mp32barrett)); memcpy(&kp->p, &r, sizeof(mp32barrett)); + /*@=sizeoftype@*/ mp32bzero(&r); newn = 1; } else if (mp32le(pqsize, kp->q.modl, r.modl)) { mp32bfree(&kp->q); + /*@-sizeoftype@*/ memcpy(&kp->q, &r, sizeof(mp32barrett)); + /*@=sizeoftype@*/ mp32bzero(&r); newn = 1; } @@ -159,7 +165,7 @@ int rsakpMake(rsakp* kp, randomGeneratorContext* rgc, int nsize) int rsakpInit(rsakp* kp) { - memset(kp, 0, sizeof(rsakp)); + memset(kp, 0, sizeof(*kp)); /* or mp32bzero(&kp->n); mp32nzero(&kp->e); diff --git a/beecrypt/rsapk.c b/beecrypt/rsapk.c index 4dcfbe1..5032941 100644 --- a/beecrypt/rsapk.c +++ b/beecrypt/rsapk.c @@ -37,7 +37,7 @@ int rsapkInit(rsapk* pk) { - memset(pk, 0, sizeof(rsapk)); + memset(pk, 0, sizeof(*pk)); /* or mp32bzero(&pk->n); mp32nzero(&pk->e); diff --git a/beecrypt/sha256.c b/beecrypt/sha256.c index 558d3c7..329f3c6 100644 --- a/beecrypt/sha256.c +++ b/beecrypt/sha256.c @@ -52,7 +52,9 @@ static const uint32 hinit[8] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 }; +/*@-sizeoftype@*/ const hashFunction sha256 = { "SHA-256", sizeof(sha256Param), 64, 8 * sizeof(uint32), (hashFunctionReset) sha256Reset, (hashFunctionUpdate) sha256Update, (hashFunctionDigest) sha256Digest }; +/*@=sizeoftype@*/ int sha256Reset(register sha256Param *p) { diff --git a/build/expression.c b/build/expression.c index 9c79a1f..817e4dc 100644 --- a/build/expression.c +++ b/build/expression.c @@ -45,7 +45,7 @@ static Value valueMakeInteger(int i) { Value v; - v = (Value) xmalloc(sizeof(struct _value)); + v = (Value) xmalloc(sizeof(*v)); v->type = VALUE_TYPE_INTEGER; v->data.i = i; return v; @@ -58,7 +58,7 @@ static Value valueMakeString(/*@only@*/ const char *s) { Value v; - v = (Value) xmalloc(sizeof(struct _value)); + v = (Value) xmalloc(sizeof(*v)); v->type = VALUE_TYPE_STRING; v->data.s = s; return v; diff --git a/build/files.c b/build/files.c index 5431e28..fa44e1b 100644 --- a/build/files.c +++ b/build/files.c @@ -266,8 +266,8 @@ static void timeCheck(int tc, Header h) int count, x; time_t currentTime = time(NULL); - (void) hge(h, RPMTAG_OLDFILENAMES, &fnt, (void **) &files, &count); - (void) hge(h, RPMTAG_FILEMTIMES, NULL, (void **) &mtime, NULL); + x = hge(h, RPMTAG_OLDFILENAMES, &fnt, (void **) &files, &count); + x = hge(h, RPMTAG_FILEMTIMES, NULL, (void **) &mtime, NULL); for (x = 0; x < count; x++) { if ((currentTime - mtime[x]) > tc) @@ -1209,6 +1209,7 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, (void) headerAddOrAppendEntry(h, RPMTAG_OLDFILENAMES, RPM_STRING_ARRAY_TYPE, &(flp->fileURL), 1); +/*@-sizeoftype@*/ if (sizeof(flp->fl_size) != sizeof(uint_32)) { uint_32 psize = (uint_32)flp->fl_size; (void) headerAddOrAppendEntry(h, RPMTAG_FILESIZES, RPM_INT32_TYPE, @@ -1247,6 +1248,7 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, (void) headerAddOrAppendEntry(h, RPMTAG_FILEDEVICES, RPM_INT32_TYPE, &(flp->fl_dev), 1); } +/*@=sizeoftype@*/ (void) headerAddOrAppendEntry(h, RPMTAG_FILEINODES, RPM_INT32_TYPE, &(flp->fl_ino), 1); @@ -2551,7 +2553,7 @@ static void printDeps(Header h) rpmTagType dvt = -1; int * flags = NULL; DepMsg_t * dm; - int count; + int count, xx; for (dm = depMsgs; dm->msg != NULL; dm++) { switch (dm->ntag) { @@ -2574,7 +2576,7 @@ static void printDeps(Header h) /*@switchbreak@*/ break; default: versions = hfd(versions, dvt); - (void) hge(h, dm->vtag, &dvt, (void **) &versions, NULL); + xx = hge(h, dm->vtag, &dvt, (void **) &versions, NULL); /*@switchbreak@*/ break; } switch (dm->ftag) { @@ -2584,7 +2586,7 @@ static void printDeps(Header h) case -1: /*@switchbreak@*/ break; default: - (void) hge(h, dm->ftag, NULL, (void **) &flags, NULL); + xx = hge(h, dm->ftag, NULL, (void **) &flags, NULL); /*@switchbreak@*/ break; } /*@-noeffect@*/ diff --git a/build/myftw.c b/build/myftw.c index 20708ec..7300421 100644 --- a/build/myftw.c +++ b/build/myftw.c @@ -192,7 +192,7 @@ int myftw (const char *dir, descriptors = 1; /*@access DIR@*/ - dirs = (DIR **) alloca (descriptors * sizeof (DIR *)); + dirs = (DIR **) alloca (descriptors * sizeof (*dirs)); i = descriptors; while (i-- > 0) dirs[i] = NULL; diff --git a/build/pack.c b/build/pack.c index 856051c..9a7e9b7 100644 --- a/build/pack.c +++ b/build/pack.c @@ -293,12 +293,14 @@ int readRPM(const char *fileName, Spec *specp, struct rpmlead *lead, } /* Get copy of lead */ + /*@-sizeoftype@*/ if ((rc = Fread(lead, sizeof(char), sizeof(*lead), fdi)) != sizeof(*lead)) { rpmError(RPMERR_BADMAGIC, _("readRPM: read %s: %s\n"), (fileName ? fileName : ""), Fstrerror(fdi)); return RPMERR_BADMAGIC; } + /*@=sizeoftype@*/ /* XXX FIXME: EPIPE on */ if (Fseek(fdi, 0, SEEK_SET) == -1) { diff --git a/build/parsePreamble.c b/build/parsePreamble.c index 5c6400c..933401b 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -50,12 +50,13 @@ static rpmTag requiredTags[] = { static void addOrAppendListEntry(Header h, int_32 tag, char * line) /*@modifies h @*/ { + int xx; int argc; const char **argv; - (void) poptParseArgvString(line, &argc, &argv); + xx = poptParseArgvString(line, &argc, &argv); if (argc) - (void) headerAddOrAppendEntry(h, tag, RPM_STRING_ARRAY_TYPE, argv, argc); + xx = headerAddOrAppendEntry(h, tag, RPM_STRING_ARRAY_TYPE, argv, argc); argv = _free(argv); } @@ -370,7 +371,7 @@ static int readIcon(Header h, const char * file) icon = xmalloc(iconsize + 1); *icon = '\0'; - nb = Fread(icon, sizeof(char), iconsize, fd); + nb = Fread(icon, sizeof(icon[0]), iconsize, fd); if (Ferror(fd) || (size >= 0 && nb != size)) { rpmError(RPMERR_BADSPEC, _("Unable to read icon %s: %s\n"), fn, Fstrerror(fd)); @@ -462,6 +463,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, int len; int num; int rc; + int xx; if (field == NULL) return RPMERR_BADSPEC; /* XXX can't happen */ /* Find the start of the "field" and strip trailing space */ @@ -574,7 +576,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, } break; case RPMTAG_PREFIXES: addOrAppendListEntry(pkg->header, tag, field); - (void) hge(pkg->header, tag, &type, (void **)&array, &num); + xx = hge(pkg->header, tag, &type, (void **)&array, &num); while (num--) { len = strlen(array[num]); if (array[num][len - 1] == '/' && len > 1) { @@ -607,7 +609,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, spec->lineNum, spec->line); return RPMERR_BADSPEC; } - (void) headerAddEntry(pkg->header, tag, RPM_INT32_TYPE, &num, 1); + xx = headerAddEntry(pkg->header, tag, RPM_INT32_TYPE, &num, 1); break; case RPMTAG_AUTOREQPROV: pkg->autoReq = parseYesNo(field); @@ -830,7 +832,7 @@ static int findPreambleTag(Spec spec, /*@out@*/int * tag, int parsePreamble(Spec spec, int initialPackage) { int nextPart; - int tag, rc; + int tag, rc, xx; char *name, *linep; int flag; Package pkg; @@ -858,11 +860,11 @@ int parsePreamble(Spec spec, int initialPackage) /* Construct the package */ if (flag == PART_SUBNAME) { const char * mainName; - (void) headerNVR(spec->packages->header, &mainName, NULL, NULL); + xx = headerNVR(spec->packages->header, &mainName, NULL, NULL); sprintf(NVR, "%s-%s", mainName, name); } else strcpy(NVR, name); - (void) headerAddEntry(pkg->header, RPMTAG_NAME, RPM_STRING_TYPE, NVR, 1); + xx = headerAddEntry(pkg->header, RPMTAG_NAME, RPM_STRING_TYPE, NVR, 1); } if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) { diff --git a/build/parseSpec.c b/build/parseSpec.c index c65c285..67a7a87 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -335,7 +335,7 @@ retry: } if (match != -1) { - rl = xmalloc(sizeof(struct ReadLevelEntry)); + rl = xmalloc(sizeof(*rl)); rl->reading = spec->readStack->reading && match; rl->next = spec->readStack; spec->readStack = rl; @@ -482,7 +482,8 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU closeSpec(spec); - spec->BASpecs = xcalloc(spec->BACount, sizeof(Spec)); + /* LCL: sizeof(spec->BASpecs[0]) -nullderef whine here */ + spec->BASpecs = xcalloc(spec->BACount, sizeof(*spec->BASpecs)); index = 0; if (spec->BANames != NULL) for (x = 0; x < spec->BACount; x++) { diff --git a/build/reqprov.c b/build/reqprov.c index 11ca71b..1877501 100644 --- a/build/reqprov.c +++ b/build/reqprov.c @@ -22,6 +22,7 @@ int addReqProv(/*@unused@*/ Spec spec, Header h, rpmTag indextag = 0; int len; rpmsenseFlags extra = RPMSENSE_ANY; + int xx; if (depFlags & RPMSENSE_PROVIDES) { nametag = RPMTAG_PROVIDENAME; @@ -70,11 +71,11 @@ int addReqProv(/*@unused@*/ Spec spec, Header h, int duplicate = 0; if (flagtag) { - (void) hge(h, versiontag, &dvt, (void **) &versions, NULL); - (void) hge(h, flagtag, NULL, (void **) &flags, NULL); + xx = hge(h, versiontag, &dvt, (void **) &versions, NULL); + xx = hge(h, flagtag, NULL, (void **) &flags, NULL); } if (indextag) - (void) hge(h, indextag, NULL, (void **) &indexes, NULL); + xx = hge(h, indextag, NULL, (void **) &indexes, NULL); while (len > 0) { len--; @@ -103,15 +104,15 @@ int addReqProv(/*@unused@*/ Spec spec, Header h, } /* Add this dependency. */ - (void) headerAddOrAppendEntry(h, nametag, RPM_STRING_ARRAY_TYPE, &depName, 1); + xx = headerAddOrAppendEntry(h, nametag, RPM_STRING_ARRAY_TYPE, &depName, 1); if (flagtag) { - (void) headerAddOrAppendEntry(h, versiontag, + xx = headerAddOrAppendEntry(h, versiontag, RPM_STRING_ARRAY_TYPE, &depEVR, 1); - (void) headerAddOrAppendEntry(h, flagtag, + xx = headerAddOrAppendEntry(h, flagtag, RPM_INT32_TYPE, &depFlags, 1); } if (indextag) - (void) headerAddOrAppendEntry(h, indextag, RPM_INT32_TYPE, &index, 1); + xx = headerAddOrAppendEntry(h, indextag, RPM_INT32_TYPE, &index, 1); return 0; } diff --git a/build/spec.c b/build/spec.c index 319a484..c515b6e 100644 --- a/build/spec.c +++ b/build/spec.c @@ -299,7 +299,7 @@ int addSource(Spec spec, Package pkg, const char *field, int tag) } /* Create the entry and link it in */ - p = xmalloc(sizeof(struct Source)); + p = xmalloc(sizeof(*p)); p->num = num; p->fullSource = xstrdup(field); p->flags = flag; @@ -542,7 +542,7 @@ Spec freeSpec(Spec spec) { struct OpenFileInfo *ofi; - ofi = xmalloc(sizeof(struct OpenFileInfo)); + ofi = xmalloc(sizeof(*ofi)); ofi->fd = NULL; ofi->fileName = NULL; ofi->lineNum = 0; diff --git a/lib/Makefile.am b/lib/Makefile.am index 89739a2..a581697 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -67,7 +67,7 @@ getdate.c: getdate.y -@if test -f y.tab.c; then \ { echo "/*@-globstate -statictrans -unqualifiedtrans -noparams @*/";\ echo "/*@-retvalint -usedef -varuse -nullderef -nullassign @*/";\ - echo "/*@-readonlytrans -modunconnomods -compdef @*/";\ + echo "/*@-readonlytrans -modunconnomods -compdef -noeffectuncon @*/";\ echo "/*@-globs -evalorderuncon -modobserveruncon -modnomods @*/";\ sed -e 's,y.tab.c,getdate.c,' y.tab.c \ -e 's,^YYSTYPE ,static &,' \ @@ -76,7 +76,7 @@ getdate.c: getdate.y -e 's,^int yydebug,/*@unused@*/ static &,' \ -e 's,^int ,static &,' ;\ echo "/*@=globs =evalorderuncon =modobserveruncon =modnomods @*/";\ - echo "/*@=readonlytrans =modunconnomods =compdef @*/";\ + echo "/*@=readonlytrans =modunconnomods =compdef =noeffectuncon @*/";\ echo "/*@=retvalint =usedef =varuse =nullderef =nullassign @*/";\ echo "/*@=globstate =statictrans =unqualifiedtrans =noparams @*/";\ } > getdate.c ;\ diff --git a/lib/depends.c b/lib/depends.c index 48d7f0b..54172a5 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -249,7 +249,7 @@ alAddPackage(availableList al, rpmTagType dnt, bnt; struct availablePackage * p; rpmRelocation * r; - int i; + int i, xx; int_32 * dirIndexes; const char ** dirNames; int numDirs, dirNum; @@ -275,7 +275,7 @@ alAddPackage(availableList al, memset(&p->tsi, 0, sizeof(p->tsi)); p->multiLib = 0; /* MULTILIB */ - (void) headerNVR(p->h, &p->name, &p->version, &p->release); + xx = headerNVR(p->h, &p->name, &p->version, &p->release); /* XXX This should be added always so that packages look alike. * XXX However, there is logic in files.c/depends.c that checks for @@ -333,9 +333,9 @@ alAddPackage(availableList al, p->filesCount = 0; p->baseNames = NULL; } else { - (void) hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, &numDirs); - (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); - (void) hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlags, NULL); + xx = hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, &numDirs); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + xx = hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlags, NULL); /* XXX FIXME: We ought to relocate the directory list here */ @@ -619,7 +619,7 @@ static int rangeMatchesDepFlags (Header h, int_32 * provideFlags; int providesCount; int result; - int i; + int i, xx; if (!(reqFlags & RPMSENSE_SENSEMASK) || !reqEVR || !strlen(reqEVR)) return 1; @@ -633,7 +633,7 @@ static int rangeMatchesDepFlags (Header h, (void **) &providesEVR, &providesCount)) return 1; - (void) hge(h, RPMTAG_PROVIDEFLAGS, NULL, (void **) &provideFlags, NULL); + xx = hge(h, RPMTAG_PROVIDEFLAGS, NULL, (void **) &provideFlags, NULL); if (!hge(h, RPMTAG_PROVIDENAME, &pnt, (void **) &provides, &providesCount)) { @@ -770,19 +770,20 @@ static int removePackage(rpmTransactionSet ts, int dboffset, int depends) /* Filter out duplicate erasures. */ if (ts->numRemovedPackages > 0 && ts->removedPackages != NULL) { if (bsearch(&dboffset, ts->removedPackages, ts->numRemovedPackages, - sizeof(int), intcmp) != NULL) + sizeof(*ts->removedPackages), intcmp) != NULL) return 0; } if (ts->numRemovedPackages == ts->allocedRemovedPackages) { ts->allocedRemovedPackages += ts->delta; ts->removedPackages = xrealloc(ts->removedPackages, - sizeof(int *) * ts->allocedRemovedPackages); + sizeof(ts->removedPackages) * ts->allocedRemovedPackages); } if (ts->removedPackages != NULL) { /* XXX can't happen. */ ts->removedPackages[ts->numRemovedPackages++] = dboffset; - qsort(ts->removedPackages, ts->numRemovedPackages, sizeof(int), intcmp); + qsort(ts->removedPackages, ts->numRemovedPackages, + sizeof(*ts->removedPackages), intcmp); } if (ts->orderCount == ts->orderAlloced) { @@ -808,6 +809,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, int count; const char ** obsoletes; int alNum; + int xx; /* * FIXME: handling upgrades like this is *almost* okay. It doesn't @@ -836,7 +838,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, if (headerIsEntry(h, RPMTAG_SOURCEPACKAGE)) return 0; - (void) headerNVR(h, &name, NULL, NULL); + xx = headerNVR(h, &name, NULL, NULL); { rpmdbMatchIterator mi; Header h2; @@ -845,7 +847,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, while((h2 = rpmdbNextIterator(mi)) != NULL) { /*@-branchstate@*/ if (rpmVersionCompare(h, h2)) - (void) removePackage(ts, rpmdbGetIteratorOffset(mi), alNum); + xx = removePackage(ts, rpmdbGetIteratorOffset(mi), alNum); else { uint_32 *p, multiLibMask = 0, oldmultiLibMask = 0; @@ -868,9 +870,9 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, int_32 * obsoletesFlags; int j; - (void) hge(h, RPMTAG_OBSOLETEVERSION, &ovt, (void **) &obsoletesEVR, + xx = hge(h, RPMTAG_OBSOLETEVERSION, &ovt, (void **) &obsoletesEVR, NULL); - (void) hge(h, RPMTAG_OBSOLETEFLAGS, NULL, (void **) &obsoletesFlags, + xx = hge(h, RPMTAG_OBSOLETEFLAGS, NULL, (void **) &obsoletesFlags, NULL); for (j = 0; j < count; j++) { @@ -884,7 +886,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, obsoletes[j], 0); - (void) rpmdbPruneIterator(mi, + xx = rpmdbPruneIterator(mi, ts->removedPackages, ts->numRemovedPackages, 1); while((h2 = rpmdbNextIterator(mi)) != NULL) { @@ -897,7 +899,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, headerMatchesDepFlags(h2, obsoletes[j], obsoletesEVR[j], obsoletesFlags[j])) { - (void) removePackage(ts, rpmdbGetIteratorOffset(mi), alNum); + xx = removePackage(ts, rpmdbGetIteratorOffset(mi), alNum); } /*@=branchstate@*/ } @@ -1402,19 +1404,19 @@ static int checkPackageDeps(rpmTransactionSet ts, problemsSet psp, int_32 * conflictFlags = NULL; int conflictsCount = 0; rpmTagType type; - int i, rc; + int i, rc, xx; int ourrc = 0; struct availablePackage ** suggestion; - (void) headerNVR(h, &name, &version, &release); + xx = headerNVR(h, &name, &version, &release); if (!hge(h, RPMTAG_REQUIRENAME, &rnt, (void **) &requires, &requiresCount)) { requiresCount = 0; rvt = RPM_STRING_ARRAY_TYPE; } else { - (void)hge(h, RPMTAG_REQUIREFLAGS, NULL, (void **) &requireFlags, NULL); - (void)hge(h, RPMTAG_REQUIREVERSION, &rvt, (void **) &requiresEVR, NULL); + xx = hge(h, RPMTAG_REQUIREFLAGS, NULL, (void **) &requireFlags, NULL); + xx = hge(h, RPMTAG_REQUIREVERSION, &rvt, (void **) &requiresEVR, NULL); } for (i = 0; i < requiresCount && !ourrc; i++) { @@ -1492,9 +1494,9 @@ static int checkPackageDeps(rpmTransactionSet ts, problemsSet psp, conflictsCount = 0; cvt = RPM_STRING_ARRAY_TYPE; } else { - (void) hge(h, RPMTAG_CONFLICTFLAGS, &type, + xx = hge(h, RPMTAG_CONFLICTFLAGS, &type, (void **) &conflictFlags, &conflictsCount); - (void) hge(h, RPMTAG_CONFLICTVERSION, &cvt, + xx = hge(h, RPMTAG_CONFLICTVERSION, &cvt, (void **) &conflictsEVR, &conflictsCount); } @@ -2215,7 +2217,7 @@ int rpmdepCheck(rpmTransactionSet ts, struct availablePackage * p; problemsSet ps; int npkgs; - int i, j; + int i, j, xx; int rc; npkgs = ts->addedPackages.size; @@ -2271,12 +2273,12 @@ int rpmdepCheck(rpmTransactionSet ts, /*@-branchstate@*/ if (ts->numRemovedPackages > 0) { mi = rpmdbInitIterator(ts->rpmdb, RPMDBI_PACKAGES, NULL, 0); - (void) rpmdbAppendIterator(mi, + xx = rpmdbAppendIterator(mi, ts->removedPackages, ts->numRemovedPackages); while ((h = rpmdbNextIterator(mi)) != NULL) { { const char * name, * version, * release; - (void) headerNVR(h, &name, &version, &release); + xx = headerNVR(h, &name, &version, &release); rpmMessage(RPMMESS_DEBUG, "========== --- %s-%s-%s\n" , name, version, release); @@ -2317,8 +2319,8 @@ int rpmdepCheck(rpmTransactionSet ts, if (hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, &fileCount)) { - (void) hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); - (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, + xx = hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); rc = 0; for (j = 0; j < fileCount; j++) { @@ -2363,7 +2365,7 @@ exit: ps = _free(ps); /*@-branchstate@*/ if (_cacheDependsRC) - (void) rpmdbCloseDBI(ts->rpmdb, RPMDBI_DEPENDS); + xx = rpmdbCloseDBI(ts->rpmdb, RPMDBI_DEPENDS); /*@=branchstate@*/ return rc; } diff --git a/lib/formats.c b/lib/formats.c index 3e597ba..73c45d4 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -315,7 +315,7 @@ static int triggercondsTag(Header h, /*@out@*/ rpmTagType * type, char ** conds, ** s; char * item, * flagsStr; char * chptr; - int i, j; + int i, j, xx; char buf[5]; if (!hge(h, RPMTAG_TRIGGERNAME, &tnt, (void **) &names, &numNames)) { @@ -323,14 +323,14 @@ static int triggercondsTag(Header h, /*@out@*/ rpmTagType * type, return 0; } - (void) hge(h, RPMTAG_TRIGGERINDEX, NULL, (void **) &indices, NULL); - (void) hge(h, RPMTAG_TRIGGERFLAGS, NULL, (void **) &flags, NULL); - (void) hge(h, RPMTAG_TRIGGERVERSION, &tvt, (void **) &versions, NULL); - (void) hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &s, &numScripts); + xx = hge(h, RPMTAG_TRIGGERINDEX, NULL, (void **) &indices, NULL); + xx = hge(h, RPMTAG_TRIGGERFLAGS, NULL, (void **) &flags, NULL); + xx = hge(h, RPMTAG_TRIGGERVERSION, &tvt, (void **) &versions, NULL); + xx = hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &s, &numScripts); s = hfd(s, tst); *freeData = 1; - *data = conds = xmalloc(sizeof(char * ) * numScripts); + *data = conds = xmalloc(sizeof(*conds) * numScripts); *count = numScripts; *type = RPM_STRING_ARRAY_TYPE; for (i = 0; i < numScripts; i++) { @@ -384,7 +384,7 @@ static int triggertypeTag(Header h, /*@out@*/ rpmTagType * type, int_32 * indices, * flags; const char ** conds; const char ** s; - int i, j; + int i, j, xx; int numScripts, numNames; if (!hge(h, RPMTAG_TRIGGERINDEX, NULL, (void **) &indices, &numNames)) { @@ -392,12 +392,12 @@ static int triggertypeTag(Header h, /*@out@*/ rpmTagType * type, return 1; } - (void) hge(h, RPMTAG_TRIGGERFLAGS, NULL, (void **) &flags, NULL); - (void) hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &s, &numScripts); + xx = hge(h, RPMTAG_TRIGGERFLAGS, NULL, (void **) &flags, NULL); + xx = hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &s, &numScripts); s = hfd(s, tst); *freeData = 1; - *data = conds = xmalloc(sizeof(char * ) * numScripts); + *data = conds = xmalloc(sizeof(*conds) * numScripts); *count = numScripts; *type = RPM_STRING_ARRAY_TYPE; for (i = 0; i < numScripts; i++) { diff --git a/lib/fsm.c b/lib/fsm.c index 0bfcd67..8dd97ec 100644 --- a/lib/fsm.c +++ b/lib/fsm.c @@ -486,8 +486,10 @@ int fsmSetup(FSM_t fsm, fileStage goal, if (fsm->goal == FSM_PKGINSTALL) { if (ts && ts->notify) { + /*@-noeffectuncon @*/ /* FIX: check rc */ (void)ts->notify(fi->h, RPMCALLBACK_INST_START, 0, fi->archiveSize, (fi->ap ? fi->ap->key : NULL), ts->notifyData); + /*@=noeffectuncon @*/ } } @@ -853,12 +855,12 @@ static int writeFile(/*@special@*/ FSM_t fsm, int writeData) { const rpmTransactionSet ts = fsmGetTs(fsm); TFI_t fi = fsmGetFi(fsm); - if (ts && fi && ts->notify) { + if (ts && ts->notify && fi) { size_t size = (fdGetCpioPos(fsm->cfd) - pos); - /*@-modunconnomods@*/ + /*@-noeffectuncon @*/ /* FIX: check rc */ (void)ts->notify(fi->h, RPMCALLBACK_INST_PROGRESS, size, size, (fi->ap ? fi->ap->key : NULL), ts->notifyData); - /*@=modunconnomods@*/ + /*@=noeffectuncon @*/ } } @@ -1630,10 +1632,13 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; if (fsm->goal == FSM_PKGINSTALL || fsm->goal == FSM_PKGBUILD) { rpmTransactionSet ts = fsmGetTs(fsm); TFI_t fi = fsmGetFi(fsm); - if (ts && ts->notify && fi) + if (ts && ts->notify && fi) { + /*@-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 @*/ + } } break; case FSM_UNDO: diff --git a/lib/getdate.c b/lib/getdate.c index e0fe263..0cf1223 100644 --- a/lib/getdate.c +++ b/lib/getdate.c @@ -1,6 +1,6 @@ /*@-globstate -statictrans -unqualifiedtrans -noparams @*/ /*@-retvalint -usedef -varuse -nullderef -nullassign @*/ -/*@-readonlytrans -modunconnomods -compdef @*/ +/*@-readonlytrans -modunconnomods -compdef -noeffectuncon @*/ /*@-globs -evalorderuncon -modobserveruncon -modnomods @*/ #ifndef lint static char const @@ -1595,6 +1595,6 @@ yyaccept: return (0); } /*@=globs =evalorderuncon =modobserveruncon =modnomods @*/ -/*@=readonlytrans =modunconnomods =compdef @*/ +/*@=readonlytrans =modunconnomods =compdef =noeffectuncon @*/ /*@=retvalint =usedef =varuse =nullderef =nullassign @*/ /*@=globstate =statictrans =unqualifiedtrans =noparams @*/ diff --git a/lib/hdrinline.h b/lib/hdrinline.h index 883fe04..1374c41 100644 --- a/lib/hdrinline.h +++ b/lib/hdrinline.h @@ -73,7 +73,9 @@ Header headerLink(Header h) void headerSort(Header h) /*@modifies h @*/ { +/*@-noeffectuncon@*/ /* FIX: add rc */ (h2hv(h)->hdrsort) (h); +/*@=noeffectuncon@*/ return; } @@ -85,7 +87,9 @@ void headerSort(Header h) void headerUnsort(Header h) /*@modifies h @*/ { +/*@-noeffectuncon@*/ /* FIX: add rc */ (h2hv(h)->hdrunsort) (h); +/*@=noeffectuncon@*/ return; } /*@=exportlocal@*/ @@ -431,7 +435,9 @@ int headerRemoveEntry(Header h, int_32 tag) void headerCopyTags(Header headerFrom, Header headerTo, hTAG_t tagstocopy) /*@modifies headerFrom, headerTo @*/ { +/*@-noeffectuncon@*/ /* FIX: add rc */ hdrVec->hdrcopytags(headerFrom, headerTo, tagstocopy); +/*@=noeffectuncon@*/ return; } diff --git a/lib/header.c b/lib/header.c index 4a36acf..d72509a 100644 --- a/lib/header.c +++ b/lib/header.c @@ -1,3 +1,4 @@ +/*@-sizeoftype@*/ /** \ingroup header * \file lib/header.c */ @@ -3171,3 +3172,4 @@ static struct HV_s hdrVec1 = { /*@observer@*/ /*@unchecked@*/ HV_t hdrVec = &hdrVec1; /*@=compmempass =redef@*/ +/*@=sizeoftype@*/ diff --git a/lib/header_internal.c b/lib/header_internal.c index 9c30d13..30ea43e 100644 --- a/lib/header_internal.c +++ b/lib/header_internal.c @@ -1,3 +1,4 @@ +/*@-sizeoftype@*/ /** \ingroup header * \file lib/header_internal.c */ @@ -164,3 +165,4 @@ void headerDump(Header h, FILE *f, int flags, p++; } } +/*@=sizeoftype@*/ diff --git a/lib/misc.c b/lib/misc.c index 4771919..44ecdba 100644 --- a/lib/misc.c +++ b/lib/misc.c @@ -74,7 +74,7 @@ char ** splitString(const char * str, int length, char sep) *dest = '\0'; - list = xmalloc(sizeof(char *) * (fields + 1)); + list = xmalloc(sizeof(*list) * (fields + 1)); dest = s; list[0] = dest; @@ -348,7 +348,7 @@ void compressFilelist(Header h) int_32 * dirIndexes; rpmTagType fnt; int count; - int i; + int i, xx; int dirIndex = -1; /* @@ -358,7 +358,7 @@ void compressFilelist(Header h) */ if (headerIsEntry(h, RPMTAG_DIRNAMES)) { - (void) hre(h, RPMTAG_OLDFILENAMES); + xx = hre(h, RPMTAG_OLDFILENAMES); return; /* Already converted. */ } @@ -413,16 +413,16 @@ void compressFilelist(Header h) exit: if (count > 0) { - (void) hae(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, dirIndexes, count); - (void) hae(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, + xx = hae(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, dirIndexes, count); + xx = hae(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, baseNames, count); - (void) hae(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, + xx = hae(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, dirNames, dirIndex + 1); } fileNames = hfd(fileNames, fnt); - (void) hre(h, RPMTAG_OLDFILENAMES); + xx = hre(h, RPMTAG_OLDFILENAMES); } /* @@ -444,7 +444,7 @@ static void doBuildFileList(Header h, /*@out@*/ const char *** fileListPtr, int size; rpmTagType bnt, dnt; char * data; - int i; + int i, xx; if (!hge(h, baseNameTag, &bnt, (void **) &baseNames, &count)) { if (fileListPtr) *fileListPtr = NULL; @@ -452,8 +452,8 @@ static void doBuildFileList(Header h, /*@out@*/ const char *** fileListPtr, return; /* no file list */ } - (void) hge(h, dirNameTag, &dnt, (void **) &dirNames, NULL); - (void) hge(h, dirIndexesTag, NULL, (void **) &dirIndexes, &count); + xx = hge(h, dirNameTag, &dnt, (void **) &dirNames, NULL); + xx = hge(h, dirIndexesTag, NULL, (void **) &dirIndexes, &count); size = sizeof(*fileNames) * count; for (i = 0; i < count; i++) @@ -484,6 +484,7 @@ void expandFilelist(Header h) HRE_t hre = (HRE_t)headerRemoveEntry; const char ** fileNames = NULL; int count = 0; + int xx; /*@-branchstate@*/ if (!headerIsEntry(h, RPMTAG_OLDFILENAMES)) { @@ -491,15 +492,15 @@ void expandFilelist(Header h) RPMTAG_DIRNAMES, RPMTAG_DIRINDEXES); if (fileNames == NULL || count <= 0) return; - (void) hae(h, RPMTAG_OLDFILENAMES, RPM_STRING_ARRAY_TYPE, + xx = hae(h, RPMTAG_OLDFILENAMES, RPM_STRING_ARRAY_TYPE, fileNames, count); fileNames = _free(fileNames); } /*@=branchstate@*/ - (void) hre(h, RPMTAG_DIRNAMES); - (void) hre(h, RPMTAG_BASENAMES); - (void) hre(h, RPMTAG_DIRINDEXES); + xx = hre(h, RPMTAG_DIRNAMES); + xx = hre(h, RPMTAG_BASENAMES); + xx = hre(h, RPMTAG_DIRINDEXES); } @@ -764,11 +765,11 @@ void providePackageNVR(Header h) rpmTagType pnt, pvt; int_32 * provideFlags = NULL; int providesCount; - int i; + int i, xx; int bingo = 1; /* Generate provides for this package name-version-release. */ - (void) headerNVR(h, &name, &version, &release); + xx = headerNVR(h, &name, &version, &release); if (!(name && version && release)) return; pEVR = p = alloca(21 + strlen(version) + 1 + strlen(release) + 1); @@ -794,15 +795,15 @@ void providePackageNVR(Header h) for (i = 0; i < providesCount; i++) { char * vdummy = ""; int_32 fdummy = RPMSENSE_ANY; - (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, + xx = headerAddOrAppendEntry(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, &vdummy, 1); - (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, + xx = headerAddOrAppendEntry(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, &fdummy, 1); } goto exit; } - (void) hge(h, RPMTAG_PROVIDEFLAGS, NULL, (void **) &provideFlags, NULL); + xx = hge(h, RPMTAG_PROVIDEFLAGS, NULL, (void **) &provideFlags, NULL); if (provides && providesEVR && provideFlags) for (i = 0; i < providesCount; i++) { @@ -820,11 +821,11 @@ exit: providesEVR = hfd(providesEVR, pvt); if (bingo) { - (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDENAME, RPM_STRING_ARRAY_TYPE, + xx = headerAddOrAppendEntry(h, RPMTAG_PROVIDENAME, RPM_STRING_ARRAY_TYPE, &name, 1); - (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, + xx = headerAddOrAppendEntry(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, &pFlags, 1); - (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, + xx = headerAddOrAppendEntry(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, &pEVR, 1); } } diff --git a/lib/package.c b/lib/package.c index 42be6dc..9c4f989 100644 --- a/lib/package.c +++ b/lib/package.c @@ -24,6 +24,7 @@ void headerMergeLegacySigs(Header h, const Header sig) HeaderIterator hi; int_32 tag, type, count; const void * ptr; + int xx; /*@-mods@*/ /* FIX: undocumented modification of sig */ for (hi = headerInitIterator(sig); @@ -60,7 +61,7 @@ void headerMergeLegacySigs(Header h, const Header sig) } if (ptr == NULL) continue; /* XXX can't happen */ if (!headerIsEntry(h, tag)) - (void) hae(h, tag, type, ptr, count); + xx = hae(h, tag, type, ptr, count); } hi = headerFreeIterator(hi); } @@ -72,6 +73,7 @@ Header headerRegenSigHeader(const Header h) HeaderIterator hi; int_32 tag, stag, type, count; const void * ptr; + int xx; /*@-mods@*/ /* FIX: undocumented modification of h */ for (hi = headerInitIterator(h); @@ -109,7 +111,7 @@ Header headerRegenSigHeader(const Header h) } if (ptr == NULL) continue; /* XXX can't happen */ if (!headerIsEntry(sig, stag)) - (void) headerAddEntry(sig, stag, type, ptr, count); + xx = headerAddEntry(sig, stag, type, ptr, count); } hi = headerFreeIterator(hi); return sig; diff --git a/lib/psm.c b/lib/psm.c index 7a2ccaf..522c066 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -57,15 +57,15 @@ int rpmVersionCompare(Header first, Header second) return 1; } - (void) headerGetEntry(first, RPMTAG_VERSION, NULL, (void **) &one, NULL); - (void) headerGetEntry(second, RPMTAG_VERSION, NULL, (void **) &two, NULL); + rc = headerGetEntry(first, RPMTAG_VERSION, NULL, (void **) &one, NULL); + rc = headerGetEntry(second, RPMTAG_VERSION, NULL, (void **) &two, NULL); rc = rpmvercmp(one, two); if (rc) return rc; - (void) headerGetEntry(first, RPMTAG_RELEASE, NULL, (void **) &one, NULL); - (void) headerGetEntry(second, RPMTAG_RELEASE, NULL, (void **) &two, NULL); + rc = headerGetEntry(first, RPMTAG_RELEASE, NULL, (void **) &one, NULL); + rc = headerGetEntry(second, RPMTAG_RELEASE, NULL, (void **) &two, NULL); return rpmvercmp(one, two); } @@ -321,7 +321,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) HME_t hme = (HME_t)fi->hme; HFD_t hfd = (fi->hfd ? fi->hfd : headerFreeData); fileAction * actions = fi->actions; - int i, j, k, fc; + int i, j, k, fc, xx; rpmTagType type = 0; int_32 count = 0; int_32 dirNamesCount, dirCount; @@ -354,16 +354,17 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_CONFLICTFLAGS }; - (void) hge(h, RPMTAG_SIZE, NULL, (void **) &fileSizes, NULL); + xx = hge(h, RPMTAG_SIZE, NULL, (void **) &fileSizes, NULL); fileSize = *fileSizes; - (void) hge(newH, RPMTAG_FILESIZES, NULL, (void **) &fileSizes, &count); + xx = hge(newH, RPMTAG_FILESIZES, NULL, (void **) &fileSizes, &count); for (i = 0, fc = 0; i < count; i++) if (actions[i] != FA_SKIPMULTILIB) { fc++; fileSize += fileSizes[i]; } - (void) hme(h, RPMTAG_SIZE, RPM_INT32_TYPE, &fileSize, 1); + xx = hme(h, RPMTAG_SIZE, RPM_INT32_TYPE, &fileSize, 1); + /*@-sizeoftype@*/ for (i = 0; mergeTags[i]; i++) { if (!hge(newH, mergeTags[i], &type, (void **) &data, &count)) continue; @@ -374,7 +375,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) for (j = 0, k = 0; j < count; j++) if (actions[j] != FA_SKIPMULTILIB) ((int_8 *) newdata)[k++] = ((int_8 *) data)[j]; - (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); + xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); /*@switchbreak@*/ break; case RPM_INT16_TYPE: @@ -382,7 +383,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) for (j = 0, k = 0; j < count; j++) if (actions[j] != FA_SKIPMULTILIB) ((int_16 *) newdata)[k++] = ((int_16 *) data)[j]; - (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); + xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); /*@switchbreak@*/ break; case RPM_INT32_TYPE: @@ -390,7 +391,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) for (j = 0, k = 0; j < count; j++) if (actions[j] != FA_SKIPMULTILIB) ((int_32 *) newdata)[k++] = ((int_32 *) data)[j]; - (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); + xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); /*@switchbreak@*/ break; case RPM_STRING_ARRAY_TYPE: @@ -398,7 +399,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) for (j = 0, k = 0; j < count; j++) if (actions[j] != FA_SKIPMULTILIB) ((char **) newdata)[k++] = ((char **) data)[j]; - (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); + xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); /*@switchbreak@*/ break; default: @@ -409,16 +410,17 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) } data = hfd(data, type); } - (void) hge(newH, RPMTAG_DIRINDEXES, NULL, (void **) &newDirIndexes, &count); - (void) hge(newH, RPMTAG_DIRNAMES, NULL, (void **) &newDirNames, NULL); - (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); - (void) hge(h, RPMTAG_DIRNAMES, NULL, (void **) &data, &dirNamesCount); + /*@=sizeoftype@*/ + xx = hge(newH, RPMTAG_DIRINDEXES, NULL, (void **) &newDirIndexes, &count); + xx = hge(newH, RPMTAG_DIRNAMES, NULL, (void **) &newDirNames, NULL); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + xx = hge(h, RPMTAG_DIRNAMES, NULL, (void **) &data, &dirNamesCount); - dirNames = xcalloc(dirNamesCount + fc, sizeof(char *)); + dirNames = xcalloc(dirNamesCount + fc, sizeof(*dirNames)); for (i = 0; i < dirNamesCount; i++) dirNames[i] = ((char **) data)[i]; dirCount = dirNamesCount; - newdata = xcalloc(fc, sizeof(int_32)); + newdata = xcalloc(fc, sizeof(*newDirIndexes)); for (i = 0, k = 0; i < count; i++) { if (actions[i] == FA_SKIPMULTILIB) continue; @@ -429,9 +431,9 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) dirNames[dirCount++] = newDirNames[newDirIndexes[i]]; ((int_32 *) newdata)[k++] = j; } - (void) headerAddOrAppendEntry(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, newdata, fc); + xx = headerAddOrAppendEntry(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, newdata, fc); if (dirCount > dirNamesCount) - (void) headerAddOrAppendEntry(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, + xx = headerAddOrAppendEntry(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, dirNames + dirNamesCount, dirCount - dirNamesCount); data = hfd(data, -1); @@ -448,12 +450,12 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) if (!hge(newH, requireTags[i], &nnt, (void **) &newNames, &newCount)) continue; - (void) hge(newH, requireTags[i+1], &nvt, (void **) &newEVR, NULL); - (void) hge(newH, requireTags[i+2], NULL, (void **) &newFlags, NULL); + xx = hge(newH, requireTags[i+1], &nvt, (void **) &newEVR, NULL); + xx = hge(newH, requireTags[i+2], NULL, (void **) &newFlags, NULL); if (hge(h, requireTags[i], &rnt, (void **) &Names, &Count)) { - (void) hge(h, requireTags[i+1], NULL, (void **) &EVR, NULL); - (void) hge(h, requireTags[i+2], NULL, (void **) &Flags, NULL); + xx = hge(h, requireTags[i+1], NULL, (void **) &EVR, NULL); + xx = hge(h, requireTags[i+2], NULL, (void **) &Flags, NULL); for (j = 0; j < newCount; j++) for (k = 0; k < Count; k++) if (!strcmp (newNames[j], Names[k]) @@ -476,11 +478,11 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) k++; } if (k) { - (void) headerAddOrAppendEntry(h, requireTags[i], + xx = headerAddOrAppendEntry(h, requireTags[i], RPM_STRING_ARRAY_TYPE, newNames, k); - (void) headerAddOrAppendEntry(h, requireTags[i+1], + xx = headerAddOrAppendEntry(h, requireTags[i+1], RPM_STRING_ARRAY_TYPE, newEVR, k); - (void) headerAddOrAppendEntry(h, requireTags[i+2], RPM_INT32_TYPE, + xx = headerAddOrAppendEntry(h, requireTags[i+2], RPM_INT32_TYPE, newFlags, k); } newNames = hfd(newNames, nnt); @@ -508,7 +510,7 @@ static int markReplacedFiles(PSM_t psm) Header h; unsigned int * offsets; unsigned int prev; - int num; + int num, xx; if (!(fi->fc > 0 && fi->replaced)) return 0; @@ -533,8 +535,8 @@ static int markReplacedFiles(PSM_t psm) } mi = rpmdbInitIterator(ts->rpmdb, RPMDBI_PACKAGES, NULL, 0); - (void) rpmdbAppendIterator(mi, offsets, num); - (void) rpmdbSetIteratorRewrite(mi, 1); + xx = rpmdbAppendIterator(mi, offsets, num); + xx = rpmdbSetIteratorRewrite(mi, 1); sfi = replaced; while ((h = rpmdbNextIterator(mi)) != NULL) { @@ -556,7 +558,7 @@ static int markReplacedFiles(PSM_t psm) if (modified == 0) { /* Modified header will be rewritten. */ modified = 1; - (void) rpmdbSetIteratorModified(mi, modified); + xx = rpmdbSetIteratorModified(mi, modified); } num++; } @@ -855,7 +857,7 @@ static int runScript(PSM_t psm, Header h, pid_t child; int status = 0; const char * fn = NULL; - int i; + int i, xx; int freePrefixes = 0; FD_t out; rpmRC rc = RPMRC_OK; @@ -865,16 +867,16 @@ static int runScript(PSM_t psm, Header h, return 0; if (!progArgv) { - argv = alloca(5 * sizeof(char *)); + argv = alloca(5 * sizeof(*argv)); argv[0] = "/bin/sh"; argc = 1; } else { - argv = alloca((progArgc + 4) * sizeof(char *)); - memcpy(argv, progArgv, progArgc * sizeof(char *)); + argv = alloca((progArgc + 4) * sizeof(*argv)); + memcpy(argv, progArgv, progArgc * sizeof(*argv)); argc = progArgc; } - (void) headerNVR(h, &n, &v, &r); + xx = headerNVR(h, &n, &v, &r); if (hge(h, RPMTAG_INSTPREFIXES, &ipt, (void **) &prefixes, &numPrefixes)) { freePrefixes = 1; } else if (hge(h, RPMTAG_INSTALLPREFIX, NULL, (void **) &oldPrefix, NULL)) { @@ -902,10 +904,13 @@ static int runScript(PSM_t psm, Header h, if (rpmIsDebug() && (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash"))) - (void) Fwrite("set -x\n", sizeof(char), 7, fd); + { + static const char set_x[] = "set -x\n"; + xx = Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd); + } - (void) Fwrite(script, sizeof(script[0]), strlen(script), fd); - (void) Fclose(fd); + xx = Fwrite(script, sizeof(script[0]), strlen(script), fd); + xx = Fclose(fd); { const char * sn = fn; if (!ts->chrootDone && @@ -953,25 +958,25 @@ static int runScript(PSM_t psm, Header h, pipes[0] = pipes[1] = 0; /* make stdin inaccessible */ - (void) pipe(pipes); - (void) close(pipes[1]); - (void) dup2(pipes[0], STDIN_FILENO); - (void) close(pipes[0]); + xx = pipe(pipes); + xx = close(pipes[1]); + xx = dup2(pipes[0], STDIN_FILENO); + xx = close(pipes[0]); /*@-branchstate@*/ if (ts->scriptFd != NULL) { int sfdno = Fileno(ts->scriptFd); int ofdno = Fileno(out); if (sfdno != STDERR_FILENO) - (void) dup2(sfdno, STDERR_FILENO); + xx = dup2(sfdno, STDERR_FILENO); if (ofdno != STDOUT_FILENO) - (void) dup2(ofdno, STDOUT_FILENO); + xx = dup2(ofdno, STDOUT_FILENO); /* make sure we don't close stdin/stderr/stdout by mistake! */ if (ofdno > STDERR_FILENO && ofdno != sfdno) { - (void) Fclose (out); + xx = Fclose (out); } if (sfdno > STDERR_FILENO) { - (void) Fclose (ts->scriptFd); + xx = Fclose (ts->scriptFd); } } /*@=branchstate@*/ @@ -983,7 +988,7 @@ static int runScript(PSM_t psm, Header h, if (ipath && ipath[5] != '%') path = ipath; - (void) doputenv(path); + xx = doputenv(path); /*@-modobserver@*/ ipath = _free(ipath); /*@=modobserver@*/ @@ -992,12 +997,12 @@ static int runScript(PSM_t psm, Header h, for (i = 0; i < numPrefixes; i++) { sprintf(prefixBuf, "RPM_INSTALL_PREFIX%d=%s", i, prefixes[i]); - (void) doputenv(prefixBuf); + xx = doputenv(prefixBuf); /* backwards compatibility */ if (i == 0) { sprintf(prefixBuf, "RPM_INSTALL_PREFIX=%s", prefixes[i]); - (void) doputenv(prefixBuf); + xx = doputenv(prefixBuf); } } @@ -1010,11 +1015,11 @@ static int runScript(PSM_t psm, Header h, case URL_IS_UNKNOWN: if (!ts->chrootDone && !(rootDir[0] == '/' && rootDir[1] == '\0')) { /*@-superuser -noeffect @*/ - (void) chroot(rootDir); + xx = chroot(rootDir); /*@=superuser =noeffect @*/ } - (void) chdir("/"); - (void) execv(argv[0], (char *const *)argv); + xx = chdir("/"); + xx = execv(argv[0], (char *const *)argv); break; default: break; @@ -1041,12 +1046,12 @@ static int runScript(PSM_t psm, Header h, if (freePrefixes) prefixes = hfd(prefixes, ipt); - (void) Fclose(out); /* XXX dup'd STDOUT_FILENO */ + xx = Fclose(out); /* XXX dup'd STDOUT_FILENO */ /*@-branchstate@*/ if (script) { if (!rpmIsDebug()) - (void) unlink(fn); + xx = unlink(fn); fn = _free(fn); } /*@=branchstate@*/ @@ -1073,17 +1078,18 @@ static rpmRC runInstScript(PSM_t psm) rpmTagType ptt, stt; const char * script; rpmRC rc = RPMRC_OK; + int xx; /* * headerGetEntry() sets the data pointer to NULL if the entry does * not exist. */ - (void) hge(fi->h, psm->progTag, &ptt, (void **) &programArgv, &programArgc); - (void) hge(fi->h, psm->scriptTag, &stt, (void **) &script, NULL); + xx = hge(fi->h, psm->progTag, &ptt, (void **) &programArgv, &programArgc); + xx = hge(fi->h, psm->scriptTag, &stt, (void **) &script, NULL); /*@-branchstate@*/ if (programArgv && ptt == RPM_STRING_TYPE) { - argv = alloca(sizeof(char *)); + argv = alloca(sizeof(*argv)); *argv = (const char *) programArgv; } else { argv = (const char **) programArgv; @@ -1127,7 +1133,7 @@ static int handleOneTrigger(PSM_t psm, Header sourceH, Header triggeredH, const char * sourceName; int numTriggers; rpmRC rc = RPMRC_OK; - int i; + int i, xx; int skip; if (!( hge(triggeredH, RPMTAG_TRIGGERNAME, &tnt, @@ -1139,7 +1145,7 @@ static int handleOneTrigger(PSM_t psm, Header sourceH, Header triggeredH, ) return 0; - (void) headerNVR(sourceH, &sourceName, NULL, NULL); + xx = headerNVR(sourceH, &sourceName, NULL, NULL); for (i = 0; i < numTriggers; i++) { rpmTagType tit, tst, tpt; @@ -1173,7 +1179,7 @@ static int handleOneTrigger(PSM_t psm, Header sourceH, Header triggeredH, ) continue; - (void) headerNVR(triggeredH, &triggerPackageName, NULL, NULL); + xx = headerNVR(triggeredH, &triggerPackageName, NULL, NULL); { int arg1; int index; @@ -1360,6 +1366,7 @@ int psmStage(PSM_t psm, pkgStage stage) HFD_t hfd = (fi->hfd ? fi->hfd : headerFreeData); rpmRC rc = psm->rc; int saveerrno; + int xx; /*@-branchstate@*/ switch (stage) { @@ -1386,9 +1393,9 @@ int psmStage(PSM_t psm, pkgStage stage) assert(psm->mi == NULL); psm->mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, fi->name, 0); - (void) rpmdbSetIteratorRE(psm->mi, RPMTAG_VERSION, + xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_VERSION, RPMMIRE_DEFAULT, fi->version); - (void) rpmdbSetIteratorRE(psm->mi, RPMTAG_RELEASE, + xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_RELEASE, RPMMIRE_DEFAULT, fi->release); while ((psm->oh = rpmdbNextIterator(psm->mi))) { @@ -1428,10 +1435,10 @@ assert(psm->mi == NULL); rpmBuildFileList(fi->h, &fi->apath, NULL); if (fi->fuser == NULL) - (void) hge(fi->h, RPMTAG_FILEUSERNAME, NULL, + xx = hge(fi->h, RPMTAG_FILEUSERNAME, NULL, (void **) &fi->fuser, NULL); if (fi->fgroup == NULL) - (void) hge(fi->h, RPMTAG_FILEGROUPNAME, NULL, + xx = hge(fi->h, RPMTAG_FILEGROUPNAME, NULL, (void **) &fi->fgroup, NULL); if (fi->fuids == NULL) fi->fuids = xcalloc(sizeof(*fi->fuids), fi->fc); @@ -1526,7 +1533,7 @@ assert(psm->mi == NULL); /* Add remove transaction id to header. */ if (psm->oh) { int_32 tid = ts->id; - (void) headerAddEntry(psm->oh, RPMTAG_REMOVETID, + xx = headerAddEntry(psm->oh, RPMTAG_REMOVETID, RPM_INT32_TYPE, &tid, 1); } @@ -1634,10 +1641,10 @@ assert(psm->mi == NULL); rc = fsmSetup(fi->fsm, FSM_PKGINSTALL, ts, fi, psm->cfd, NULL, &psm->failedFile); - (void) fsmTeardown(fi->fsm); + xx = fsmTeardown(fi->fsm); saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */ - (void) Fclose(psm->cfd); + xx = Fclose(psm->cfd); psm->cfd = NULL; errno = saveerrno; /* XXX FIXME: Fclose with libio destroys errno */ @@ -1656,7 +1663,7 @@ assert(psm->mi == NULL); psm->what = RPMCALLBACK_INST_PROGRESS; psm->amount = (fi->archiveSize ? fi->archiveSize : 100); psm->total = psm->amount; - (void) psmStage(psm, PSM_NOTIFY); + xx = psmStage(psm, PSM_NOTIFY); } if (psm->goal == PSM_PKGERASE) { @@ -1667,16 +1674,16 @@ assert(psm->mi == NULL); psm->what = RPMCALLBACK_UNINST_START; psm->amount = fi->fc; /* XXX W2DO? looks wrong. */ psm->total = fi->fc; - (void) psmStage(psm, PSM_NOTIFY); + xx = psmStage(psm, PSM_NOTIFY); rc = fsmSetup(fi->fsm, FSM_PKGERASE, ts, fi, NULL, NULL, &psm->failedFile); - (void) fsmTeardown(fi->fsm); + xx = fsmTeardown(fi->fsm); psm->what = RPMCALLBACK_UNINST_STOP; psm->amount = 0; /* XXX W2DO? looks wrong. */ psm->total = fi->fc; - (void) psmStage(psm, PSM_NOTIFY); + xx = psmStage(psm, PSM_NOTIFY); } if (psm->goal == PSM_PKGSAVE) { @@ -1691,7 +1698,7 @@ assert(psm->mi == NULL); break; } /*@-nullpass@*/ /* LCL: psm->fd != NULL here. */ - (void) Fflush(psm->fd); + xx = Fflush(psm->fd); psm->cfd = Fdopen(fdDup(Fileno(psm->fd)), psm->rpmio_flags); /*@=nullpass@*/ if (psm->cfd == NULL) { /* XXX can't happen */ @@ -1701,10 +1708,10 @@ assert(psm->mi == NULL); rc = fsmSetup(fi->fsm, FSM_PKGBUILD, ts, fi, psm->cfd, NULL, &psm->failedFile); - (void) fsmTeardown(fi->fsm); + xx = fsmTeardown(fi->fsm); saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */ - (void) Fclose(psm->cfd); + xx = Fclose(psm->cfd); psm->cfd = NULL; errno = saveerrno; @@ -1719,10 +1726,10 @@ assert(psm->mi == NULL); int_32 installTime = (int_32) time(NULL); if (fi->fstates != NULL && fi->fc > 0) - (void) headerAddEntry(fi->h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, + xx = headerAddEntry(fi->h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, fi->fstates, fi->fc); - (void) headerAddEntry(fi->h, RPMTAG_INSTALLTIME, RPM_INT32_TYPE, + xx = headerAddEntry(fi->h, RPMTAG_INSTALLTIME, RPM_INT32_TYPE, &installTime, 1); if (ts->transFlags & RPMTRANS_FLAG_MULTILIB) { @@ -1735,7 +1742,7 @@ assert(psm->mi == NULL); { multiLib = *p; multiLib |= *newMultiLib; - (void) hme(psm->oh, RPMTAG_MULTILIBS, RPM_INT32_TYPE, + xx = hme(psm->oh, RPMTAG_MULTILIBS, RPM_INT32_TYPE, &multiLib, 1); } rc = mergeFiles(fi, psm->oh, fi->h); @@ -1803,17 +1810,17 @@ assert(psm->mi == NULL); } /* Restore root directory if changed. */ - (void) psmStage(psm, PSM_CHROOT_OUT); + xx = psmStage(psm, PSM_CHROOT_OUT); break; case PSM_UNDO: break; case PSM_FINI: /* Restore root directory if changed. */ - (void) psmStage(psm, PSM_CHROOT_OUT); + xx = psmStage(psm, PSM_CHROOT_OUT); if (psm->fd) { saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */ - (void) Fclose(psm->fd); + xx = Fclose(psm->fd); psm->fd = NULL; errno = saveerrno; } @@ -1861,7 +1868,7 @@ assert(psm->mi == NULL); if (!rc) rc = psmStage(psm, PSM_PRE); if (!rc) rc = psmStage(psm, PSM_PROCESS); if (!rc) rc = psmStage(psm, PSM_POST); - (void) psmStage(psm, PSM_FINI); + xx = psmStage(psm, PSM_FINI); break; case PSM_PKGCOMMIT: break; @@ -1869,9 +1876,12 @@ assert(psm->mi == NULL); case PSM_CREATE: break; case PSM_NOTIFY: - if (ts && ts->notify) + if (ts && ts->notify) { + /*@-noeffectuncon @*/ /* FIX: check rc */ (void) ts->notify(fi->h, psm->what, psm->amount, psm->total, (fi->ap ? fi->ap->key : NULL), ts->notifyData); + /*@=noeffectuncon @*/ + } break; case PSM_DESTROY: break; @@ -1881,7 +1891,7 @@ assert(psm->mi == NULL); rc = fsmSetup(fi->fsm, FSM_PKGCOMMIT, ts, fi, NULL, NULL, &psm->failedFile); - (void) fsmTeardown(fi->fsm); + xx = fsmTeardown(fi->fsm); break; case PSM_CHROOT_IN: @@ -1899,7 +1909,7 @@ assert(psm->mi == NULL); _loaded++; } - (void) chdir("/"); + xx = chdir("/"); /*@-superuser@*/ rc = chroot(ts->rootDir); /*@=superuser@*/ @@ -1919,7 +1929,7 @@ assert(psm->mi == NULL); psm->chrootDone = ts->chrootDone = 0; if (ts->rpmdb != NULL) ts->rpmdb->db_chrootDone = 0; chroot_prefix = NULL; - (void) chdir(ts->currDir); + xx = chdir(ts->currDir); } break; case PSM_SCRIPT: diff --git a/lib/query.c b/lib/query.c index cc0da5e..6225c9f 100644 --- a/lib/query.c +++ b/lib/query.c @@ -692,8 +692,11 @@ restart: break; } - for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) + for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { + /*@-noeffectuncon@*/ /* FIX: check rc */ (void) showPackage(qva, NULL, pkg->header); + /*@=noeffectuncon@*/ + } spec = freeSpecVec(spec); } break; diff --git a/lib/rpmlead.c b/lib/rpmlead.c index d9e0a44..ddc7744 100644 --- a/lib/rpmlead.c +++ b/lib/rpmlead.c @@ -33,9 +33,11 @@ int writeLead(FD_t fd, const struct rpmlead *lead) l.osnum = htons(l.osnum); l.signature_type = htons(l.signature_type); + /*@-sizeoftype@*/ if (Fwrite(&l, sizeof(char), sizeof(l), fd) != sizeof(l)) { return 1; } + /*@=sizeoftype@*/ return 0; } diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 5105ff4..82ddcbd 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -332,7 +332,7 @@ static int addCanon(canonEntry * table, int * tableLen, char * line, (*tableLen) += 2; /*@-unqualifiedtrans@*/ - *table = xrealloc(*table, sizeof(struct canonEntry_s) * (*tableLen)); + *table = xrealloc(*table, sizeof(**table) * (*tableLen)); /*@=unqualifiedtrans@*/ t = & ((*table)[*tableLen - 2]); @@ -382,7 +382,7 @@ static int addDefault(defaultEntry * table, int * tableLen, char * line, (*tableLen)++; /*@-unqualifiedtrans@*/ - *table = xrealloc(*table, sizeof(struct defaultEntry_s) * (*tableLen)); + *table = xrealloc(*table, sizeof(**table) * (*tableLen)); /*@=unqualifiedtrans@*/ t = & ((*table)[*tableLen - 1]); @@ -737,7 +737,7 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * urlfn) /* Find keyword in table */ searchOption.name = s; option = bsearch(&searchOption, optionTable, optionTableSize, - sizeof(struct rpmOption), optionCompare); + sizeof(optionTable[0]), optionCompare); if (option) { /* For configuration variables ... */ const char *arch, *val, *fn; diff --git a/lib/signature.c b/lib/signature.c index 22c35ca..751c2b0 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -125,6 +125,7 @@ static inline rpmRC checkSize(FD_t fd, int siglen, int pad, int datalen) return RPMRC_OK; } + /*@-sizeoftype@*/ rc = (((sizeof(struct rpmlead) + siglen + pad + datalen) - st.st_size) ? RPMRC_BADSIZE : RPMRC_OK); @@ -132,6 +133,7 @@ static inline rpmRC checkSize(FD_t fd, int siglen, int pad, int datalen) _("Expected size: %12d = lead(%d)+sigs(%d)+pad(%d)+data(%d)\n"), (int)sizeof(struct rpmlead)+siglen+pad+datalen, (int)sizeof(struct rpmlead), siglen, pad, datalen); + /*@=sizeoftype@*/ rpmMessage((rc == RPMRC_OK ? RPMMESS_DEBUG : RPMMESS_WARNING), _(" Actual size: %12d\n"), (int)st.st_size); @@ -488,7 +490,9 @@ verifyMD5Signature(const char * datafile, const byte * sig, byte md5sum[16]; memset(md5sum, 0, sizeof(md5sum)); + /*@-noeffectuncon@*/ /* FIX: check rc */ (void) fn(datafile, md5sum); + /*@=noeffectuncon@*/ if (memcmp(md5sum, sig, 16)) { sprintf(result, "MD5 sum mismatch\n" "Expected: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" @@ -518,7 +522,7 @@ verifyMD5Signature(const char * datafile, const byte * sig, /*@=globuse@*/ static rpmVerifySignatureReturn -verifyPGPSignature(const char * datafile, const void * sig, int count, +verifyPGPSignature(const char * datafile, const byte * sig, int count, /*@unused@*/ const rpmDigest dig, /*@out@*/ char * result) /*@globals rpmGlobalMacroContext, fileSystem, internalState@*/ @@ -575,7 +579,7 @@ fprintf(stderr, "=============================== RSA verify %s: rc %d\n", #else { FD_t sfd; if (!makeTempFile(NULL, &sigfile, &sfd)) { - (void) Fwrite(sig, sizeof(char), count, sfd); + (void) Fwrite(sig, sizeof(*sig), count, sfd); (void) Fclose(sfd); sfd = NULL; } @@ -663,7 +667,7 @@ fprintf(stderr, "=============================== RSA verify %s: rc %d\n", } static rpmVerifySignatureReturn -verifyGPGSignature(const char * datafile, const void * sig, int count, +verifyGPGSignature(const char * datafile, const byte * sig, int count, /*@unused@*/ const rpmDigest dig, /*@out@*/ char * result) /*@globals rpmGlobalMacroContext, fileSystem, internalState@*/ @@ -707,7 +711,7 @@ fprintf(stderr, "=============================== DSA verify %s: rc %d\n", #else { FD_t sfd; if (!makeTempFile(NULL, &sigfile, &sfd)) { - (void) Fwrite(sig, sizeof(char), count, sfd); + (void) Fwrite(sig, sizeof(*sig), count, sfd); (void) Fclose(sfd); sfd = NULL; } diff --git a/lib/stringbuf.c b/lib/stringbuf.c index 6e550f4..6cb8169 100644 --- a/lib/stringbuf.c +++ b/lib/stringbuf.c @@ -37,7 +37,7 @@ _free(/*@only@*/ /*@null@*/ /*@out@*/ const void * p) /*@modifies *p @*/ StringBuf newStringBuf(void) { - StringBuf sb = xmalloc(sizeof(struct StringBufRec)); + StringBuf sb = xmalloc(sizeof(*sb)); sb->free = sb->allocated = BUF_CHUNK; sb->buf = xcalloc(sb->allocated, sizeof(*sb->buf)); diff --git a/lib/transaction.c b/lib/transaction.c index 641df90..43420dd 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -367,7 +367,7 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, int haveRelocatedFile = 0; int reldel = 0; int len; - int i, j; + int i, j, xx; if (!hge(origH, RPMTAG_PREFIXES, &validType, (void **) &validRelocations, &numValid)) @@ -388,7 +388,7 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, if (rawRelocations == NULL || numRelocations == 0) { if (numValid) { if (!headerIsEntry(origH, RPMTAG_INSTPREFIXES)) - (void) hae(origH, RPMTAG_INSTPREFIXES, + xx = hae(origH, RPMTAG_INSTPREFIXES, validType, validRelocations, numValid); validRelocations = hfd(validRelocations, validType); } @@ -510,18 +510,18 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, } if (numActual) - (void) hae(h, RPMTAG_INSTPREFIXES, RPM_STRING_ARRAY_TYPE, + xx = hae(h, RPMTAG_INSTPREFIXES, RPM_STRING_ARRAY_TYPE, (void **) actualRelocations, numActual); actualRelocations = _free(actualRelocations); validRelocations = hfd(validRelocations, validType); } - (void) hge(h, RPMTAG_BASENAMES, NULL, (void **) &baseNames, &fileCount); - (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); - (void) hge(h, RPMTAG_DIRNAMES, NULL, (void **) &dirNames, &dirCount); - (void) hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fFlags, NULL); - (void) hge(h, RPMTAG_FILEMODES, NULL, (void **) &fModes, NULL); + xx = hge(h, RPMTAG_BASENAMES, NULL, (void **) &baseNames, &fileCount); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + xx = hge(h, RPMTAG_DIRNAMES, NULL, (void **) &dirNames, &dirCount); + xx = hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fFlags, NULL); + xx = hge(h, RPMTAG_FILEMODES, NULL, (void **) &fModes, NULL); skipDirList = alloca(dirCount * sizeof(*skipDirList)); memset(skipDirList, 0, dirCount * sizeof(*skipDirList)); @@ -718,33 +718,33 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, rpmTagType t; p = NULL; - (void) hge(h, RPMTAG_BASENAMES, &t, &p, &c); - (void) hae(h, RPMTAG_ORIGBASENAMES, t, p, c); + xx = hge(h, RPMTAG_BASENAMES, &t, &p, &c); + xx = hae(h, RPMTAG_ORIGBASENAMES, t, p, c); p = hfd(p, t); p = NULL; - (void) hge(h, RPMTAG_DIRNAMES, &t, &p, &c); - (void) hae(h, RPMTAG_ORIGDIRNAMES, t, p, c); + xx = hge(h, RPMTAG_DIRNAMES, &t, &p, &c); + xx = hae(h, RPMTAG_ORIGDIRNAMES, t, p, c); p = hfd(p, t); p = NULL; - (void) hge(h, RPMTAG_DIRINDEXES, &t, &p, &c); - (void) hae(h, RPMTAG_ORIGDIRINDEXES, t, p, c); + xx = hge(h, RPMTAG_DIRINDEXES, &t, &p, &c); + xx = hae(h, RPMTAG_ORIGDIRINDEXES, t, p, c); p = hfd(p, t); - (void) hme(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, + xx = hme(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, baseNames, fileCount); fi->bnl = hfd(fi->bnl, RPM_STRING_ARRAY_TYPE); - (void) hge(h, RPMTAG_BASENAMES, NULL, (void **) &fi->bnl, &fi->fc); + xx = hge(h, RPMTAG_BASENAMES, NULL, (void **) &fi->bnl, &fi->fc); - (void) hme(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, + xx = hme(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, dirNames, dirCount); fi->dnl = hfd(fi->dnl, RPM_STRING_ARRAY_TYPE); - (void) hge(h, RPMTAG_DIRNAMES, NULL, (void **) &fi->dnl, &fi->dc); + xx = hge(h, RPMTAG_DIRNAMES, NULL, (void **) &fi->dnl, &fi->dc); - (void) hme(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, + xx = hme(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, dirIndexes, fileCount); - (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &fi->dil, NULL); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &fi->dil, NULL); } baseNames = hfd(baseNames, RPM_STRING_ARRAY_TYPE); @@ -961,6 +961,7 @@ static int handleInstInstalledFiles(TFI_t fi, /*@null@*/ rpmdb db, uint_32 * otherSizes; uint_16 * otherModes; int numReplaced = 0; + int xx; rpmdbMatchIterator mi; @@ -971,12 +972,12 @@ static int handleInstInstalledFiles(TFI_t fi, /*@null@*/ rpmdb db, return 1; } - (void) hge(h, RPMTAG_FILEMD5S, &omtype, (void **) &otherMd5s, NULL); - (void) hge(h, RPMTAG_FILELINKTOS, &oltype, (void **) &otherLinks, NULL); - (void) hge(h, RPMTAG_FILESTATES, NULL, (void **) &otherStates, NULL); - (void) hge(h, RPMTAG_FILEMODES, NULL, (void **) &otherModes, NULL); - (void) hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &otherFlags, NULL); - (void) hge(h, RPMTAG_FILESIZES, NULL, (void **) &otherSizes, NULL); + xx = hge(h, RPMTAG_FILEMD5S, &omtype, (void **) &otherMd5s, NULL); + xx = hge(h, RPMTAG_FILELINKTOS, &oltype, (void **) &otherLinks, NULL); + xx = hge(h, RPMTAG_FILESTATES, NULL, (void **) &otherStates, NULL); + xx = hge(h, RPMTAG_FILEMODES, NULL, (void **) &otherModes, NULL); + xx = hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &otherFlags, NULL); + xx = hge(h, RPMTAG_FILESIZES, NULL, (void **) &otherSizes, NULL); fi->replaced = xmalloc(sharedCount * sizeof(*fi->replaced)); @@ -1049,7 +1050,7 @@ static int handleRmvdInstalledFiles(TFI_t fi, /*@null@*/ rpmdb db, HGE_t hge = fi->hge; Header h; const char * otherStates; - int i; + int i, xx; rpmdbMatchIterator mi; @@ -1061,7 +1062,7 @@ static int handleRmvdInstalledFiles(TFI_t fi, /*@null@*/ rpmdb db, return 1; } - (void) hge(h, RPMTAG_FILESTATES, NULL, (void **) &otherStates, NULL); + xx = hge(h, RPMTAG_FILESTATES, NULL, (void **) &otherStates, NULL); for (i = 0; i < sharedCount; i++, shared++) { int otherFileNum, fileNum; @@ -1606,6 +1607,7 @@ int rpmRunTransactions( rpmTransactionSet ts, struct psm_s psmbuf; PSM_t psm = &psmbuf; void * tsi; + int xx; /* FIXME: what if the same package is included in ts twice? */ @@ -1683,7 +1685,7 @@ int rpmRunTransactions( rpmTransactionSet ts, ts->di[i].iavail = !(sfb.f_ffree == 0 && sfb.f_files == 0) ? sfb.f_ffree : -1; - (void) stat(ts->filesystems[i], &sb); + xx = stat(ts->filesystems[i], &sb); ts->di[i].dev = sb.st_dev; } } @@ -1716,7 +1718,7 @@ int rpmRunTransactions( rpmTransactionSet ts, Header oldH; mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, alp->name, 0); while ((oldH = rpmdbNextIterator(mi)) != NULL) - (void) ensureOlder(alp, oldH, ts->probs); + xx = ensureOlder(alp, oldH, ts->probs); mi = rpmdbFreeIterator(mi); } @@ -1724,9 +1726,9 @@ int rpmRunTransactions( rpmTransactionSet ts, if (!(ts->ignoreSet & RPMPROB_FILTER_REPLACEPKG) && !alp->multiLib) { rpmdbMatchIterator mi; mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, alp->name, 0); - (void) rpmdbSetIteratorRE(mi, RPMTAG_VERSION, + xx = rpmdbSetIteratorRE(mi, RPMTAG_VERSION, RPMMIRE_DEFAULT, alp->version); - (void) rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, + xx = rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_DEFAULT, alp->release); while (rpmdbNextIterator(mi) != NULL) { @@ -1749,7 +1751,7 @@ int rpmRunTransactions( rpmTransactionSet ts, int fileCount; mi = rpmdbInitIterator(ts->rpmdb, RPMDBI_PACKAGES, NULL, 0); - (void) rpmdbAppendIterator(mi, ts->removedPackages, ts->numRemovedPackages); + xx = rpmdbAppendIterator(mi, ts->removedPackages, ts->numRemovedPackages); while ((h = rpmdbNextIterator(mi)) != NULL) { if (headerGetEntry(h, RPMTAG_BASENAMES, NULL, NULL, &fileCount)) totalFileCount += fileCount; @@ -1822,9 +1824,9 @@ int rpmRunTransactions( rpmTransactionSet ts, tsi = tsFreeIterator(tsi); if (!ts->chrootDone) { - (void) chdir("/"); + xx = chdir("/"); /*@-superuser -noeffect @*/ - (void) chroot(ts->rootDir); + xx = chroot(ts->rootDir); /*@=superuser =noeffect @*/ ts->chrootDone = 1; if (ts->rpmdb) ts->rpmdb->db_chrootDone = 1; @@ -1852,8 +1854,10 @@ int rpmRunTransactions( rpmTransactionSet ts, } tsi = tsFreeIterator(tsi); + /*@-noeffectuncon @*/ /* FIX: check rc */ NOTIFY(ts, (NULL, RPMCALLBACK_TRANS_START, 6, ts->flEntries, NULL, ts->notifyData)); + /*@=noeffectuncon@*/ /* =============================================== * Compute file disposition for each package in transaction set. @@ -1863,8 +1867,10 @@ int rpmRunTransactions( rpmTransactionSet ts, dbiIndexSet * matches; int knownBad; + /*@-noeffectuncon @*/ /* FIX: check rc */ NOTIFY(ts, (NULL, RPMCALLBACK_TRANS_PROGRESS, (fi - ts->flList), ts->flEntries, NULL, ts->notifyData)); + /*@=noeffectuncon@*/ if (fi->fc == 0) continue; @@ -1938,13 +1944,13 @@ int rpmRunTransactions( rpmTransactionSet ts, /* Determine the fate of each file. */ switch (fi->type) { case TR_ADDED: - (void) handleInstInstalledFiles(fi, ts->rpmdb, shared, nexti - i, + xx = handleInstInstalledFiles(fi, ts->rpmdb, shared, nexti - i, !(beingRemoved || (ts->ignoreSet & RPMPROB_FILTER_REPLACEOLDFILES)), ts->probs, ts->transFlags); /*@switchbreak@*/ break; case TR_REMOVED: if (!beingRemoved) - (void) handleRmvdInstalledFiles(fi, ts->rpmdb, shared, nexti - i); + xx = handleRmvdInstalledFiles(fi, ts->rpmdb, shared, nexti - i); /*@switchbreak@*/ break; } } @@ -1988,16 +1994,18 @@ int rpmRunTransactions( rpmTransactionSet ts, if (ts->chrootDone) { /*@-superuser -noeffect @*/ - (void) chroot("."); + xx = chroot("."); /*@=superuser =noeffect @*/ ts->chrootDone = 0; if (ts->rpmdb) ts->rpmdb->db_chrootDone = 0; chroot_prefix = NULL; - (void) chdir(ts->currDir); + xx = chdir(ts->currDir); } + /*@-noeffectuncon @*/ /* FIX: check rc */ NOTIFY(ts, (NULL, RPMCALLBACK_TRANS_STOP, 6, ts->flEntries, NULL, ts->notifyData)); + /*@=noeffectuncon @*/ /* =============================================== * Free unused memory as soon as possible. @@ -2043,7 +2051,7 @@ int rpmRunTransactions( rpmTransactionSet ts, case TR_REMOVED: /*@-globs@*/ /* FIX: rpmGlobalMacroContext not in */ if (ts->transFlags & RPMTRANS_FLAG_REPACKAGE) - (void) psmStage(psm, PSM_PKGSAVE); + xx = psmStage(psm, PSM_PKGSAVE); /*@=globs@*/ /*@switchbreak@*/ break; } @@ -2083,8 +2091,10 @@ assert(alp == fi->ap); rpmrc = rpmReadPackageHeader(alp->fd, &h, NULL, NULL, NULL); /*@=mustmod@*/ if (!(rpmrc == RPMRC_OK || rpmrc == RPMRC_BADSIZE)) { + /*@-noeffectuncon @*/ /* FIX: check rc */ (void)ts->notify(fi->h, RPMCALLBACK_INST_CLOSE_FILE, 0, 0, alp->key, ts->notifyData); + /*@=noeffectuncon @*/ alp->fd = NULL; ourrc++; } else { @@ -2129,8 +2139,10 @@ assert(alp == fi->ap); h = headerFree(h); if (gotfd) { + /*@-noeffectuncon @*/ /* FIX: check rc */ (void)ts->notify(fi->h, RPMCALLBACK_INST_CLOSE_FILE, 0, 0, alp->key, ts->notifyData); + /*@=noeffectuncon @*/ alp->fd = NULL; } /*@switchbreak@*/ break; @@ -2147,7 +2159,7 @@ assert(alp == fi->ap); /*@switchbreak@*/ break; } - (void) rpmdbSync(ts->rpmdb); + xx = rpmdbSync(ts->rpmdb); } tsi = tsFreeIterator(tsi); diff --git a/lib/verify.c b/lib/verify.c index bce3341..e2d5254 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -34,7 +34,7 @@ int rpmVerifyFile(const char * root, Header h, int filenum, int rc; struct stat sb; - (void) hge(h, RPMTAG_FILEMODES, NULL, (void **) &modeList, &count); + rc = hge(h, RPMTAG_FILEMODES, NULL, (void **) &modeList, &count); if (hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlags, NULL)) fileAttrs = fileFlags[filenum]; @@ -145,8 +145,7 @@ int rpmVerifyFile(const char * root, Header h, int filenum, if (!hge(h, RPMTAG_FILEMD5S, &mdt, (void **) &md5List, NULL)) *result |= RPMVERIFY_MD5; else { - rc = mdfile(filespec, md5sum); - + rc = mdfile(filespec, md5sum); if (rc) *result |= (RPMVERIFY_READFAIL|RPMVERIFY_MD5); else if (strcmp(md5sum, md5List[filenum])) @@ -251,7 +250,7 @@ int rpmVerifyFile(const char * root, Header h, int filenum, gid_t gid; if (hge(h, RPMTAG_FILEGROUPNAME, &gnt, (void **) &gnameList, NULL)) { - rc = gnameToGid(gnameList[filenum], &gid); + rc = gnameToGid(gnameList[filenum], &gid); if (rc || (gid != sb.st_gid)) *result |= RPMVERIFY_GROUP; gnameList = hfd(gnameList, gnt); diff --git a/po/rpm.pot b/po/rpm.pot index fea9967..0a8637f 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-10-15 17:04-0400\n" +"POT-Creation-Date: 2001-10-16 10:48-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1225,7 +1225,7 @@ msgstr "" msgid "no tar files given for build" msgstr "" -#: build/build.c:125 build/pack.c:467 +#: build/build.c:125 build/pack.c:469 msgid "Unable to open temp file.\n" msgstr "" @@ -1388,93 +1388,93 @@ msgstr "" msgid "File listed twice: %s\n" msgstr "" -#: build/files.c:1280 +#: build/files.c:1282 #, c-format msgid "Symlink points to BuildRoot: %s -> %s\n" msgstr "" -#: build/files.c:1485 +#: build/files.c:1487 #, c-format msgid "File doesn't match prefix (%s): %s\n" msgstr "" -#: build/files.c:1509 +#: build/files.c:1511 #, c-format msgid "File not found: %s\n" msgstr "" -#: build/files.c:1552 build/files.c:2164 build/parsePrep.c:50 +#: build/files.c:1554 build/files.c:2166 build/parsePrep.c:50 #, c-format msgid "Bad owner/group: %s\n" msgstr "" -#: build/files.c:1564 +#: build/files.c:1566 #, c-format msgid "File %4d: %07o %s.%s\t %s\n" msgstr "" -#: build/files.c:1668 +#: build/files.c:1670 #, c-format msgid "File needs leading \"/\": %s\n" msgstr "" -#: build/files.c:1691 +#: build/files.c:1693 #, c-format msgid "Glob not permitted: %s\n" msgstr "" -#: build/files.c:1706 +#: build/files.c:1708 #, c-format msgid "File not found by glob: %s\n" msgstr "" -#: build/files.c:1768 +#: build/files.c:1770 #, c-format msgid "Could not open %%files file %s: %s\n" msgstr "" -#: build/files.c:1779 build/pack.c:148 +#: build/files.c:1781 build/pack.c:148 #, c-format msgid "line: %s\n" msgstr "" -#: build/files.c:2152 +#: build/files.c:2154 #, c-format msgid "Bad file: %s: %s\n" msgstr "" #. XXX this error message is probably not seen. -#: build/files.c:2224 +#: build/files.c:2226 #, c-format msgid "Couldn't exec %s: %s\n" msgstr "" -#: build/files.c:2229 +#: build/files.c:2231 #, c-format msgid "Couldn't fork %s: %s\n" msgstr "" -#: build/files.c:2311 +#: build/files.c:2313 #, c-format msgid "%s failed\n" msgstr "" -#: build/files.c:2315 +#: build/files.c:2317 #, c-format msgid "failed to write all data to %s\n" msgstr "" -#: build/files.c:2450 +#: build/files.c:2452 #, c-format msgid "Finding %s: (using %s)...\n" msgstr "" -#: build/files.c:2476 build/files.c:2490 +#: build/files.c:2478 build/files.c:2492 #, c-format msgid "Failed to find %s:\n" msgstr "" -#: build/files.c:2611 +#: build/files.c:2613 #, c-format msgid "Processing files: %s-%s-%s\n" msgstr "" @@ -1563,97 +1563,97 @@ msgstr "" msgid "readRPM: open %s: %s\n" msgstr "" -#: build/pack.c:297 +#: build/pack.c:298 #, c-format msgid "readRPM: read %s: %s\n" msgstr "" -#: build/pack.c:305 build/pack.c:509 +#: build/pack.c:307 build/pack.c:511 #, c-format msgid "%s: Fseek failed: %s\n" msgstr "" -#: build/pack.c:321 +#: build/pack.c:323 #, c-format msgid "readRPM: %s is not an RPM package\n" msgstr "" -#: build/pack.c:330 +#: build/pack.c:332 #, c-format msgid "readRPM: reading header from %s\n" msgstr "" -#: build/pack.c:455 +#: build/pack.c:457 msgid "Unable to create immutable header region.\n" msgstr "" -#: build/pack.c:473 +#: build/pack.c:475 msgid "Unable to write temp header\n" msgstr "" -#: build/pack.c:481 +#: build/pack.c:483 msgid "Bad CSA data\n" msgstr "" -#: build/pack.c:516 +#: build/pack.c:518 msgid "Unable to write final header\n" msgstr "" -#: build/pack.c:534 +#: build/pack.c:536 #, c-format msgid "Generating signature: %d\n" msgstr "" -#: build/pack.c:547 +#: build/pack.c:549 msgid "Unable to reload signature header.\n" msgstr "" -#: build/pack.c:555 +#: build/pack.c:557 #, c-format msgid "Could not open %s: %s\n" msgstr "" -#: build/pack.c:591 lib/psm.c:1564 +#: build/pack.c:593 lib/psm.c:1571 #, c-format msgid "Unable to write package: %s\n" msgstr "" -#: build/pack.c:606 +#: build/pack.c:608 #, c-format msgid "Unable to open sigtarget %s: %s\n" msgstr "" -#: build/pack.c:616 +#: build/pack.c:618 #, c-format msgid "Unable to read header from %s: %s\n" msgstr "" -#: build/pack.c:630 +#: build/pack.c:632 #, c-format msgid "Unable to write header to %s: %s\n" msgstr "" -#: build/pack.c:640 +#: build/pack.c:642 #, c-format msgid "Unable to read payload from %s: %s\n" msgstr "" -#: build/pack.c:646 +#: build/pack.c:648 #, c-format msgid "Unable to write payload to %s: %s\n" msgstr "" -#: build/pack.c:671 lib/psm.c:1823 +#: build/pack.c:673 lib/psm.c:1830 #, c-format msgid "Wrote: %s\n" msgstr "" -#: build/pack.c:738 +#: build/pack.c:740 #, c-format msgid "Could not generate output filename for package %s: %s\n" msgstr "" -#: build/pack.c:755 +#: build/pack.c:757 #, c-format msgid "cannot create %s: %s\n" msgstr "" @@ -1728,123 +1728,123 @@ msgstr "" msgid "line %d: Second %%files list\n" msgstr "" -#: build/parsePreamble.c:232 +#: build/parsePreamble.c:233 #, c-format msgid "Architecture is excluded: %s\n" msgstr "" -#: build/parsePreamble.c:237 +#: build/parsePreamble.c:238 #, c-format msgid "Architecture is not included: %s\n" msgstr "" -#: build/parsePreamble.c:242 +#: build/parsePreamble.c:243 #, c-format msgid "OS is excluded: %s\n" msgstr "" -#: build/parsePreamble.c:247 +#: build/parsePreamble.c:248 #, c-format msgid "OS is not included: %s\n" msgstr "" -#: build/parsePreamble.c:269 +#: build/parsePreamble.c:270 #, c-format msgid "%s field must be present in package: %s\n" msgstr "" -#: build/parsePreamble.c:297 +#: build/parsePreamble.c:298 #, c-format msgid "Duplicate %s entries in package: %s\n" msgstr "" -#: build/parsePreamble.c:357 +#: build/parsePreamble.c:358 #, c-format msgid "Unable to open icon %s: %s\n" msgstr "" -#: build/parsePreamble.c:375 +#: build/parsePreamble.c:376 #, c-format msgid "Unable to read icon %s: %s\n" msgstr "" -#: build/parsePreamble.c:388 +#: build/parsePreamble.c:389 #, c-format msgid "Unknown icon type: %s\n" msgstr "" -#: build/parsePreamble.c:432 +#: build/parsePreamble.c:433 #, c-format msgid "line %d: Tag takes single token only: %s\n" msgstr "" -#: build/parsePreamble.c:471 +#: build/parsePreamble.c:473 #, c-format msgid "line %d: Malformed tag: %s\n" msgstr "" #. Empty field -#: build/parsePreamble.c:479 +#: build/parsePreamble.c:481 #, c-format msgid "line %d: Empty tag: %s\n" msgstr "" -#: build/parsePreamble.c:501 build/parsePreamble.c:508 +#: build/parsePreamble.c:503 build/parsePreamble.c:510 #, c-format msgid "line %d: Illegal char '-' in %s: %s\n" msgstr "" -#: build/parsePreamble.c:569 build/parseSpec.c:404 +#: build/parsePreamble.c:571 build/parseSpec.c:404 #, c-format msgid "BuildRoot can not be \"/\": %s\n" msgstr "" -#: build/parsePreamble.c:582 +#: build/parsePreamble.c:584 #, c-format msgid "line %d: Prefixes must not end with \"/\": %s\n" msgstr "" -#: build/parsePreamble.c:594 +#: build/parsePreamble.c:596 #, c-format msgid "line %d: Docdir must begin with '/': %s\n" msgstr "" -#: build/parsePreamble.c:606 +#: build/parsePreamble.c:608 #, c-format msgid "line %d: Epoch/Serial field must be a number: %s\n" msgstr "" -#: build/parsePreamble.c:646 build/parsePreamble.c:657 +#: build/parsePreamble.c:648 build/parsePreamble.c:659 #, c-format msgid "line %d: Bad %s: qualifiers: %s\n" msgstr "" -#: build/parsePreamble.c:683 +#: build/parsePreamble.c:685 #, c-format msgid "line %d: Bad BuildArchitecture format: %s\n" msgstr "" -#: build/parsePreamble.c:692 +#: build/parsePreamble.c:694 #, c-format msgid "Internal error: Bogus tag %d\n" msgstr "" -#: build/parsePreamble.c:847 +#: build/parsePreamble.c:849 #, c-format msgid "Bad package specification: %s\n" msgstr "" -#: build/parsePreamble.c:853 +#: build/parsePreamble.c:855 #, c-format msgid "Package already exists: %s\n" msgstr "" -#: build/parsePreamble.c:880 +#: build/parsePreamble.c:882 #, c-format msgid "line %d: Unknown tag: %s\n" msgstr "" -#: build/parsePreamble.c:902 +#: build/parsePreamble.c:904 msgid "Spec file can't use BuildRoot\n" msgstr "" @@ -1994,11 +1994,11 @@ msgstr "" msgid "malformed %%include statement\n" msgstr "" -#: build/parseSpec.c:522 +#: build/parseSpec.c:523 msgid "No compatible architectures found for build\n" msgstr "" -#: build/parseSpec.c:579 +#: build/parseSpec.c:580 #, c-format msgid "Package has no %%description: %s\n" msgstr "" @@ -2072,60 +2072,60 @@ msgstr "" msgid " %s A %s\tB %s\n" msgstr "" -#: lib/depends.c:604 lib/depends.c:1236 lib/depends.c:1369 +#: lib/depends.c:604 lib/depends.c:1238 lib/depends.c:1371 msgid "YES" msgstr "" -#: lib/depends.c:604 lib/depends.c:1236 lib/depends.c:1369 +#: lib/depends.c:604 lib/depends.c:1238 lib/depends.c:1371 msgid "NO " msgstr "" -#: lib/depends.c:1030 +#: lib/depends.c:1032 #, c-format msgid "%s: %-45s YES (added files)\n" msgstr "" -#: lib/depends.c:1141 +#: lib/depends.c:1143 #, c-format msgid "%s: %-45s YES (added provide)\n" msgstr "" -#: lib/depends.c:1235 +#: lib/depends.c:1237 #, c-format msgid "%s: %-45s %-s (cached)\n" msgstr "" -#: lib/depends.c:1264 +#: lib/depends.c:1266 #, c-format msgid "%s: %-45s YES (rpmrc provides)\n" msgstr "" -#: lib/depends.c:1281 +#: lib/depends.c:1283 #, c-format msgid "%s: %-45s YES (rpmlib provides)\n" msgstr "" -#: lib/depends.c:1305 +#: lib/depends.c:1307 #, c-format msgid "%s: %-45s YES (db files)\n" msgstr "" -#: lib/depends.c:1318 +#: lib/depends.c:1320 #, c-format msgid "%s: %-45s YES (db provides)\n" msgstr "" -#: lib/depends.c:1332 +#: lib/depends.c:1334 #, c-format msgid "%s: %-45s YES (db package)\n" msgstr "" -#: lib/depends.c:1348 +#: lib/depends.c:1350 #, c-format msgid "%s: %-45s NO\n" msgstr "" -#: lib/depends.c:1369 +#: lib/depends.c:1371 #, c-format msgid "%s: (%s, %s) added to Depends cache.\n" msgstr "" @@ -2133,47 +2133,47 @@ msgstr "" #. requirements are satisfied. #. @switchbreak@ #. requirements are not satisfied. -#: lib/depends.c:1442 +#: lib/depends.c:1444 #, c-format msgid "package %s-%s-%s require not satisfied: %s\n" msgstr "" #. conflicts exist. -#: lib/depends.c:1521 +#: lib/depends.c:1523 #, c-format msgid "package %s conflicts: %s\n" msgstr "" -#: lib/depends.c:1774 +#: lib/depends.c:1776 #, c-format msgid "removing %s-%s-%s \"%s\" from tsort relations.\n" msgstr "" #. Record all relations. -#: lib/depends.c:1924 +#: lib/depends.c:1926 msgid "========== recording tsort relations\n" msgstr "" #. T4. Scan for zeroes. -#: lib/depends.c:1984 +#: lib/depends.c:1986 msgid "" "========== tsorting packages (order, #predecessors, #succesors, depth)\n" msgstr "" -#: lib/depends.c:2034 +#: lib/depends.c:2036 msgid "========== successors only (presentation order)\n" msgstr "" -#: lib/depends.c:2087 +#: lib/depends.c:2089 msgid "LOOP:\n" msgstr "" -#: lib/depends.c:2117 +#: lib/depends.c:2119 msgid "========== continuing tsort ...\n" msgstr "" #: lib/formats.c:28 lib/formats.c:54 lib/formats.c:85 lib/formats.c:160 -#: lib/header.c:2862 lib/header.c:2883 lib/header.c:2905 +#: lib/header.c:2863 lib/header.c:2884 lib/header.c:2906 msgid "(not a number)" msgstr "" @@ -2219,125 +2219,125 @@ msgstr "" msgid "%9d %s\n" msgstr "" -#: lib/fsm.c:1160 +#: lib/fsm.c:1162 #, c-format msgid "%s directory created with perms %04o.\n" msgstr "" -#: lib/fsm.c:1439 +#: lib/fsm.c:1441 #, c-format msgid "archive file %s was not found in header file list\n" msgstr "" -#: lib/fsm.c:1558 lib/fsm.c:1683 +#: lib/fsm.c:1560 lib/fsm.c:1688 #, c-format msgid "%s saved as %s\n" msgstr "" -#: lib/fsm.c:1709 +#: lib/fsm.c:1714 #, c-format msgid "%s rmdir of %s failed: Directory not empty\n" msgstr "" -#: lib/fsm.c:1715 +#: lib/fsm.c:1720 #, c-format msgid "%s rmdir of %s failed: %s\n" msgstr "" -#: lib/fsm.c:1725 +#: lib/fsm.c:1730 #, c-format msgid "%s unlink of %s failed: %s\n" msgstr "" -#: lib/fsm.c:1744 +#: lib/fsm.c:1749 #, c-format msgid "%s created as %s\n" msgstr "" #. This should not be allowed #. @-modfilesys@ -#: lib/header.c:308 +#: lib/header.c:309 msgid "dataLength() RPM_STRING_TYPE count must be 1.\n" msgstr "" #. @-modfilesys@ -#: lib/header.c:345 lib/header_internal.c:159 lib/psm.c:405 +#: lib/header.c:346 lib/header_internal.c:160 lib/psm.c:406 #, c-format msgid "Data type %d not supported\n" msgstr "" #. @-observertrans -readonlytrans@ -#: lib/header.c:2148 +#: lib/header.c:2149 #, c-format msgid "missing { after %" msgstr "" #. @-observertrans -readonlytrans@ -#: lib/header.c:2178 +#: lib/header.c:2179 msgid "missing } after %{" msgstr "" #. @-observertrans -readonlytrans@ -#: lib/header.c:2192 +#: lib/header.c:2193 msgid "empty tag format" msgstr "" #. @-observertrans -readonlytrans@ -#: lib/header.c:2206 +#: lib/header.c:2207 msgid "empty tag name" msgstr "" #. @-observertrans -readonlytrans@ -#: lib/header.c:2223 +#: lib/header.c:2224 msgid "unknown tag" msgstr "" #. @-observertrans -readonlytrans@ -#: lib/header.c:2250 +#: lib/header.c:2251 msgid "] expected at end of array" msgstr "" #. @-observertrans -readonlytrans@ -#: lib/header.c:2268 +#: lib/header.c:2269 msgid "unexpected ]" msgstr "" #. @-observertrans -readonlytrans@ -#: lib/header.c:2272 +#: lib/header.c:2273 msgid "unexpected }" msgstr "" #. @-observertrans -readonlytrans@ -#: lib/header.c:2338 +#: lib/header.c:2339 msgid "? expected in expression" msgstr "" #. @-observertrans -readonlytrans@ -#: lib/header.c:2347 +#: lib/header.c:2348 msgid "{ expected after ? in expression" msgstr "" #. @-observertrans -readonlytrans@ -#: lib/header.c:2360 lib/header.c:2402 +#: lib/header.c:2361 lib/header.c:2403 msgid "} expected in expression" msgstr "" #. @-observertrans -readonlytrans@ -#: lib/header.c:2370 +#: lib/header.c:2371 msgid ": expected following ? subexpression" msgstr "" #. @-observertrans -readonlytrans@ -#: lib/header.c:2387 +#: lib/header.c:2388 msgid "{ expected after : in expression" msgstr "" #. @-observertrans -readonlytrans@ -#: lib/header.c:2412 +#: lib/header.c:2413 msgid "| expected at end of expression" msgstr "" -#: lib/header.c:2608 +#: lib/header.c:2609 msgid "(unknown type)" msgstr "" @@ -2346,11 +2346,11 @@ msgstr "" msgid "error creating temporary file %s\n" msgstr "" -#: lib/package.c:160 +#: lib/package.c:162 msgid "packaging version 1 is not supported by this version of RPM\n" msgstr "" -#: lib/package.c:226 +#: lib/package.c:228 msgid "" "only packaging with major numbers <= 4 is supported by this version of RPM\n" msgstr "" @@ -2799,74 +2799,74 @@ msgstr "" msgid "unknown error %d encountered while manipulating package %s" msgstr "" -#: lib/psm.c:601 +#: lib/psm.c:603 #, c-format msgid "cannot create %%%s %s\n" msgstr "" -#: lib/psm.c:607 +#: lib/psm.c:609 #, c-format msgid "cannot write to %%%s %s\n" msgstr "" -#: lib/psm.c:645 +#: lib/psm.c:647 msgid "source package expected, binary found\n" msgstr "" -#: lib/psm.c:758 +#: lib/psm.c:760 msgid "source package contains no .spec file\n" msgstr "" -#: lib/psm.c:1029 +#: lib/psm.c:1034 #, c-format msgid "execution of %s scriptlet from %s-%s-%s failed, waitpid returned %s\n" msgstr "" -#: lib/psm.c:1036 +#: lib/psm.c:1041 #, c-format msgid "execution of %s scriptlet from %s-%s-%s failed, exit status %d\n" msgstr "" -#: lib/psm.c:1369 +#: lib/psm.c:1376 #, c-format msgid "%s: %s-%s-%s has %d files, test = %d\n" msgstr "" -#: lib/psm.c:1486 +#: lib/psm.c:1493 #, c-format msgid "%s: %s scriptlet failed (%d), skipping %s-%s-%s\n" msgstr "" -#: lib/psm.c:1601 +#: lib/psm.c:1608 #, c-format msgid "user %s does not exist - using root\n" msgstr "" -#: lib/psm.c:1610 +#: lib/psm.c:1617 #, c-format msgid "group %s does not exist - using root\n" msgstr "" -#: lib/psm.c:1649 +#: lib/psm.c:1656 #, c-format msgid "unpacking of archive failed%s%s: %s\n" msgstr "" -#: lib/psm.c:1650 +#: lib/psm.c:1657 msgid " on file " msgstr "" -#: lib/psm.c:1831 +#: lib/psm.c:1838 #, c-format msgid "%s failed on file %s: %s\n" msgstr "" -#: lib/psm.c:1834 +#: lib/psm.c:1841 #, c-format msgid "%s failed: %s\n" msgstr "" -#: lib/psm.c:1926 +#: lib/psm.c:1936 #, c-format msgid "%s: running %s script(s) (if any)\n" msgstr "" @@ -2939,56 +2939,56 @@ msgstr "" msgid "query of specfile %s failed, can't parse\n" msgstr "" -#: lib/query.c:704 +#: lib/query.c:707 msgid "no packages\n" msgstr "" -#: lib/query.c:723 +#: lib/query.c:726 #, c-format msgid "group %s does not contain any packages\n" msgstr "" -#: lib/query.c:733 +#: lib/query.c:736 #, c-format msgid "no package triggers %s\n" msgstr "" -#: lib/query.c:743 +#: lib/query.c:746 #, c-format msgid "no package requires %s\n" msgstr "" -#: lib/query.c:754 +#: lib/query.c:757 #, c-format msgid "no package provides %s\n" msgstr "" -#: lib/query.c:791 +#: lib/query.c:794 #, c-format msgid "file %s: %s\n" msgstr "" -#: lib/query.c:795 +#: lib/query.c:798 #, c-format msgid "file %s is not owned by any package\n" msgstr "" -#: lib/query.c:821 +#: lib/query.c:824 #, c-format msgid "invalid package number: %s\n" msgstr "" -#: lib/query.c:824 +#: lib/query.c:827 #, c-format msgid "package record number: %u\n" msgstr "" -#: lib/query.c:829 +#: lib/query.c:832 #, c-format msgid "record %u could not be read\n" msgstr "" -#: lib/query.c:840 lib/rpminstall.c:625 +#: lib/query.c:843 lib/rpminstall.c:625 #, c-format msgid "package %s is not installed\n" msgstr "" @@ -3168,7 +3168,7 @@ msgstr "" msgid "Installing %s\n" msgstr "" -#: lib/rpmlead.c:47 +#: lib/rpmlead.c:49 #, c-format msgid "read failed: %s (%d)\n" msgstr "" @@ -3272,119 +3272,119 @@ msgstr "" msgid "file is not regular -- skipping size check\n" msgstr "" -#: lib/signature.c:132 +#: lib/signature.c:133 #, c-format msgid "Expected size: %12d = lead(%d)+sigs(%d)+pad(%d)+data(%d)\n" msgstr "" -#: lib/signature.c:136 +#: lib/signature.c:138 #, c-format msgid " Actual size: %12d\n" msgstr "" -#: lib/signature.c:156 +#: lib/signature.c:158 msgid "No signature\n" msgstr "" -#: lib/signature.c:160 +#: lib/signature.c:162 msgid "Old PGP signature\n" msgstr "" -#: lib/signature.c:171 +#: lib/signature.c:173 msgid "Old (internal-only) signature! How did you get that!?\n" msgstr "" -#: lib/signature.c:225 +#: lib/signature.c:227 #, c-format msgid "Signature: size(%d)+pad(%d)\n" msgstr "" -#: lib/signature.c:287 +#: lib/signature.c:289 #, c-format msgid "Couldn't exec pgp (%s)\n" msgstr "" -#: lib/signature.c:300 +#: lib/signature.c:302 msgid "pgp failed\n" msgstr "" #. PGP failed to write signature #. Just in case -#: lib/signature.c:307 +#: lib/signature.c:309 msgid "pgp failed to write signature\n" msgstr "" -#: lib/signature.c:312 +#: lib/signature.c:314 #, c-format msgid "PGP sig size: %d\n" msgstr "" -#: lib/signature.c:325 lib/signature.c:409 +#: lib/signature.c:327 lib/signature.c:411 msgid "unable to read the signature\n" msgstr "" -#: lib/signature.c:330 +#: lib/signature.c:332 #, c-format msgid "Got %d bytes of PGP sig\n" msgstr "" -#: lib/signature.c:371 lib/signature.c:805 +#: lib/signature.c:373 lib/signature.c:809 msgid "Couldn't exec gpg\n" msgstr "" -#: lib/signature.c:384 +#: lib/signature.c:386 msgid "gpg failed\n" msgstr "" #. GPG failed to write signature #. Just in case -#: lib/signature.c:391 +#: lib/signature.c:393 msgid "gpg failed to write signature\n" msgstr "" -#: lib/signature.c:396 +#: lib/signature.c:398 #, c-format msgid "GPG sig size: %d\n" msgstr "" -#: lib/signature.c:414 +#: lib/signature.c:416 #, c-format msgid "Got %d bytes of GPG sig\n" msgstr "" -#: lib/signature.c:442 +#: lib/signature.c:444 msgid "Generating signature using PGP.\n" msgstr "" -#: lib/signature.c:448 +#: lib/signature.c:450 msgid "Generating signature using GPG.\n" msgstr "" -#: lib/signature.c:553 lib/signature.c:628 +#: lib/signature.c:557 lib/signature.c:632 msgid "Could not run pgp. Use --nopgp to skip PGP checks.\n" msgstr "" -#: lib/signature.c:738 +#: lib/signature.c:742 msgid "Could not run gpg. Use --nogpg to skip GPG checks.\n" msgstr "" -#: lib/signature.c:834 +#: lib/signature.c:838 msgid "Couldn't exec pgp\n" msgstr "" #. @notreached@ #. This case should have been screened out long ago. -#: lib/signature.c:838 lib/signature.c:892 +#: lib/signature.c:842 lib/signature.c:896 #, c-format msgid "Invalid %%_signature spec in macro file\n" msgstr "" -#: lib/signature.c:872 +#: lib/signature.c:876 #, c-format msgid "You must set \"%%_gpg_name\" in your macro file\n" msgstr "" -#: lib/signature.c:884 +#: lib/signature.c:888 #, c-format msgid "You must set \"%%_pgp_name\" in your macro file\n" msgstr "" @@ -3429,40 +3429,40 @@ msgid "%s skipped due to missingok flag\n" msgstr "" #. @innercontinue@ -#: lib/transaction.c:1473 +#: lib/transaction.c:1474 #, c-format msgid "excluding directory %s\n" msgstr "" -#: lib/verify.c:241 +#: lib/verify.c:240 msgid "package lacks both user name and id lists (this should never happen)\n" msgstr "" -#: lib/verify.c:262 +#: lib/verify.c:261 msgid "package lacks both group name and id lists (this should never happen)\n" msgstr "" -#: lib/verify.c:403 +#: lib/verify.c:402 #, c-format msgid "missing %s" msgstr "" -#: lib/verify.c:499 +#: lib/verify.c:498 #, c-format msgid "Unsatisfied dependencies for %s-%s-%s: " msgstr "" -#: lib/verify.c:539 +#: lib/verify.c:538 #, c-format msgid "%s-%s-%s: immutable header region digest check failed\n" msgstr "" -#: rpmdb/db1.c:100 rpmdb/db3.c:88 +#: rpmdb/db1.c:100 rpmdb/db3.c:97 #, c-format msgid "db%d error(%d) from %s: %s\n" msgstr "" -#: rpmdb/db1.c:103 rpmdb/db3.c:91 +#: rpmdb/db1.c:103 rpmdb/db3.c:100 #, c-format msgid "db%d error(%d): %s\n" msgstr "" @@ -3505,75 +3505,75 @@ msgstr "" msgid "cannot get %s lock on database\n" msgstr "" -#: rpmdb/db1.c:575 rpmdb/db3.c:1179 +#: rpmdb/db1.c:575 rpmdb/db3.c:1192 msgid "exclusive" msgstr "" -#: rpmdb/db1.c:575 rpmdb/db3.c:1179 +#: rpmdb/db1.c:575 rpmdb/db3.c:1192 msgid "shared" msgstr "" -#: rpmdb/db3.c:119 +#: rpmdb/db3.c:128 #, c-format msgid "closed db environment %s/%s\n" msgstr "" -#: rpmdb/db3.c:137 +#: rpmdb/db3.c:146 #, c-format msgid "removed db environment %s/%s\n" msgstr "" -#: rpmdb/db3.c:178 +#: rpmdb/db3.c:187 #, c-format msgid "opening db environment %s/%s %s\n" msgstr "" -#: rpmdb/db3.c:692 +#: rpmdb/db3.c:703 #, c-format msgid "closed db index %s/%s\n" msgstr "" -#: rpmdb/db3.c:751 +#: rpmdb/db3.c:764 #, c-format msgid "verified db index %s/%s\n" msgstr "" -#: rpmdb/db3.c:956 +#: rpmdb/db3.c:969 #, c-format msgid "opening db index %s/%s %s mode=0x%x\n" msgstr "" -#: rpmdb/db3.c:1177 +#: rpmdb/db3.c:1190 #, c-format msgid "cannot get %s lock on %s/%s\n" msgstr "" -#: rpmdb/db3.c:1183 +#: rpmdb/db3.c:1196 #, c-format msgid "locked db index %s/%s\n" msgstr "" -#: rpmdb/dbconfig.c:395 +#: rpmdb/dbconfig.c:406 #, c-format msgid "unrecognized db option: \"%s\" ignored.\n" msgstr "" -#: rpmdb/dbconfig.c:431 +#: rpmdb/dbconfig.c:442 #, c-format msgid "%s has invalid numeric value, skipped\n" msgstr "" -#: rpmdb/dbconfig.c:440 +#: rpmdb/dbconfig.c:451 #, c-format msgid "%s has too large or too small long value, skipped\n" msgstr "" -#: rpmdb/dbconfig.c:449 +#: rpmdb/dbconfig.c:460 #, c-format msgid "%s has too large or too small integer value, skipped\n" msgstr "" -#: rpmdb/falloc.c:147 +#: rpmdb/falloc.c:151 #, c-format msgid "" "free list corrupt (%u)- please run\n" @@ -3596,37 +3596,37 @@ msgid "generate headers compatible with (legacy) rpm[23] packaging" msgstr "" #. @-modfilesys@ -#: rpmdb/rpmdb.c:129 +#: rpmdb/rpmdb.c:130 #, c-format msgid "dbiTagsInit: unrecognized tag name: \"%s\" ignored\n" msgstr "" -#: rpmdb/rpmdb.c:381 +#: rpmdb/rpmdb.c:382 #, c-format msgid "cannot open %s index using db%d - %s (%d)\n" msgstr "" -#: rpmdb/rpmdb.c:401 +#: rpmdb/rpmdb.c:402 #, c-format msgid "cannot open %s index\n" msgstr "" -#: rpmdb/rpmdb.c:493 +#: rpmdb/rpmdb.c:494 #, c-format msgid "error(%d) getting \"%s\" records from %s index\n" msgstr "" -#: rpmdb/rpmdb.c:624 +#: rpmdb/rpmdb.c:625 #, c-format msgid "error(%d) storing record %s into %s\n" msgstr "" -#: rpmdb/rpmdb.c:634 +#: rpmdb/rpmdb.c:635 #, c-format msgid "error(%d) removing record %s from %s\n" msgstr "" -#: rpmdb/rpmdb.c:887 +#: rpmdb/rpmdb.c:888 msgid "no dbpath has been set\n" msgstr "" @@ -3892,7 +3892,7 @@ msgstr "" msgid "Unknown or unexpected error" msgstr "" -#: rpmio/rpmio.c:1331 +#: rpmio/rpmio.c:1339 #, c-format msgid "logging into %s as %s, pw %s\n" msgstr "" diff --git a/popt/po/popt.pot b/popt/po/popt.pot index 4efb27c..86265e3 100644 --- a/popt/po/popt.pot +++ b/popt/po/popt.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-10-15 13:39-0400\n" +"POT-Creation-Date: 2001-10-16 10:48-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,48 +18,48 @@ msgstr "" msgid "unknown errno" msgstr "" -#: popt.c:903 +#: popt.c:909 #, c-format msgid "option type (%d) not implemented in popt\n" msgstr "" -#: popt.c:1114 +#: popt.c:1120 msgid "missing argument" msgstr "" -#: popt.c:1116 +#: popt.c:1122 msgid "unknown option" msgstr "" -#: popt.c:1118 +#: popt.c:1124 msgid "mutually exclusive logical operations requested" msgstr "" -#: popt.c:1120 +#: popt.c:1126 msgid "opt->arg should not be NULL" msgstr "" -#: popt.c:1122 +#: popt.c:1128 msgid "aliases nested too deeply" msgstr "" -#: popt.c:1124 +#: popt.c:1130 msgid "error in parameter quoting" msgstr "" -#: popt.c:1126 +#: popt.c:1132 msgid "invalid numeric value" msgstr "" -#: popt.c:1128 +#: popt.c:1134 msgid "number too large or too small" msgstr "" -#: popt.c:1130 +#: popt.c:1136 msgid "memory allocation failed" msgstr "" -#: popt.c:1134 +#: popt.c:1140 msgid "unknown error" msgstr "" diff --git a/popt/popt.c b/popt/popt.c index c7ec5bf..728bf8c 100644 --- a/popt/popt.c +++ b/popt/popt.c @@ -67,9 +67,9 @@ static void invokeCallbacksPRE(poptContext con, const struct poptOption * opt) poptCallbackType cb = (poptCallbackType)opt->arg; /*@=castfcnptr@*/ /* Perform callback. */ - /*@-moduncon@*/ + /*@-moduncon -noeffectuncon @*/ cb(con, POPT_CALLBACK_REASON_PRE, NULL, NULL, opt->descrip); - /*@=moduncon@*/ + /*@=moduncon =noeffectuncon @*/ } } } @@ -90,9 +90,9 @@ static void invokeCallbacksPOST(poptContext con, const struct poptOption * opt) poptCallbackType cb = (poptCallbackType)opt->arg; /*@=castfcnptr@*/ /* Perform callback. */ - /*@-moduncon@*/ + /*@-moduncon -noeffectuncon @*/ cb(con, POPT_CALLBACK_REASON_POST, NULL, NULL, opt->descrip); - /*@=moduncon@*/ + /*@=moduncon =noeffectuncon @*/ } } } @@ -130,10 +130,10 @@ static void invokeCallbacksOPTION(poptContext con, const void * cbData = (cbopt->descrip ? cbopt->descrip : myData); /* Perform callback. */ if (cb != NULL) { /* XXX program error */ - /*@-moduncon@*/ + /*@-moduncon -noeffectuncon @*/ cb(con, POPT_CALLBACK_REASON_OPTION, myOpt, con->os->nextArg, cbData); - /*@=moduncon@*/ + /*@=moduncon =noeffectuncon @*/ } /* Terminate (unless explcitly continuing). */ if (!(cbopt->argInfo & POPT_CBFLAG_CONTINUE)) @@ -160,7 +160,7 @@ poptContext poptGetContext(const char * name, int argc, const char ** argv, if (!(flags & POPT_CONTEXT_KEEP_FIRST)) con->os->next = 1; /* skip argv[0] */ - con->leftovers = calloc( (argc + 1), sizeof(char *) ); + con->leftovers = calloc( (argc + 1), sizeof(*con->leftovers) ); /*@-dependenttrans -assignexpose@*/ /* FIX: W2DO? */ con->options = options; /*@=dependenttrans =assignexpose@*/ @@ -510,6 +510,7 @@ static const char * findNextArg(/*@special@*/ poptContext con, if (os->next == os->argc && os == con->optionStack) break; if (os->argv != NULL) for (i = os->next; i < os->argc; i++) { + /*@-sizeoftype@*/ if (os->argb && PBM_ISSET(i, os->argb)) /*@innercontinue@*/ continue; if (*os->argv[i] == '-') @@ -523,6 +524,7 @@ static const char * findNextArg(/*@special@*/ poptContext con, PBM_SET(i, os->argb); } /*@innerbreak@*/ break; + /*@=sizeoftype@*/ } if (os > con->optionStack) os--; } while (arg == NULL); @@ -583,10 +585,12 @@ static void poptStripArg(/*@special@*/ poptContext con, int which) /*@defines con->arg_strip @*/ /*@modifies con @*/ { + /*@-sizeoftype@*/ if (con->arg_strip == NULL) con->arg_strip = PBM_ALLOC(con->optionStack[0].argc); if (con->arg_strip != NULL) /* XXX can't happen */ PBM_SET(which, con->arg_strip); + /*@=sizeoftype@*/ } static int poptSaveLong(const struct poptOption * opt, long aLong) @@ -678,10 +682,12 @@ int poptGetNextOpt(poptContext con) char * localOptString, * optString; int thisopt; + /*@-sizeoftype@*/ if (con->os->argb && PBM_ISSET(con->os->next, con->os->argb)) { con->os->next++; continue; } + /*@=sizeoftype@*/ thisopt = con->os->next; if (con->os->argv != NULL) /* XXX can't happen */ origOptString = con->os->argv[con->os->next++]; @@ -1169,6 +1175,7 @@ int poptStrippedArgv(poptContext con, int argc, char ** argv) int j = 1; int i; + /*@-sizeoftype@*/ if (con->arg_strip) for (i = 1; i < argc; i++) { if (PBM_ISSET(i, con->arg_strip)) @@ -1181,6 +1188,7 @@ int poptStrippedArgv(poptContext con, int argc, char ** argv) argv[j] = (j < numargs) ? argv[i] : NULL; j++; } + /*@=sizeoftype@*/ return numargs; } diff --git a/rpmdb/db3.c b/rpmdb/db3.c index 6028360..671ff26 100644 --- a/rpmdb/db3.c +++ b/rpmdb/db3.c @@ -11,6 +11,15 @@ static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */ #include #endif +#if defined(__LCLINT__) +typedef unsigned int u_int32_t; +typedef unsigned short u_int16_t; +typedef unsigned char u_int8_t; +/*@-incondefs@*/ /* LCLint 3.0.0.15 */ +typedef int int32_t; +/*@=incondefs@*/ +#endif + #include #include @@ -83,7 +92,7 @@ static int cvtdberr(dbiIndex dbi, const char * msg, int error, int printit) rc = error; if (printit && rc) { - /*@-moduncon@*/ + /*@-moduncon@*/ /* FIX: annotate db3 methods */ if (msg) rpmError(RPMERR_DBERR, _("db%d error(%d) from %s: %s\n"), dbi->dbi_api, rc, msg, db_strerror(error)); @@ -122,7 +131,7 @@ static int db_fini(dbiIndex dbi, const char * dbhome, if (rpmdb->db_remove_env || dbi->dbi_tear_down) { int xx; - /*@-moduncon@*/ + /*@-moduncon@*/ /* FIX: annotate db3 methods */ xx = db_env_create(&dbenv, 0); /*@=moduncon@*/ xx = cvtdberr(dbi, "db_env_create", rc, _debug); @@ -148,7 +157,7 @@ static int db3_fsync_disable(/*@unused@*/ int fd) return 0; } -/*@-moduncon@*/ +/*@-moduncon@*/ /* FIX: annotate db3 methods */ static int db_init(dbiIndex dbi, const char * dbhome, /*@null@*/ const char * dbfile, /*@unused@*/ /*@null@*/ const char * dbsubfile, @@ -200,17 +209,19 @@ static int db_init(dbiIndex dbi, const char * dbhome, return 1; { int xx; + /*@-noeffectuncon@*/ /* FIX: annotate db3 methods */ dbenv->set_errcall(dbenv, rpmdb->db_errcall); dbenv->set_errfile(dbenv, rpmdb->db_errfile); dbenv->set_errpfx(dbenv, rpmdb->db_errpfx); + /*@=noeffectuncon@*/ /* dbenv->set_paniccall(???) */ - (void) dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT, + xx = dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT, (dbi->dbi_verbose & DB_VERB_CHKPOINT)); - (void) dbenv->set_verbose(dbenv, DB_VERB_DEADLOCK, + xx = dbenv->set_verbose(dbenv, DB_VERB_DEADLOCK, (dbi->dbi_verbose & DB_VERB_DEADLOCK)); - (void) dbenv->set_verbose(dbenv, DB_VERB_RECOVERY, + xx = dbenv->set_verbose(dbenv, DB_VERB_RECOVERY, (dbi->dbi_verbose & DB_VERB_RECOVERY)); - (void) dbenv->set_verbose(dbenv, DB_VERB_WAITSFOR, + xx = dbenv->set_verbose(dbenv, DB_VERB_WAITSFOR, (dbi->dbi_verbose & DB_VERB_WAITSFOR)); /* dbenv->set_lg_max(???) */ /* dbenv->set_lk_conflicts(???) */ @@ -636,7 +647,7 @@ static int db3stat(dbiIndex dbi, unsigned int flags) return rc; } -/*@-moduncon@*/ +/*@-moduncon@*/ /* FIX: annotate db3 methods */ static int db3close(/*@only@*/ dbiIndex dbi, /*@unused@*/ unsigned int flags) /*@globals rpmGlobalMacroContext, fileSystem @*/ @@ -705,23 +716,25 @@ static int db3close(/*@only@*/ dbiIndex dbi, /*@unused@*/ unsigned int flags) if (dbi->dbi_verify_on_close && !dbi->dbi_temporary) { DB_ENV * dbenv = NULL; - /*@-moduncon@*/ + /*@-moduncon@*/ /* FIX: annotate db3 methods */ rc = db_env_create(&dbenv, 0); /*@=moduncon@*/ rc = cvtdberr(dbi, "db_env_create", rc, _debug); if (rc || dbenv == NULL) goto exit; + /*@-noeffectuncon@*/ /* FIX: annotate db3 methods */ dbenv->set_errcall(dbenv, rpmdb->db_errcall); dbenv->set_errfile(dbenv, rpmdb->db_errfile); dbenv->set_errpfx(dbenv, rpmdb->db_errpfx); /* dbenv->set_paniccall(???) */ - (void) dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT, + /*@=noeffectuncon@*/ + xx = dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT, (dbi->dbi_verbose & DB_VERB_CHKPOINT)); - (void) dbenv->set_verbose(dbenv, DB_VERB_DEADLOCK, + xx = dbenv->set_verbose(dbenv, DB_VERB_DEADLOCK, (dbi->dbi_verbose & DB_VERB_DEADLOCK)); - (void) dbenv->set_verbose(dbenv, DB_VERB_RECOVERY, + xx = dbenv->set_verbose(dbenv, DB_VERB_RECOVERY, (dbi->dbi_verbose & DB_VERB_RECOVERY)); - (void) dbenv->set_verbose(dbenv, DB_VERB_WAITSFOR, + xx = dbenv->set_verbose(dbenv, DB_VERB_WAITSFOR, (dbi->dbi_verbose & DB_VERB_WAITSFOR)); if (dbi->dbi_tmpdir) { @@ -737,7 +750,7 @@ static int db3close(/*@only@*/ dbiIndex dbi, /*@unused@*/ unsigned int flags) rc = cvtdberr(dbi, "dbenv->open", rc, _debug); if (rc) goto exit; - /*@-moduncon@*/ + /*@-moduncon@*/ /* FIX: annotate db3 methods */ rc = db_create(&db, dbenv, 0); /*@=moduncon@*/ rc = cvtdberr(dbi, "db_create", rc, _debug); @@ -960,7 +973,7 @@ static int db3open(/*@keep@*/ rpmdb rpmdb, int rpmtag, dbiIndex * dbip) if (rc == 0) { static int _lockdbfd = 0; - /*@-moduncon@*/ + /*@-moduncon@*/ /* FIX: annotate db3 methods */ rc = db_create(&db, dbenv, dbi->dbi_cflags); /*@=moduncon@*/ rc = cvtdberr(dbi, "db_create", rc, _debug); diff --git a/rpmdb/dbconfig.c b/rpmdb/dbconfig.c index 704bc84..44f3ff2 100644 --- a/rpmdb/dbconfig.c +++ b/rpmdb/dbconfig.c @@ -4,6 +4,17 @@ #include "system.h" +#if defined(__LCLINT__) +/*@-redef@*/ +typedef unsigned int u_int32_t; +typedef unsigned short u_int16_t; +typedef unsigned char u_int8_t; +/*@-incondefs@*/ /* LCLint 3.0.0.15 */ +typedef int int32_t; +/*@=incondefs@*/ +/*@=redef@*/ +#endif + #include #include @@ -478,6 +489,7 @@ dbiIndex db3New(rpmdb rpmdb, int rpmtag) /* * Inverted lists have join length of 2, primary data has join length of 1. */ + /*@-sizeoftype@*/ switch (rpmtag) { case RPMDBI_PACKAGES: case RPMDBI_DEPENDS: @@ -487,6 +499,7 @@ dbiIndex db3New(rpmdb rpmdb, int rpmtag) dbi->dbi_jlen = 2 * sizeof(int_32); break; } + /*@=sizeoftype@*/ dbi->dbi_use_cursors = 1; /* db3 cursors are always used now. */ diff --git a/rpmdb/falloc.c b/rpmdb/falloc.c index 4785107..117d195 100644 --- a/rpmdb/falloc.c +++ b/rpmdb/falloc.c @@ -78,10 +78,12 @@ FD_t fadOpen(const char * path, int flags, mode_t perms) if (fadGetFileSize(fd) == 0) { newHdr.magic = FA_MAGIC; newHdr.firstFree = 0; + /*@-sizeoftype@*/ if (Fwrite(&newHdr, sizeof(char), sizeof(newHdr), fd) != sizeof(newHdr)) { (void) Fclose(fd); return NULL; } + /*@=sizeoftype@*/ fadSetFirstFree(fd, 0); fadSetFileSize(fd, sizeof(newHdr)); } else { @@ -127,7 +129,9 @@ unsigned int fadAlloc(FD_t fd, unsigned int size) memset(&header, 0, sizeof(header)); /* our internal idea of size includes overhead */ + /*@-sizeoftype@*/ size += sizeof(struct faHeader) + sizeof(struct faFooter); + /*@=sizeoftype@*/ /* Make sure they are allocing multiples of 64 bytes. It'll keep things less fragmented that way */ @@ -387,6 +391,7 @@ static int fadSanity(FD_t fd, int offset, const struct faHeader * fh, int printi { int rc = 0; + /*@-sizeoftype@*/ /* Check size range and alignment. */ if (!(fh->size > 0 && fh->size <= 0x00200000 && (fh->size & 0x3f) == 0)) rc |= 0x1; @@ -404,6 +409,7 @@ static int fadSanity(FD_t fd, int offset, const struct faHeader * fh, int printi fh->freePrev < fadGetFileSize(fd) && (fh->freePrev & 0x3f) == sizeof(struct faFileHeader)) ) rc |= 0x4; + /*@=sizeoftype@*/ /* Check that only the isFree bit is (possibly) set. */ if (fh->isFree & ~1) @@ -431,9 +437,11 @@ int fadNextOffset(FD_t fd, unsigned int lastoff) struct faHeader header; int offset; + /*@-sizeoftype@*/ offset = (lastoff) ? (lastoff - sizeof(header)) : sizeof(struct faFileHeader); + /*@=sizeoftype@*/ if (offset >= fadGetFileSize(fd)) return 0; diff --git a/rpmdb/fprint.c b/rpmdb/fprint.c index 7563585..3a049db 100644 --- a/rpmdb/fprint.c +++ b/rpmdb/fprint.c @@ -249,12 +249,13 @@ void fpLookupHeader(fingerPrintCache cache, Header h, fingerPrint * fpList) rpmTagType bnt, dnt; int_32 * dirIndexes; int fileCount; + int xx; if (!hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, &fileCount)) return; - (void) hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); - (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + xx = hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); fpLookupList(cache, dirNames, baseNames, dirIndexes, fileCount, fpList); dirNames = hfd(dirNames, dnt); baseNames = hfd(baseNames, bnt); diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index 1703f22..0eab91a 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -1,3 +1,4 @@ +/*@-sizeoftype@*/ /** \ingroup rpmdb dbi * \file rpmdb/rpmdb.c */ @@ -907,7 +908,7 @@ static int openDatabase(/*@null@*/ const char * prefix, /*@modifies *dbp, fileSystem @*/ { rpmdb db; - int rc; + int rc, xx; unsigned int gflags = 0; /* dbiGet() flags */ static int _initialized = 0; int justCheck = flags & RPMDB_FLAG_JUSTCHECK; @@ -934,7 +935,7 @@ static int openDatabase(/*@null@*/ const char * prefix, sprintf(filename, "%s/%s/__db.%03d", (prefix ? prefix : ""), (dbpath ? dbpath : ""), i); (void) rpmCleanPath(filename); - (void) unlink(filename); + xx = unlink(filename); } } #endif @@ -1001,7 +1002,6 @@ static int openDatabase(/*@null@*/ const char * prefix, case RPMTAG_BASENAMES: { void * keyp = NULL; DBC * dbcursor; - int xx; /* We used to store the fileindexes as complete paths, rather then plain basenames. Let's see which version we are... */ @@ -1033,7 +1033,7 @@ static int openDatabase(/*@null@*/ const char * prefix, exit: if (rc || justCheck || dbp == NULL) - (void) rpmdbClose(db); + xx = rpmdbClose(db); else *dbp = db; @@ -1184,9 +1184,9 @@ static int rpmdbFindByFile(rpmdb db, /*@null@*/ const char * filespec, continue; } - (void) hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, NULL); - (void) hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); - (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + xx = hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, NULL); + xx = hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); do { fingerPrint fp2; @@ -1198,7 +1198,7 @@ static int rpmdbFindByFile(rpmdb db, /*@null@*/ const char * filespec, /*@=nullpass@*/ rec->hdrNum = dbiIndexRecordOffset(allMatches, i); rec->tagNum = dbiIndexRecordFileNumber(allMatches, i); - (void) dbiAppendSet(*matches, rec, 1, sizeof(*rec), 0); + xx = dbiAppendSet(*matches, rec, 1, sizeof(*rec), 0); } prevoff = offset; @@ -2565,9 +2565,9 @@ int rpmdbAdd(rpmdb db, int iid, Header h) if (iid != 0 && iid != -1) { int_32 tid = iid; - (void) headerRemoveEntry(h, RPMTAG_REMOVETID); + xx = headerRemoveEntry(h, RPMTAG_REMOVETID); if (!headerIsEntry(h, RPMTAG_INSTALLTID)) - (void) headerAddEntry(h, RPMTAG_INSTALLTID, RPM_INT32_TYPE, &tid, 1); + xx = headerAddEntry(h, RPMTAG_INSTALLTID, RPM_INT32_TYPE, &tid, 1); } /* @@ -2576,7 +2576,7 @@ int rpmdbAdd(rpmdb db, int iid, Header h) * being written to the package header database. */ - (void) hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, &count); + xx = hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, &count); if (_noDirTokens) expandFilelist(h); @@ -2672,7 +2672,7 @@ int rpmdbAdd(rpmdb db, int iid, Header h) if (!dbi->dbi_no_dbsync) xx = dbiSync(dbi, 0); { const char *n, *v, *r; - (void) headerNVR(h, &n, &v, &r); + xx = headerNVR(h, &n, &v, &r); rpmMessage(RPMMESS_DEBUG, " +++ %10u %s-%s-%s\n", hdrNum, n, v, r); } } @@ -2685,11 +2685,11 @@ int rpmdbAdd(rpmdb db, int iid, Header h) rpmcnt = count; /*@switchbreak@*/ break; case RPMTAG_REQUIRENAME: - (void) hge(h, rpmtag, &rpmtype, (void **)&rpmvals, &rpmcnt); - (void) hge(h, RPMTAG_REQUIREFLAGS, NULL, (void **)&requireFlags, NULL); + xx = hge(h, rpmtag, &rpmtype, (void **)&rpmvals, &rpmcnt); + xx = hge(h, RPMTAG_REQUIREFLAGS, NULL, (void **)&requireFlags, NULL); /*@switchbreak@*/ break; default: - (void) hge(h, rpmtag, &rpmtype, (void **)&rpmvals, &rpmcnt); + xx = hge(h, rpmtag, &rpmtype, (void **)&rpmvals, &rpmcnt); /*@switchbreak@*/ break; } @@ -2822,7 +2822,7 @@ int rpmdbFindFpList(rpmdb db, fingerPrint * fpList, dbiIndexSet * matchList, rpmdbMatchIterator mi; fingerPrintCache fpc; Header h; - int i; + int i, xx; if (db == NULL) return 0; @@ -2830,7 +2830,7 @@ int rpmdbFindFpList(rpmdb db, fingerPrint * fpList, dbiIndexSet * matchList, /* Gather all matches from the database */ for (i = 0; i < numItems; i++) { - (void) rpmdbGrowIterator(mi, fpList[i].baseName, 0, i); + xx = rpmdbGrowIterator(mi, fpList[i].baseName, 0, i); matchList[i] = xcalloc(1, sizeof(*(matchList[i]))); } @@ -2869,9 +2869,9 @@ int rpmdbFindFpList(rpmdb db, fingerPrint * fpList, dbiIndexSet * matchList, num = end - start; /* Compute fingerprints for this header's matches */ - (void) hge(h, RPMTAG_BASENAMES, &bnt, (void **) &fullBaseNames, NULL); - (void) hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); - (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &fullDirIndexes, NULL); + xx = hge(h, RPMTAG_BASENAMES, &bnt, (void **) &fullBaseNames, NULL); + xx = hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &fullDirIndexes, NULL); baseNames = xcalloc(num, sizeof(*baseNames)); dirIndexes = xcalloc(num, sizeof(*dirIndexes)); @@ -2889,7 +2889,7 @@ int rpmdbFindFpList(rpmdb db, fingerPrint * fpList, dbiIndexSet * matchList, if (FP_EQUAL(fps[i], fpList[im->fpNum])) { /*@=nullpass@*/ /*@-usedef@*/ - (void) dbiAppendSet(matchList[im->fpNum], im, 1, sizeof(*im), 0); + xx = dbiAppendSet(matchList[im->fpNum], im, 1, sizeof(*im), 0); /*@=usedef@*/ } } @@ -3327,3 +3327,4 @@ exit: return rc; } /*@=globs@*/ +/*@=sizeoftype@*/ diff --git a/rpmio/digest.c b/rpmio/digest.c index 5b0aec8..06d5ac3 100644 --- a/rpmio/digest.c +++ b/rpmio/digest.c @@ -52,7 +52,9 @@ rpmDigestInit(rpmDigestFlags flags) if (flags & RPMDIGEST_MD5) { ctx->digestlen = 16; ctx->datalen = 64; + /*@-sizeoftype@*/ /* FIX: union, not void pointer */ ctx->param = xcalloc(1, sizeof(md5Param)); + /*@=sizeoftype@*/ ctx->Reset = (void *) md5Reset; ctx->Update = (void *) md5Update; ctx->Digest = (void *) md5Digest; @@ -61,13 +63,17 @@ rpmDigestInit(rpmDigestFlags flags) if (flags & RPMDIGEST_SHA1) { ctx->digestlen = 20; ctx->datalen = 64; + /*@-sizeoftype@*/ /* FIX: union, not void pointer */ ctx->param = xcalloc(1, sizeof(sha1Param)); + /*@=sizeoftype@*/ ctx->Reset = (void *) sha1Reset; ctx->Update = (void *) sha1Update; ctx->Digest = (void *) sha1Digest; } + /*@-noeffectuncon@*/ /* FIX: check rc */ (void) (*ctx->Reset) (ctx->param); + /*@=noeffectuncon@*/ /* FIX: check rc */ DPRINTF((stderr, "*** Init(%x) ctx %p param %p\n", flags, ctx, ctx->param)); return ctx; @@ -77,7 +83,9 @@ void rpmDigestUpdate(DIGEST_CTX ctx, const void * data, size_t len) { DPRINTF((stderr, "*** Update(%p,%p,%d) param %p \"%s\"\n", ctx, data, len, ctx->param, ((char *)data))); + /*@-noeffectuncon@*/ /* FIX: check rc */ (void) (*ctx->Update) (ctx->param, data, len); + /*@=noeffectuncon@*/ } /*@unchecked@*/ @@ -101,11 +109,15 @@ rpmDigestFinal(/*@only@*/ DIGEST_CTX ctx, /*@out@*/ void ** datap, int i; DPRINTF((stderr, "*** Final(%p,%p,%p,%d) param %p digest %p\n", ctx, datap, lenp, asAscii, ctx->param, digest)); + /*@-noeffectuncon@*/ /* FIX: check rc */ (void) (*ctx->Digest) (ctx->param, digest); + /*@=noeffectuncon@*/ + /*@-sizeoftype@*/ if (IS_LITTLE_ENDIAN()) for (i = 0; i < (ctx->digestlen/sizeof(uint32)); i++) digest[i] = swapu32(digest[i]); + /*@=sizeoftype@*/ /* Return final digest. */ /*@-branchstate@*/ diff --git a/rpmio/macro.c b/rpmio/macro.c index b6eed68..c431824 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -890,7 +890,7 @@ grabArgs(MacroBuf mb, const MacroEntry me, const char * se, char lastc) #endif /* Build argv array */ - argv = (const char **) alloca((argc + 1) * sizeof(char *)); + argv = (const char **) alloca((argc + 1) * sizeof(*argv)); be[-1] = ' '; /* assert((be - 1) == (b + strlen(b) == buf + strlen(buf))) */ be[0] = '\0'; b = buf; @@ -1643,7 +1643,7 @@ int isCompressed(const char * file, rpmCompressedMagic * compressed) if (fd) (void) Fclose(fd); return 1; } - nb = Fread(magic, sizeof(char), sizeof(magic), fd); + nb = Fread(magic, sizeof(magic[0]), sizeof(magic), fd); if (nb < 0) { rpmError(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd)); rc = 1; diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 9c3ccdf..e6014a4 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -308,7 +308,7 @@ static inline /*@null@*/ FD_t XfdNew(const char * msg, const char * file, unsigned line) /*@*/ { - FD_t fd = (FD_t) xmalloc(sizeof(struct _FD_s)); + FD_t fd = xmalloc(sizeof(*fd)); if (fd == NULL) /* XXX xmalloc never returns NULL */ return NULL; fd->nrefs = 0; @@ -804,7 +804,7 @@ static int checkResponse(void * uu, FD_t ctrl, URLSANE(u); if (u->bufAlloced == 0 || u->buf == NULL) { u->bufAlloced = url_iobuf_size; - u->buf = xcalloc(u->bufAlloced, sizeof(char)); + u->buf = xcalloc(u->bufAlloced, sizeof(u->buf[0])); } buf = u->buf; bufAlloced = u->bufAlloced; @@ -1236,10 +1236,12 @@ errxit: return rc; } -/*@unchecked@*/ -/*@null@*/ static rpmCallbackFunction urlNotify = NULL; -/*@unchecked@*/ -/*@null@*/ static void * urlNotifyData = NULL; +/*@unchecked@*/ /*@null@*/ +static rpmCallbackFunction urlNotify = NULL; + +/*@unchecked@*/ /*@null@*/ +static void * urlNotifyData = NULL; + /*@unchecked@*/ static int urlNotifyCount = -1; @@ -1258,8 +1260,10 @@ int ufdCopy(FD_t sfd, FD_t tfd) int notifier = -1; if (urlNotify) { + /*@-noeffectuncon @*/ /* FIX: check rc */ (void)(*urlNotify) (NULL, RPMCALLBACK_INST_OPEN_FILE, 0, 0, NULL, urlNotifyData); + /*@=noeffectuncon @*/ } while (1) { @@ -1283,8 +1287,10 @@ int ufdCopy(FD_t sfd, FD_t tfd) if (urlNotify && urlNotifyCount > 0) { int n = itemsCopied/urlNotifyCount; if (n != notifier) { + /*@-noeffectuncon @*/ /* FIX: check rc */ (void)(*urlNotify) (NULL, RPMCALLBACK_INST_PROGRESS, itemsCopied, 0, NULL, urlNotifyData); + /*@=noeffectuncon @*/ notifier = n; } } @@ -1296,8 +1302,10 @@ int ufdCopy(FD_t sfd, FD_t tfd) /*@=modfilesys@*/ if (urlNotify) { + /*@-noeffectuncon @*/ /* FIX: check rc */ (void)(*urlNotify) (NULL, RPMCALLBACK_INST_OPEN_FILE, itemsCopied, itemsCopied, NULL, urlNotifyData); + /*@=noeffectuncon @*/ } return rc; @@ -2456,7 +2464,9 @@ static int bzdClose( /*@only@*/ void * cookie) if (bzfile == NULL) return -2; fdstat_enter(fd, FDSTAT_CLOSE); + /*@-noeffectuncon@*/ /* FIX: check rc */ bzclose(bzfile); + /*@=noeffectuncon@*/ rc = 0; /* XXX FIXME */ /* XXX TODO: preserve fd if errors */ @@ -3034,14 +3044,18 @@ ssize_t Pread(FD_t fd, void * buf, size_t count, _libio_off_t offset) { if (Fseek(fd, offset, SEEK_SET) < 0) return -1; + /*@-sizeoftype@*/ return Fread(buf, sizeof(char), count, fd); + /*@=sizeoftype@*/ } ssize_t Pwrite(FD_t fd, const void * buf, size_t count, _libio_off_t offset) { if (Fseek(fd, offset, SEEK_SET) < 0) return -1; + /*@-sizeoftype@*/ return Fwrite(buf, sizeof(char), count, fd); + /*@=sizeoftype@*/ } static struct FDIO_s fpio_s = { diff --git a/rpmio/rpmlog.c b/rpmio/rpmlog.c index e27783b..a2407ce 100644 --- a/rpmio/rpmlog.c +++ b/rpmio/rpmlog.c @@ -190,7 +190,9 @@ static void vrpmlog (unsigned code, const char *fmt, va_list ap) ++nrecs; if (_rpmlogCallback) { + /*@-noeffectuncon@*/ /* FIX: useless callback */ _rpmlogCallback(); + /*@=noeffectuncon@*/ return; /* XXX Preserve legacy rpmError behavior. */ } } diff --git a/system.h b/system.h index 74e9a59..0b5fde1 100644 --- a/system.h +++ b/system.h @@ -45,15 +45,6 @@ extern int chroot (const char *__path) extern time_t timezone; #endif -#if defined(__LCLINT__) -typedef unsigned int u_int32_t; -typedef unsigned short u_int16_t; -typedef unsigned char u_int8_t; -/*@-incondefs@*/ /* LCLint 3.0.0.15 */ -typedef int int32_t; -/*@=incondefs@*/ -#endif - /* Since major is a function on SVR4, we can't use `ifndef major'. */ #if MAJOR_IN_MKDEV #include -- 2.7.4