From: Sebastian Pop Date: Wed, 6 Mar 2019 15:19:43 +0000 (+0000) Subject: remove MEMSET, replace with memset X-Git-Tag: 1.9.9-b1~514 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e32f017573fbbbb7262f30b1de99afc9cd24fa74;p=thirdparty%2Fzlib-ng.git remove MEMSET, replace with memset --- diff --git a/memcopy.h b/memcopy.h index 8a619918..a5db415c 100644 --- a/memcopy.h +++ b/memcopy.h @@ -177,22 +177,22 @@ static inline unsigned char *set_bytes(unsigned char *out, unsigned char *from, unsigned char c = *from; switch (len) { case 7: - MEMSET(out, c, 7); + memset(out, c, 7); return out + 7; case 6: - MEMSET(out, c, 6); + memset(out, c, 6); return out + 6; case 5: - MEMSET(out, c, 5); + memset(out, c, 5); return out + 5; case 4: - MEMSET(out, c, 4); + memset(out, c, 4); return out + 4; case 3: - MEMSET(out, c, 3); + memset(out, c, 3); return out + 3; case 2: - MEMSET(out, c, 2); + memset(out, c, 2); return out + 2; default: Assert(0, "should not happen"); @@ -275,7 +275,7 @@ static inline unsigned char *byte_memset(unsigned char *out, unsigned len) { unsigned char c = *from; /* First, deal with the case when LEN is not a multiple of SZ. */ - MEMSET(out, c, sz); + memset(out, c, sz); unsigned rem = len % sz; len /= sz; out += rem; @@ -284,46 +284,46 @@ static inline unsigned char *byte_memset(unsigned char *out, unsigned len) { len -= by8; switch (by8) { case 7: - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; case 6: - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; case 5: - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; case 4: - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; case 3: - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; case 2: - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; case 1: - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; } while (len) { /* When sz is a constant, the compiler replaces __builtin_memset with an inline version that does not incur a function call overhead. */ - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; - MEMSET(out, c, sz); + memset(out, c, sz); out += sz; len -= 8; } diff --git a/zutil.h b/zutil.h index 9e005a7b..0dfc328d 100644 --- a/zutil.h +++ b/zutil.h @@ -238,12 +238,6 @@ void ZLIB_INTERNAL zcfree(void *opaque, void *ptr); #endif #endif -#if (defined(__GNUC__) || defined(__clang__)) -#define MEMSET __builtin_memset -#else -#define MEMSET memset -#endif - #if defined(X86_CPUID) # include "arch/x86/x86.h" #elif defined(__aarch64__)