From a6d20b89db8ee79b1a5f8188a680fea8047b145e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 30 Dec 2020 16:54:28 +0100 Subject: cleanup: fix two empty expression statement has no effect Follow-up to 26e46617b9 --- docs/examples/multi-single.c | 2 +- lib/sha256.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/examples/multi-single.c b/docs/examples/multi-single.c index c30447492..2c64d2375 100644 --- a/docs/examples/multi-single.c +++ b/docs/examples/multi-single.c @@ -40,7 +40,7 @@ /* Portable sleep for platforms other than Windows. */ #define WAITMS(x) \ struct timeval wait = { 0, (x) * 1000 }; \ - (void)select(0, NULL, NULL, NULL, &wait); + (void)select(0, NULL, NULL, NULL, &wait) #endif /* diff --git a/lib/sha256.c b/lib/sha256.c index c64ee0936..d91511791 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -344,11 +344,14 @@ static int sha256_compress(struct sha256_state *md, } /* Compress */ -#define RND(a,b,c,d,e,f,g,h,i) \ - unsigned long t0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \ - unsigned long t1 = Sigma0(a) + Maj(a, b, c); \ - d += t0; \ - h = t0 + t1; +#define RND(a,b,c,d,e,f,g,h,i) \ + do { \ + unsigned long t0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \ + unsigned long t1 = Sigma0(a) + Maj(a, b, c); \ + d += t0; \ + h = t0 + t1; \ + } while(0) + for(i = 0; i < 64; ++i) { unsigned long t; RND(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], i); -- cgit v1.2.1