Skip to content

Commit fd536d3

Browse files
committed
block-sha1: minor fixups
Bert Wesarg noticed non-x86 version of SHA_ROT() had a typo. Also spell in-line assembly as __asm__(), otherwise I seem to get error: implicit declaration of function 'asm' from my compiler. Signed-off-by: Junio C Hamano <[email protected]>
1 parent b8e48a8 commit fd536d3

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
@@ -82,13 +82,13 @@ void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx)
8282

8383
#if defined(__i386__) || defined(__x86_64__)
8484

85-
#define SHA_ASM(op, x, n) ({ unsigned int __res; asm(op " %1,%0":"=r" (__res):"i" (n), "0" (x)); __res; })
85+
#define SHA_ASM(op, x, n) ({ unsigned int __res; __asm__(op " %1,%0":"=r" (__res):"i" (n), "0" (x)); __res; })
8686
#define SHA_ROL(x,n) SHA_ASM("rol", x, n)
8787
#define SHA_ROR(x,n) SHA_ASM("ror", x, n)
8888

8989
#else
9090

91-
#define SHA_ROT(X,n) (((X) << (l)) | ((X) >> (r)))
91+
#define SHA_ROT(X,l,r) (((X) << (l)) | ((X) >> (r)))
9292
#define SHA_ROL(X,n) SHA_ROT(X,n,32-(n))
9393
#define SHA_ROR(X,n) SHA_ROT(X,32-(n),n)
9494

0 commit comments

Comments
 (0)