Skip to content

Commit

Permalink
block-sha1/sha1.c: silence compiler complaints by casting void * to c…
Browse files Browse the repository at this point in the history
…har *

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>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed Aug 15, 2009
1 parent ee7dc31 commit a122185
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block-sha1/sha1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
lenW = (lenW + left) & 63;
len -= left;
data += left;
data = ((const char *)data + left);
if (lenW)
return;
blk_SHA1_Block(ctx, ctx->W);
}
while (len >= 64) {
blk_SHA1_Block(ctx, data);
data += 64;
data = ((const char *)data + 64);
len -= 64;
}
if (len)
Expand Down

0 comments on commit a122185

Please sign in to comment.