Fix some clang warnings.
authorBen Laurie <ben@links.org>
Sun, 13 Jan 2013 21:04:39 +0000 (21:04 +0000)
committerBen Laurie <ben@links.org>
Sun, 13 Jan 2013 21:06:36 +0000 (21:06 +0000)
crypto/md4/md4_dgst.c
crypto/md4/md4_locl.h
crypto/md5/md5_locl.h
crypto/objects/o_names.c
crypto/ripemd/rmd_dgst.c
crypto/ripemd/rmd_locl.h
crypto/sha/sha256.c
crypto/sha/sha_locl.h

index 82c2cb2d98a9963edf4a1f9211793b68912ebcf6..b5b165b052641b8f52ef4a658244d5beef35d34b 100644 (file)
@@ -106,22 +106,23 @@ void md4_block_data_order (MD4_CTX *c, const void *data_, size_t num)
 
        for (;num--;)
                {
-       HOST_c2l(data,l); X( 0)=l;              HOST_c2l(data,l); X( 1)=l;
+       (void)HOST_c2l(data,l); X( 0)=l;
+       (void)HOST_c2l(data,l); X( 1)=l;
        /* Round 0 */
-       R0(A,B,C,D,X( 0), 3,0); HOST_c2l(data,l); X( 2)=l;
-       R0(D,A,B,C,X( 1), 7,0); HOST_c2l(data,l); X( 3)=l;
-       R0(C,D,A,B,X( 2),11,0); HOST_c2l(data,l); X( 4)=l;
-       R0(B,C,D,A,X( 3),19,0); HOST_c2l(data,l); X( 5)=l;
-       R0(A,B,C,D,X( 4), 3,0); HOST_c2l(data,l); X( 6)=l;
-       R0(D,A,B,C,X( 5), 7,0); HOST_c2l(data,l); X( 7)=l;
-       R0(C,D,A,B,X( 6),11,0); HOST_c2l(data,l); X( 8)=l;
-       R0(B,C,D,A,X( 7),19,0); HOST_c2l(data,l); X( 9)=l;
-       R0(A,B,C,D,X( 8), 3,0); HOST_c2l(data,l); X(10)=l;
-       R0(D,A,B,C,X( 9), 7,0); HOST_c2l(data,l); X(11)=l;
-       R0(C,D,A,B,X(10),11,0); HOST_c2l(data,l); X(12)=l;
-       R0(B,C,D,A,X(11),19,0); HOST_c2l(data,l); X(13)=l;
-       R0(A,B,C,D,X(12), 3,0); HOST_c2l(data,l); X(14)=l;
-       R0(D,A,B,C,X(13), 7,0); HOST_c2l(data,l); X(15)=l;
+       R0(A,B,C,D,X( 0), 3,0); (void)HOST_c2l(data,l); X( 2)=l;
+       R0(D,A,B,C,X( 1), 7,0); (void)HOST_c2l(data,l); X( 3)=l;
+       R0(C,D,A,B,X( 2),11,0); (void)HOST_c2l(data,l); X( 4)=l;
+       R0(B,C,D,A,X( 3),19,0); (void)HOST_c2l(data,l); X( 5)=l;
+       R0(A,B,C,D,X( 4), 3,0); (void)HOST_c2l(data,l); X( 6)=l;
+       R0(D,A,B,C,X( 5), 7,0); (void)HOST_c2l(data,l); X( 7)=l;
+       R0(C,D,A,B,X( 6),11,0); (void)HOST_c2l(data,l); X( 8)=l;
+       R0(B,C,D,A,X( 7),19,0); (void)HOST_c2l(data,l); X( 9)=l;
+       R0(A,B,C,D,X( 8), 3,0); (void)HOST_c2l(data,l); X(10)=l;
+       R0(D,A,B,C,X( 9), 7,0); (void)HOST_c2l(data,l); X(11)=l;
+       R0(C,D,A,B,X(10),11,0); (void)HOST_c2l(data,l); X(12)=l;
+       R0(B,C,D,A,X(11),19,0); (void)HOST_c2l(data,l); X(13)=l;
+       R0(A,B,C,D,X(12), 3,0); (void)HOST_c2l(data,l); X(14)=l;
+       R0(D,A,B,C,X(13), 7,0); (void)HOST_c2l(data,l); X(15)=l;
        R0(C,D,A,B,X(14),11,0);
        R0(B,C,D,A,X(15),19,0);
        /* Round 1 */
index c8085b0eadf9a158d931be8007d474cae1cb333c..99c3e5004c97eaca7a047644a35e58b14bb82045 100644 (file)
@@ -77,10 +77,10 @@ void md4_block_data_order (MD4_CTX *c, const void *p,size_t num);
 #define HASH_FINAL             MD4_Final
 #define        HASH_MAKE_STRING(c,s)   do {    \
        unsigned long ll;               \
-       ll=(c)->A; HOST_l2c(ll,(s));    \
-       ll=(c)->B; HOST_l2c(ll,(s));    \
-       ll=(c)->C; HOST_l2c(ll,(s));    \
-       ll=(c)->D; HOST_l2c(ll,(s));    \
+       ll=(c)->A; (void)HOST_l2c(ll,(s));      \
+       ll=(c)->B; (void)HOST_l2c(ll,(s));      \
+       ll=(c)->C; (void)HOST_l2c(ll,(s));      \
+       ll=(c)->D; (void)HOST_l2c(ll,(s));      \
        } while (0)
 #define        HASH_BLOCK_DATA_ORDER   md4_block_data_order
 
