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 <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Casey committed
Aug 14, 2009 at 17:52 UTC
a12218572f2875e91b6c3c12559b076c4949a675
1 file changed
+2
-2
block-sha1/sha1.c
+2
-2
@@ -246,14 +246,14 @@ void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *data, unsigned long len)
246
memcpy(lenW + (char *)ctx->W, data, left);
247
lenW = (lenW + left) & 63;
248
len -= left;
249
- data += left;
249
+ data = ((const char *)data + left);
250
if (lenW)
251
return;
252
blk_SHA1_Block(ctx, ctx->W);
253
}
254
while (len >= 64) {
255
blk_SHA1_Block(ctx, data);
256
- data += 64;
256
+ data = ((const char *)data + 64);
257
len -= 64;
258
}
259
if (len)