fixing warnings in sha1 code
authorJacob Parker <j3parker@uwaterloo.ca>
Thu, 10 Nov 2011 22:03:44 +0000 (17:03 -0500)
committerJacob Parker <j3parker@uwaterloo.ca>
Thu, 10 Nov 2011 22:03:44 +0000 (17:03 -0500)
database/linus_sha1.c

index 6cd6123..497c192 100644 (file)
@@ -43,14 +43,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 = (char*)data + left; // j3parker: fixing void* arithmetic
                if (lenW)
                        return;
                blk_SHA1Block(ctx, (const unsigned int*)ctx->W);
        }
        while (len >= 64) {
                blk_SHA1Block(ctx, (const unsigned int*)data);
-               data += 64;
+               data = (char*)data + 64; // j3parker: fixing void* arithmetic
                len -= 64;
        }
        if (len)