index 968d577995aa2b1be62ba9fa54d12a26981f0078..74d63d1f9cfd412c08bf13b354494a9eef32e29d 100644 (file)
@@ -86,10 +86,10 @@ void md5_block_data_order (MD5_CTX *c, const void *p,size_t num);
 #define HASH_FINAL             MD5_Final
 #define        HASH_MAKE_STRING(c,s)   do {    \
        unsigned long ll;               \
-       ll=(c)->A; HOST_l2c(ll,(s));    \
-       ll=(c)->B; HOST_l2c(ll,(s));    \
-       ll=(c)->C; HOST_l2c(ll,(s));    \
-       ll=(c)->D; HOST_l2c(ll,(s));    \
+       ll=(c)->A; (void)HOST_l2c(ll,(s));      \
+       ll=(c)->B; (void)HOST_l2c(ll,(s));      \
+       ll=(c)->C; (void)HOST_l2c(ll,(s));      \
+       ll=(c)->D; (void)HOST_l2c(ll,(s));      \
        } while (0)
 #define        HASH_BLOCK_DATA_ORDER   md5_block_data_order
 
index 84380a96a98c71109ed821c522f4c500363f1a18..4a548c2ed497581114210051090aa48e07197ad9 100644 (file)
@@ -73,7 +73,7 @@ int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *),
                name_funcs_stack=sk_NAME_FUNCS_new_null();
                MemCheck_on();
                }
