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>
This commit is contained in:
parent
ee7dc310af
commit
a12218572f
@ -246,14 +246,14 @@ void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *data, unsigned long len)
|
|||||||
memcpy(lenW + (char *)ctx->W, data, left);
|
memcpy(lenW + (char *)ctx->W, data, left);
|
||||||
lenW = (lenW + left) & 63;
|
lenW = (lenW + left) & 63;
|
||||||
len -= left;
|
len -= left;
|
||||||
data += left;
|
data = ((const char *)data + left);
|
||||||
if (lenW)
|
if (lenW)
|
||||||
return;
|
return;
|
||||||
blk_SHA1_Block(ctx, ctx->W);
|
blk_SHA1_Block(ctx, ctx->W);
|
||||||
}
|
}
|
||||||
while (len >= 64) {
|
while (len >= 64) {
|
||||||
blk_SHA1_Block(ctx, data);
|
blk_SHA1_Block(ctx, data);
|
||||||
data += 64;
|
data = ((const char *)data + 64);
|
||||||
len -= 64;
|
len -= 64;
|
||||||
}
|
}
|
||||||
if (len)
|
if (len)
|
||||||
|
Loading…
Reference in New Issue
Block a user