[master] bd5ade3 Revert "failing crc32 checks on macos + clang - casting the culprit?"

Nils Goroll nils.goroll at uplex.de
Mon Sep 12 20:35:14 CEST 2016


commit bd5ade3e542217e99062a4543cd66bd82586d6e4
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Sep 12 20:34:18 2016 +0200

    Revert "failing crc32 checks on macos + clang - casting the culprit?"
    
    This reverts commit 4a5ec60af1ff1a0ec81b7c255f5d9ca01299b1be.

diff --git a/lib/libvmod_directors/crc32.c b/lib/libvmod_directors/crc32.c
index 44a5250..714b0f0 100644
--- a/lib/libvmod_directors/crc32.c
+++ b/lib/libvmod_directors/crc32.c
@@ -83,15 +83,17 @@ static const uint32_t crc32bits[] = {
 };
 
 uint32_t
-crc32(uint32_t crc, const unsigned char *p, unsigned l)
+crc32(uint32_t crc, const void *p1, unsigned l)
 {
-	for (; l-- > 0; p++)
+	const unsigned char *p;
+
+	for (p = (const unsigned char*)p1; l-- > 0; p++)
 		crc = (crc >> 8) ^ crc32bits[(crc ^ *p) & 0xff];
 	return (crc);
 }
 
 uint32_t
-crc32_l(const unsigned char *p1, unsigned l)
+crc32_l(const void *p1, unsigned l)
 {
 	uint32_t crc;
 
diff --git a/lib/libvmod_directors/crc32.h b/lib/libvmod_directors/crc32.h
index dfe56ab..39adf8a 100644
--- a/lib/libvmod_directors/crc32.h
+++ b/lib/libvmod_directors/crc32.h
@@ -1,3 +1,3 @@
 #include <stdint.h>
-uint32_t crc32(uint32_t crc, const unsigned char *, unsigned);
-uint32_t crc32_l(const unsigned char *, unsigned);
+uint32_t crc32(uint32_t crc, const void *p1, unsigned l);
+uint32_t crc32_l(const void *p1, unsigned l);



More information about the varnish-commit mailing list