-       if ((name_funcs_stack == NULL))
+       if (name_funcs_stack == NULL)
                {
                /* ERROR */
                return(0);
index 63f0d983f7b4f0535904bbde0209e0c3ded39703..d8e72da51bfcf09f4ff8571b095f2ae9a0675eef 100644 (file)
@@ -105,21 +105,21 @@ void ripemd160_block_data_order (RIPEMD160_CTX *ctx, const void *p, size_t num)
 
        A=ctx->A; B=ctx->B; C=ctx->C; D=ctx->D; E=ctx->E;
 
-       HOST_c2l(data,l); X( 0)=l;      HOST_c2l(data,l); X( 1)=l;
-       RIP1(A,B,C,D,E,WL00,SL00);      HOST_c2l(data,l); X( 2)=l;
-       RIP1(E,A,B,C,D,WL01,SL01);      HOST_c2l(data,l); X( 3)=l;
-       RIP1(D,E,A,B,C,WL02,SL02);      HOST_c2l(data,l); X( 4)=l;
-       RIP1(C,D,E,A,B,WL03,SL03);      HOST_c2l(data,l); X( 5)=l;
-       RIP1(B,C,D,E,A,WL04,SL04);      HOST_c2l(data,l); X( 6)=l;
-       RIP1(A,B,C,D,E,WL05,SL05);      HOST_c2l(data,l); X( 7)=l;
-       RIP1(E,A,B,C,D,WL06,SL06);      HOST_c2l(data,l); X( 8)=l;
-       RIP1(D,E,A,B,C,WL07,SL07);      HOST_c2l(data,l); X( 9)=l;
-       RIP1(C,D,E,A,B,WL08,SL08);      HOST_c2l(data,l); X(10)=l;
-       RIP1(B,C,D,E,A,WL09,SL09);      HOST_c2l(data,l); X(11)=l;
-       RIP1(A,B,C,D,E,WL10,SL10);      HOST_c2l(data,l); X(12)=l;
-       RIP1(E,A,B,C,D,WL11,SL11);      HOST_c2l(data,l); X(13)=l;
-       RIP1(D,E,A,B,C,WL12,SL12);      HOST_c2l(data,l); X(14)=l;
-       RIP1(C,D,E,A,B,WL13,SL13);      HOST_c2l(data,l); X(15)=l;
+       (void)HOST_c2l(data,l); X( 0)=l;(void)HOST_c2l(data,l); X( 1)=l;
+       RIP1(A,B,C,D,E,WL00,SL00);      (void)HOST_c2l(data,l); X( 2)=l;
+       RIP1(E,A,B,C,D,WL01,SL01);      (void)HOST_c2l(data,l); X( 3)=l;
+       RIP1(D,E,A,B,C,WL02,SL02);      (void)HOST_c2l(data,l); X( 4)=l;
+       RIP1(C,D,E,A,B,WL03,SL03);      (void)HOST_c2l(data,l); X( 5)=l;
+       RIP1(B,C,D,E,A,WL04,SL04);      (void)HOST_c2l(data,l); X( 6)=l;
+       RIP1(A,B,C,D,E,WL05,SL05);      (void)HOST_c2l(data,l); X( 7)=l;
+       RIP1(E,A,B,C,D,WL06,SL06);      (void)HOST_c2l(data,l); X( 8)=l;
+       RIP1(D,E,A,B,C,WL07,SL07);      (void)HOST_c2l(data,l); X( 9)=l;
+       RIP1(C,D,E,A,B,WL08,SL08);      (void)HOST_c2l(data,l); X(10)=l;
+       RIP1(B,C,D,E,A,WL09,SL09);      (void)HOST_c2l(data,l); X(11)=l;
+       RIP1(A,B,C,D,E,WL10,SL10);      (void)HOST_c2l(data,l); X(12)=l;
+       RIP1(E,A,B,C,D,WL11,SL11);      (void)HOST_c2l(data,l); X(13)=l;
+       RIP1(D,E,A,B,C,WL12,SL12);      (void)HOST_c2l(data,l); X(14)=l;
+       RIP1(C,D,E,A,B,WL13,SL13);      (void)HOST_c2l(data,l); X(15)=l;
        RIP1(B,C,D,E,A,WL14,SL14);
        RIP1(A,B,C,D,E,WL15,SL15);
 
index f14b346e662296865442577432678c92afb377f2..2bd8957d14378e7150b222c270cbc734f0bf3e27 100644 (file)
@@ -88,11 +88,11 @@ void ripemd160_block_data_order (RIPEMD160_CTX *c, const void *p,size_t num);
 #define HASH_FINAL              RIPEMD160_Final
 #define        HASH_MAKE_STRING(c,s)   do {    \
        unsigned long ll;               \
-       ll=(c)->A; HOST_l2c(ll,(s));    \
-       ll=(c)->B; HOST_l2c(ll,(s));    \
-       ll=(c)->C; HOST_l2c(ll,(s));    \
-       ll=(c)->D; HOST_l2c(ll,(s));    \
-       ll=(c)->E; HOST_l2c(ll,(s));    \
+       ll=(c)->A; (void)HOST_l2c(ll,(s));      \
+       ll=(c)->B; (void)HOST_l2c(ll,(s));      \
+       ll=(c)->C; (void)HOST_l2c(ll,(s));      \
+       ll=(c)->D; (void)HOST_l2c(ll,(s));      \
+       ll=(c)->E; (void)HOST_l2c(ll,(s));      \
        } while (0)
 #define HASH_BLOCK_DATA_ORDER   ripemd160_block_data_order
 
