block-sha1: drop trailing semicolon from macro definition
PATCH 1/1 block-sha1: drop trailing semicolon from macro definition
23119ffb4e (block-sha1: put expanded macro parameters in parentheses, 2012-07-22) added a trailing semicolon to the definition of SHA_MIX without explanation. It doesn't matter with the current code, but make sure to avoid potential surprises by removing it again.
This allows the macro to be used almost like a function: Users can combine it with operators of their choice, but still must not pass an expression with side-effects as a parameter, as it would be evaluated multiple times.
--- block-sha1/sha1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block-sha1/sha1.c +1 -1
@@ -70,7 +70,7 @@* the input data, the next mix it from the 512-bit array. */ #define SHA_SRC (t) get_be32((unsigned char *) block + (t)*4) -#define SHA_MIX (t) SHA_ROL(W((t)+13) ^ W((t)+8) ^ W((t)+2) ^ W(t), 1); +#define SHA_MIX (t) SHA_ROL(W((t)+13) ^ W((t)+8) ^ W((t)+2) ^ W(t), 1)#define SHA_ROUND (t, input, fn, constant,A ,B ,C ,D ,E ) do { \ unsigned int TEMP = input(t); setW(t, TEMP); \
--
2.30.2
Quoted 10 lines · René Scharfe.
23119ffb4e(block-sha1: put expanded macro parameters in parentheses, 2012-07-22) added a trailing semicolon to the definition ofSHA_MIXwithout explanation. It doesn't matter with the current code, but make sure to avoid potential surprises by removing it again.This allows the macro to be used almost like a function: Users can combine it with operators of their choice, but still must not pass an expression with side-effects as a parameter, as it would be evaluated multiple times.
Quoted 4 lines
Signed-off-by René Scharfe <[email protected]>--- block-sha1/sha1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Yes, it was just a typo.