Skip to content

Commit 23119ff

Browse files
jrngitster
authored andcommitted
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 <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5f6a112 commit 23119ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

block-sha1/sha1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@
100100
* Where do we get the source from? The first 16 iterations get it from
101101
* the input data, the next mix it from the 512-bit array.
102102
*/
103-
#define SHA_SRC(t) get_be32((unsigned char *) block + t*4)
104-
#define SHA_MIX(t) SHA_ROL(W(t+13) ^ W(t+8) ^ W(t+2) ^ W(t), 1)
103+
#define SHA_SRC(t) get_be32((unsigned char *) block + (t)*4)
104+
#define SHA_MIX(t) SHA_ROL(W((t)+13) ^ W((t)+8) ^ W((t)+2) ^ W(t), 1);
105105

106106
#define SHA_ROUND(t, input, fn, constant, A, B, C, D, E) do { \
107107
unsigned int TEMP = input(t); setW(t, TEMP); \

0 commit comments

Comments
 (0)