]> git.ipfire.org Git - thirdparty/git.git/commitdiff
block-sha1: drop trailing semicolon from macro definition
authorRené Scharfe <l.s.r@web.de>
Sat, 13 Mar 2021 16:17:30 +0000 (17:17 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Mar 2021 17:20:01 +0000 (10:20 -0700)
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.

Signed-off-by: René Scharfe <l.s.r@web.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
block-sha1/sha1.c

index 8681031402fb93c0e1d5a865041f6f9a924363c6..1bb6e7c069035bbf688d12cf8bcffa58790da5fc 100644 (file)
@@ -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); \