Skip to content

Commit a122185

Browse files
drafnelgitster
authored andcommitted
block-sha1/sha1.c: silence compiler complaints by casting void * to char *
Some compilers produce errors when arithmetic is attempted on pointers to void. We want computations done on byte addresses, so cast them to char * to work them around. Signed-off-by: Brandon Casey <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ee7dc31 commit a122185

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
@@ -246,14 +246,14 @@ void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *data, unsigned long len)
246246
memcpy(lenW + (char *)ctx->W, data, left);
247247
lenW = (lenW + left) & 63;
248248
len -= left;
249-
data += left;
249+
data = ((const char *)data + left);
250250
if (lenW)
251251
return;
252252
blk_SHA1_Block(ctx, ctx->W);
253253
}
254254
while (len >= 64) {
255255
blk_SHA1_Block(ctx, data);
256-
data += 64;
256+
data = ((const char *)data + 64);
257257
len -= 64;
258258
}
259259
if (len)

0 commit comments

Comments
 (0)