]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix unnecessary type casts.
authorMika Lindqvist <postmaster@raasu.org>
Wed, 13 May 2015 14:45:27 +0000 (17:45 +0300)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Wed, 13 May 2015 14:48:01 +0000 (16:48 +0200)
crc32.c

diff --git a/crc32.c b/crc32.c
index 3dd4c7d82e180f6da48ea58d20727445ea868532..e4fe6c57ebd68c6c6ba2a0382bd779317089d56b 100644 (file)
--- a/crc32.c
+++ b/crc32.c
@@ -247,7 +247,7 @@ static uint32_t crc32_little(uint32_t crc, const unsigned char *buf, unsigned le
     register uint32_t c;
     register const uint32_t *buf4;
 
-    c = (uint32_t)crc;
+    c = crc;
     c = ~c;
     while (len && ((ptrdiff_t)buf & 3)) {
         c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
@@ -273,7 +273,7 @@ static uint32_t crc32_little(uint32_t crc, const unsigned char *buf, unsigned le
         c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
     } while (--len);
     c = ~c;
-    return (uint32_t)c;
+    return c;
 }
 #endif /* BYTE_ORDER == LITTLE_ENDIAN */
 
@@ -290,7 +290,7 @@ static uint32_t crc32_big(uint32_t crc, const unsigned char *buf, unsigned len)
     register uint32_t c;
     register const uint32_t *buf4;
 
-    c = ZSWAP32((uint32_t)crc);
+    c = ZSWAP32(crc);
     c = ~c;
     while (len && ((ptrdiff_t)buf & 3)) {
         c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
@@ -318,7 +318,7 @@ static uint32_t crc32_big(uint32_t crc, const unsigned char *buf, unsigned len)
         c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
     } while (--len);
     c = ~c;
-    return (uint32_t)(ZSWAP32(c));
+    return ZSWAP32(c);
 }
 #endif /* BYTE_ORDER == BIG_ENDIAN */