summaryrefslogtreecommitdiff
path: root/block-sha1
diff options
context:
space:
mode:
authorLibravatar Jonathan Nieder <jrnieder@gmail.com>2012-07-22 18:40:54 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-07-22 21:13:53 -0700
commit23119ffb4ea91cdf30016254df60e1adc64b478c (patch)
treecf66c7b3677c0d1a11b1218aa8d06b3a27f4e235 /block-sha1
parentblock-sha1: avoid pointer conversion that violates alignment constraints (diff)
downloadtgif-23119ffb4ea91cdf30016254df60e1adc64b478c.tar.xz
block-sha1: put expanded macro parameters in parentheses
't' is currently always a numeric constant, but it can't hurt to prepare for the day that it becomes useful for a caller to pass in a more complex expression. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'block-sha1')
-rw-r--r--block-sha1/sha1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block-sha1/sha1.c b/block-sha1/sha1.c
index 10fd94d179..6f885c4333 100644
--- a/block-sha1/sha1.c
+++ b/block-sha1/sha1.c
@@ -100,8 +100,8 @@
* Where do we get the source from? The first 16 iterations get it from
* 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_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_ROUND(t, input, fn, constant, A, B, C, D, E) do { \
unsigned int TEMP = input(t); setW(t, TEMP); \