More lclint fiddles.
authorjbj <devnull@localhost>
Tue, 25 Sep 2001 16:21:29 +0000 (16:21 +0000)
committerjbj <devnull@localhost>
Tue, 25 Sep 2001 16:21:29 +0000 (16:21 +0000)
CVS patchset: 5080
CVS date: 2001/09/25 16:21:29

beecrypt/base64.c
beecrypt/beecrypt.h
beecrypt/entropy.c
beecrypt/fips186.c
beecrypt/mp32.h
beecrypt/mp32number.h
beecrypt/mtprng.c

index 883829b..e5e0585 100644 (file)
@@ -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;
index ed0fda2..3a9a7bf 100644 (file)
@@ -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)
        /*@*/;
 
index 531755c..731d954 100644 (file)
@@ -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
 
index c90b7a2..761e89f 100644 (file)
@@ -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
index 2e716c5..15f7f3e 100644 (file)
@@ -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 @*/;
index f3fdae4..f2cfc2b 100644 (file)
@@ -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 @*/;
 
index 03b39c8..e6bda9c 100644 (file)
@@ -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