summaryrefslogtreecommitdiffstats
path: root/crypto/sha
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2016-02-25 23:19:06 +0000
committerRich Salz <rsalz@openssl.org>2016-03-01 12:10:18 -0500
commit09977dd095f3c655c99b9e1810a213f7eafa7364 (patch)
tree1d0e769c39fc50b51d6197deb6b684f25ee96bf8 /crypto/sha
parent0f97a12112bf748474662080848f75804a8fddc4 (diff)
RT4347: Fix GCC unused-value warnings with HOST_c2l()
The HOST_c2l() macro assigns the value to the specified variable, but also evaluates to the same value. Which we ignore, triggering a warning. To fix this, just cast it to void like we did in commit 08e553644 ("Fix some clang warnings.") for a bunch of other instances. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'crypto/sha')
-rw-r--r--crypto/sha/sha256.c34
-rw-r--r--crypto/sha/sha_locl.h2
2 files changed, 18 insertions, 18 deletions
diff --git a/crypto/sha/sha256.c b/crypto/sha/sha256.c
index d7d33d524c..53b6054122 100644
--- a/crypto/sha/sha256.c
+++ b/crypto/sha/sha256.c
@@ -181,7 +181,7 @@ static void sha256_block_data_order(SHA256_CTX *ctx, const void *in,
h = ctx->h[7];
for (i = 0; i < 16; i++) {
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[i] = l;
T1 += h + Sigma1(e) + Ch(e, f, g) + K256[i];
T2 = Sigma0(a) + Maj(a, b, c);
@@ -305,52 +305,52 @@ static void sha256_block_data_order(SHA256_CTX *ctx, const void *in,
} else {
SHA_LONG l;
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[0] = l;
ROUND_00_15(0, a, b, c, d, e, f, g, h);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[1] = l;
ROUND_00_15(1, h, a, b, c, d, e, f, g);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[2] = l;
ROUND_00_15(2, g, h, a, b, c, d, e, f);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[3] = l;
ROUND_00_15(3, f, g, h, a, b, c, d, e);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[4] = l;
ROUND_00_15(4, e, f, g, h, a, b, c, d);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[5] = l;
ROUND_00_15(5, d, e, f, g, h, a, b, c);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[6] = l;
ROUND_00_15(6, c, d, e, f, g, h, a, b);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[7] = l;
ROUND_00_15(7, b, c, d, e, f, g, h, a);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[8] = l;
ROUND_00_15(8, a, b, c, d, e, f, g, h);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[9] = l;
ROUND_00_15(9, h, a, b, c, d, e, f, g);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[10] = l;
ROUND_00_15(10, g, h, a, b, c, d, e, f);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[11] = l;
ROUND_00_15(11, f, g, h, a, b, c, d, e);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[12] = l;
ROUND_00_15(12, e, f, g, h, a, b, c, d);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[13] = l;
ROUND_00_15(13, d, e, f, g, h, a, b, c);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[14] = l;
ROUND_00_15(14, c, d, e, f, g, h, a, b);
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
T1 = X[15] = l;
ROUND_00_15(15, b, c, d, e, f, g, h, a);
}
diff --git a/crypto/sha/sha_locl.h b/crypto/sha/sha_locl.h
index 87e69d8984..649cdeda09 100644
--- a/crypto/sha/sha_locl.h
+++ b/crypto/sha/sha_locl.h
@@ -430,7 +430,7 @@ static void HASH_BLOCK_DATA_ORDER(SHA_CTX *c, const void *p, size_t num)
for (;;) {
for (i = 0; i < 16; i++) {
- HOST_c2l(data, l);
+ (void)HOST_c2l(data, l);
X[i] = l;
BODY_00_15(X[i]);
}