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:04:39 +0000 (21:04 +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 e0962f751f70c1d8e7522cc01461f49a6d79c733..47ee9af1624666ed0373e2fba7a64639a10eb4e0 100644 (file)
@@ -105,22 +105,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 37e43fe4280d952414c8ddaedfb884db85b331bb..432f523c7eff7b467e8b4f3e19779ed3886779d9 100644 (file)
@@ -88,10 +88,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 59b017f8c0a7f8fa3fb944db91cb6998c3712274..e92f96c2f7888f5900c221bb9908d64c2a9f0191 100644 (file)
@@ -104,21 +104,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 d43ee653a35eff197adf2ff8d798369f597c9cb3..dbd5eb759e6dc128942cf235d56430da433b30ae 100644 (file)
@@ -89,17 +89,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 672c26eee1c685033827467c1c939ec750fe951d..ecbfcf100c5c1ed801b23e2c40281dded0dbb5e2 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)
@@ -252,21 +252,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));
                }