summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-09-25 16:21:29 +0000
committerjbj <devnull@localhost>2001-09-25 16:21:29 +0000
commita2830a271c2486a266dfc18490989f0e41cf9d10 (patch)
tree6d9811962d8b2dd18e5dff3170d64a73be20d354
parent2a420b223d46c4cbc33623e9ce6f08f6e63a67c0 (diff)
downloadlibrpm-tizen-a2830a271c2486a266dfc18490989f0e41cf9d10.tar.gz
librpm-tizen-a2830a271c2486a266dfc18490989f0e41cf9d10.tar.bz2
librpm-tizen-a2830a271c2486a266dfc18490989f0e41cf9d10.zip
More lclint fiddles.
CVS patchset: 5080 CVS date: 2001/09/25 16:21:29
-rw-r--r--beecrypt/base64.c8
-rw-r--r--beecrypt/beecrypt.h30
-rw-r--r--beecrypt/entropy.c6
-rw-r--r--beecrypt/fips186.c2
-rw-r--r--beecrypt/mp32.h2
-rw-r--r--beecrypt/mp32number.h2
-rw-r--r--beecrypt/mtprng.c2
7 files changed, 29 insertions, 23 deletions
diff --git a/beecrypt/base64.c b/beecrypt/base64.c
index 883829b10..e5e058594 100644
--- a/beecrypt/base64.c
+++ b/beecrypt/base64.c
@@ -105,7 +105,7 @@ fprintf(stderr, "%7u %02x %02x %02x -> %02x %02x %02x %02x\n",
/* Append eol string if desired. */
if (b64encode_chars_per_line > 0 && b64encode_eolstr != NULL) {
if (lc >= b64encode_chars_per_line) {
- for (e = b64encode_eolstr; *e; e++)
+ for (e = b64encode_eolstr; *e != '\0'; e++)
*te++ = *e;
lc = 0;
}
@@ -118,7 +118,7 @@ fprintf(stderr, "%7u %02x %02x %02x -> %02x %02x %02x %02x\n",
/* Append eol string if desired. */
if (b64encode_chars_per_line > 0 && b64encode_eolstr != NULL) {
if (lc != 0) {
- for (e = b64encode_eolstr; *e; e++)
+ for (e = b64encode_eolstr; *e != '\0'; e++)
*te++ = *e;
}
}
@@ -159,7 +159,7 @@ int b64decode (const char * s, void ** datap, int *lenp)
/* Mark whitespace characters. */
if (b64decode_whitespace) {
const char *e;
- for (e = b64decode_whitespace; *e; e++) {
+ for (e = b64decode_whitespace; *e != '\0'; e++) {
if (b64dec[ (unsigned)*e ] == 0x80)
b64dec[ (unsigned)*e ] = 0x81;
}
@@ -167,7 +167,7 @@ int b64decode (const char * s, void ** datap, int *lenp)
/* Validate input buffer */
ns = 0;
- for (t = s; *t; t++) {
+ for (t = s; *t != '\0'; t++) {
switch (b64dec[ (unsigned)*t ]) {
case 0x80: /* invalid chararcter */
return 3;
diff --git a/beecrypt/beecrypt.h b/beecrypt/beecrypt.h
index ed0fda2b5..3a9a7bf20 100644
--- a/beecrypt/beecrypt.h
+++ b/beecrypt/beecrypt.h
@@ -65,7 +65,7 @@ extern "C" {
* Return the number of entropy sources available.
* @return number of entropy sources available
*/
-BEEDLLAPI
+BEEDLLAPI /*@unused@*/
int entropySourceCount(void)
/*@*/;
@@ -74,7 +74,7 @@ int entropySourceCount(void)
* @param index entropy source index
* @return entropy source pointer (or NULL)
*/
-BEEDLLAPI /*@observer@*/ /*@null@*/
+BEEDLLAPI /*@observer@*/ /*@null@*/ /*@unused@*/
const entropySource* entropySourceGet(int index)
/*@*/;
@@ -196,7 +196,7 @@ extern "C" {
* Return the number of generators available.
* @return number of generators available
*/
-BEEDLLAPI
+BEEDLLAPI /*@unused@*/
int randomGeneratorCount(void)
/*@*/;
@@ -205,7 +205,7 @@ int randomGeneratorCount(void)
* @param index generator index
* @return generator pointer (or NULL)
*/
-BEEDLLAPI /*@observer@*/ /*@null@*/
+BEEDLLAPI /*@observer@*/ /*@null@*/ /*@unused@*/
const randomGenerator* randomGeneratorGet(int index)
/*@*/;
@@ -226,7 +226,7 @@ const randomGenerator* randomGeneratorFind(const char* name)
* generator. Otherwise, use "fips186prng".
* @return generator pointer
*/
-BEEDLLAPI /*@observer@*/ /*@null@*/
+BEEDLLAPI /*@observer@*/ /*@null@*/ /*@unused@*/
const randomGenerator* randomGeneratorDefault(void)
/*@*/;
@@ -250,14 +250,14 @@ extern "C" {
/** \ingroup PRNG_m
* Initialize a randomGenerator instance.
*/
-BEEDLLAPI
+BEEDLLAPI /*@unused@*/
int randomGeneratorContextInit(randomGeneratorContext* ctxt, /*@observer@*/ /*@dependent@*/ const randomGenerator* rng)
/*@modifies ctxt->rng, ctxt->param @*/;
/** \ingroup PRNG_m
* Destroy a randomGenerator instance.
*/
-BEEDLLAPI
+BEEDLLAPI /*@unused@*/
int randomGeneratorContextFree(/*@special@*/ randomGeneratorContext* ctxt)
/*@uses ctxt->rng @*/
/*@releases ctxt->param @*/
@@ -336,7 +336,7 @@ extern "C" {
* Return the number of hash functions available.
* @return number of hash functions available
*/
-BEEDLLAPI
+BEEDLLAPI /*@unused@*/
int hashFunctionCount(void)
/*@*/;
@@ -345,7 +345,7 @@ int hashFunctionCount(void)
* @param index hash function index
* @return hash function pointer (or NULL)
*/
-BEEDLLAPI /*@observer@*/ /*@null@*/
+BEEDLLAPI /*@observer@*/ /*@null@*/ /*@unused@*/
const hashFunction* hashFunctionGet(int index)
/*@*/;
@@ -410,7 +410,7 @@ int hashFunctionContextReset(hashFunctionContext* ctxt)
/** \ingroup HASH_m
*/
-BEEDLLAPI
+BEEDLLAPI /*@unused@*/
int hashFunctionContextUpdate(hashFunctionContext* ctxt, const byte* data, int size)
/*@modifies ctxt */;
@@ -529,7 +529,7 @@ extern "C" {
* Return the number of keyed hash functions available.
* @return number of keyed hash functions available
*/
-BEEDLLAPI
+BEEDLLAPI /*@unused@*/
int keyedHashFunctionCount(void)
/*@*/;
@@ -538,7 +538,7 @@ int keyedHashFunctionCount(void)
* @param index keyed hash function index
* @return keyed hash function pointer (or NULL)
*/
-BEEDLLAPI /*@observer@*/ /*@null@*/
+BEEDLLAPI /*@observer@*/ /*@null@*/ /*@unused@*/
const keyedHashFunction* keyedHashFunctionGet(int index)
/*@*/;
@@ -662,11 +662,13 @@ typedef enum
/** \ingroup BC_m
* Block cipher modes.
*/
+/*@-enummemuse@*/
typedef enum
{
ECB,
CBC
} cipherMode;
+/*@=enummemuse@*/
/** \ingroup BC_m
* @param param blockcipher parameters
@@ -772,7 +774,7 @@ extern "C" {
* Return the number of blockciphers available.
* @return number of blockciphers available
*/
-BEEDLLAPI
+BEEDLLAPI /*@unused@*/
int blockCipherCount(void)
/*@*/;
@@ -781,7 +783,7 @@ int blockCipherCount(void)
* @param index blockcipher index
* @return blockcipher pointer (or NULL)
*/
-BEEDLLAPI /*@observer@*/ /*@null@*/
+BEEDLLAPI /*@observer@*/ /*@null@*/ /*@unused@*/
const blockCipher* blockCipherGet(int index)
/*@*/;
diff --git a/beecrypt/entropy.c b/beecrypt/entropy.c
index 531755c31..731d95491 100644
--- a/beecrypt/entropy.c
+++ b/beecrypt/entropy.c
@@ -1477,7 +1477,7 @@ dev_random_end:
# if HAVE_SYNCH_H
mutex_unlock(&dev_random_lock);
# elif HAVE_PTHREAD_H
- pthread_mutex_unlock(&dev_random_lock);
+ (void) pthread_mutex_unlock(&dev_random_lock);
# endif
#endif
return rc;
@@ -1521,7 +1521,7 @@ dev_urandom_end:
# if HAVE_SYNCH_H
mutex_unlock(&dev_urandom_lock);
# elif HAVE_PTHREAD_H
- pthread_mutex_unlock(&dev_urandom_lock);
+ (void) pthread_mutex_unlock(&dev_urandom_lock);
# endif
#endif
return rc;
@@ -1562,7 +1562,7 @@ dev_tty_end:
# if HAVE_SYNCH_H
mutex_unlock(&dev_tty_lock);
# elif HAVE_PTHREAD_H
- pthread_mutex_unlock(&dev_tty_lock);
+ (void) pthread_mutex_unlock(&dev_tty_lock);
# endif
#endif
diff --git a/beecrypt/fips186.c b/beecrypt/fips186.c
index c90b7a2c5..761e89f38 100644
--- a/beecrypt/fips186.c
+++ b/beecrypt/fips186.c
@@ -66,8 +66,10 @@ int fips186Setup(fips186Param* fp)
if (mutex_init(&fp->lock, USYNC_THREAD, (void *) 0))
return -1;
# elif defined(HAVE_PTHREAD_H)
+ /*@-nullpass@*/
if (pthread_mutex_init(&fp->lock, (pthread_mutexattr_t *) 0))
return -1;
+ /*@=nullpass@*/
# endif
# endif
#endif
diff --git a/beecrypt/mp32.h b/beecrypt/mp32.h
index 2e716c5d3..15f7f3e6b 100644
--- a/beecrypt/mp32.h
+++ b/beecrypt/mp32.h
@@ -439,7 +439,7 @@ void mp32print(uint32 xsize, const uint32* xdata)
/**
*/
-BEEDLLAPI
+BEEDLLAPI /*@unused@*/
void mp32println(uint32 xsize, const uint32* xdata)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;
diff --git a/beecrypt/mp32number.h b/beecrypt/mp32number.h
index f3fdae424..f2cfc2b15 100644
--- a/beecrypt/mp32number.h
+++ b/beecrypt/mp32number.h
@@ -94,7 +94,7 @@ void mp32nsetw (mp32number* n, uint32 val)
/**
*/
-BEEDLLAPI
+BEEDLLAPI /*@unused@*/
void mp32nsethex(mp32number* n, const char* hex)
/*@modifies n->size, n->data @*/;
diff --git a/beecrypt/mtprng.c b/beecrypt/mtprng.c
index 03b39c861..e6bda9c20 100644
--- a/beecrypt/mtprng.c
+++ b/beecrypt/mtprng.c
@@ -91,8 +91,10 @@ int mtprngSetup(mtprngParam* mp)
if (mutex_init(&mp->lock, USYNC_THREAD, (void *) 0))
return -1;
# elif defined(HAVE_PTHREAD_H)
+ /*@-nullpass@*/
if (pthread_mutex_init(&mp->lock, (pthread_mutexattr_t *) 0))
return -1;
+ /*@=nullpass@*/
# endif
# endif
#endif