index f88d3d6dadbab77b76ba8e047ea4eb7903a7e80d..4eae07484913fb7329b36f3a8554c872b54057b0 100644 (file)
@@ -88,17 +88,17 @@ int SHA224_Final (unsigned char *md, SHA256_CTX *c)
        switch ((c)->md_len)            \
        {   case SHA224_DIGEST_LENGTH:  \
                for (nn=0;nn<SHA224_DIGEST_LENGTH/4;nn++)       \
-               {   ll=(c)->h[nn]; HOST_l2c(ll,(s));   }        \
+               {   ll=(c)->h[nn]; (void)HOST_l2c(ll,(s));   }  \
                break;                  \
            case SHA256_DIGEST_LENGTH:  \
                for (nn=0;nn<SHA256_DIGEST_LENGTH/4;nn++)       \
-               {   ll=(c)->h[nn]; HOST_l2c(ll,(s));   }        \
+               {   ll=(c)->h[nn]; (void)HOST_l2c(ll,(s));   }  \
                break;                  \
            default:                    \
                if ((c)->md_len > SHA256_DIGEST_LENGTH) \
                    return 0;                           \
                for (nn=0;nn<(c)->md_len/4;nn++)                \
-               {   ll=(c)->h[nn]; HOST_l2c(ll,(s));   }        \
+               {   ll=(c)->h[nn]; (void)HOST_l2c(ll,(s));   }  \
                break;                  \
        }                               \
        } while (0)
index 7a0c3ca8d8ced28d743f0fd4ab4af6878128c99f..d673255f78b0662f8603fa923762ff74743fd8cd 100644 (file)
 #define HASH_CBLOCK             SHA_CBLOCK
 #define HASH_MAKE_STRING(c,s)   do {   \
        unsigned long ll;               \
-       ll=(c)->h0; HOST_l2c(ll,(s));   \
-       ll=(c)->h1; HOST_l2c(ll,(s));   \
-       ll=(c)->h2; HOST_l2c(ll,(s));   \
-       ll=(c)->h3; HOST_l2c(ll,(s));   \
-       ll=(c)->h4; HOST_l2c(ll,(s));   \
+       ll=(c)->h0; (void)HOST_l2c(ll,(s));     \
+       ll=(c)->h1; (void)HOST_l2c(ll,(s));     \
+       ll=(c)->h2; (void)HOST_l2c(ll,(s));     \
+       ll=(c)->h3; (void)HOST_l2c(ll,(s));     \
+       ll=(c)->h4; (void)HOST_l2c(ll,(s));     \
        } while (0)
 
 #if defined(SHA_0)
@@ -256,21 +256,21 @@ static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, size_t num)
                }
        else
                {
-               HOST_c2l(data,l); X( 0)=l;              HOST_c2l(data,l); X( 1)=l;
-               BODY_00_15( 0,A,B,C,D,E,T,X( 0));       HOST_c2l(data,l); X( 2)=l;
-               BODY_00_15( 1,T,A,B,C,D,E,X( 1));       HOST_c2l(data,l); X( 3)=l;
-               BODY_00_15( 2,E,T,A,B,C,D,X( 2));       HOST_c2l(data,l); X( 4)=l;
-               BODY_00_15( 3,D,E,T,A,B,C,X( 3));       HOST_c2l(data,l); X( 5)=l;
-               BODY_00_15( 4,C,D,E,T,A,B,X( 4));       HOST_c2l(data,l); X( 6)=l;
-               BODY_00_15( 5,B,C,D,E,T,A,X( 5));       HOST_c2l(data,l); X( 7)=l;
-               BODY_00_15( 6,A,B,C,D,E,T,X( 6));       HOST_c2l(data,l); X( 8)=l;
-               BODY_00_15( 7,T,A,B,C,D,E,X( 7));       HOST_c2l(data,l); X( 9)=l;
-               BODY_00_15( 8,E,T,A,B,C,D,X( 8));       HOST_c2l(data,l); X(10)=l;
-               BODY_00_15( 9,D,E,T,A,B,C,X( 9));       HOST_c2l(data,l); X(11)=l;
-               BODY_00_15(10,C,D,E,T,A,B,X(10));       HOST_c2l(data,l); X(12)=l;
-               BODY_00_15(11,B,C,D,E,T,A,X(11));       HOST_c2l(data,l); X(13)=l;
-               BODY_00_15(12,A,B,C,D,E,T,X(12));       HOST_c2l(data,l); X(14)=l;
-               BODY_00_15(13,T,A,B,C,D,E,X(13));       HOST_c2l(data,l); X(15)=l;
+               (void)HOST_c2l(data,l); X( 0)=l;        (void)HOST_c2l(data,l); X( 1)=l;
+               BODY_00_15( 0,A,B,C,D,E,T,X( 0));       (void)HOST_c2l(data,l); X( 2)=l;
+               BODY_00_15( 1,T,A,B,C,D,E,X( 1));       (void)HOST_c2l(data,l); X( 3)=l;
+               BODY_00_15( 2,E,T,A,B,C,D,X( 2));       (void)HOST_c2l(data,l); X( 4)=l;
+               BODY_00_15( 3,D,E,T,A,B,C,X( 3));       (void)HOST_c2l(data,l); X( 5)=l;
+               BODY_00_15( 4,C,D,E,T,A,B,X( 4));       (void)HOST_c2l(data,l); X( 6)=l;
+               BODY_00_15( 5,B,C,D,E,T,A,X( 5));       (void)HOST_c2l(data,l); X( 7)=l;
+               BODY_00_15( 6,A,B,C,D,E,T,X( 6));       (void)HOST_c2l(data,l); X( 8)=l;
+               BODY_00_15( 7,T,A,B,C,D,E,X( 7));       (void)HOST_c2l(data,l); X( 9)=l;
+               BODY_00_15( 8,E,T,A,B,C,D,X( 8));       (void)HOST_c2l(data,l); X(10)=l;
+               BODY_00_15( 9,D,E,T,A,B,C,X( 9));       (void)HOST_c2l(data,l); X(11)=l;
+               BODY_00_15(10,C,D,E,T,A,B,X(10));       (void)HOST_c2l(data,l); X(12)=l;
+               BODY_00_15(11,B,C,D,E,T,A,X(11));       (void)HOST_c2l(data,l); X(13)=l;
+               BODY_00_15(12,A,B,C,D,E,T,X(12));       (void)HOST_c2l(data,l); X(14)=l;
+               BODY_00_15(13,T,A,B,C,D,E,X(13));       (void)HOST_c2l(data,l); X(15)=l;
                BODY_00_15(14,E,T,A,B,C,D,X(14));
                BODY_00_15(15,D,E,T,A,B,C,X(15));
                }