From: Sebastian Pop Date: Tue, 5 Mar 2019 18:27:05 +0000 (+0000) Subject: remove MEMCPY, replace with memcpy X-Git-Tag: 1.9.9-b1~515 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25443e9048417ff95c9d315a3a00898c74a30f1c;p=thirdparty%2Fzlib-ng.git remove MEMCPY, replace with memcpy --- diff --git a/arch/x86/deflate_quick.c b/arch/x86/deflate_quick.c index 9968b960..bb57f78c 100644 --- a/arch/x86/deflate_quick.c +++ b/arch/x86/deflate_quick.c @@ -152,7 +152,7 @@ static inline void quick_send_bits(deflate_state *const s, s->bi_valid = width - (bytes_out * 8); /* Taking advantage of the fact that LSB comes first, write to output buffer */ - MEMCPY(s->pending_buf + s->pending, &out, sizeof(out)); + memcpy(s->pending_buf + s->pending, &out, sizeof(out)); s->pending += bytes_out; } diff --git a/deflate.h b/deflate.h index 6cba8dd3..46847d55 100644 --- a/deflate.h +++ b/deflate.h @@ -307,7 +307,7 @@ static inline void put_short(deflate_state *s, uint16_t w) { #if BYTE_ORDER == BIG_ENDIAN w = ZSWAP16(w); #endif - MEMCPY(&(s->pending_buf[s->pending]), &w, sizeof(uint16_t)); + memcpy(&(s->pending_buf[s->pending]), &w, sizeof(uint16_t)); s->pending += 2; } diff --git a/inffast.c b/inffast.c index 5e965681..af623eb6 100644 --- a/inffast.c +++ b/inffast.c @@ -28,7 +28,7 @@ */ static inline inffast_chunk_t loadchunk(unsigned char const* s) { inffast_chunk_t c; - __builtin_memcpy(&c, s, sizeof(c)); + memcpy(&c, s, sizeof(c)); return c; } @@ -37,7 +37,7 @@ static inline inffast_chunk_t loadchunk(unsigned char const* s) { instruction appropriate for the inffast_chunk_t type. */ static inline void storechunk(unsigned char* d, inffast_chunk_t c) { - __builtin_memcpy(d, &c, sizeof(c)); + memcpy(d, &c, sizeof(c)); } /* diff --git a/memcopy.h b/memcopy.h index 7f8697b1..8a619918 100644 --- a/memcopy.h +++ b/memcopy.h @@ -7,7 +7,7 @@ /* Load 64 bits from IN and place the bytes at offset BITS in the result. */ static inline uint64_t load_64_bits(const unsigned char *in, unsigned bits) { uint64_t chunk; - MEMCPY(&chunk, in, sizeof(chunk)); + memcpy(&chunk, in, sizeof(chunk)); #if BYTE_ORDER == LITTLE_ENDIAN return chunk << bits; @@ -24,8 +24,8 @@ static inline unsigned char *copy_1_bytes(unsigned char *out, unsigned char *fro static inline unsigned char *copy_2_bytes(unsigned char *out, unsigned char *from) { uint16_t chunk; unsigned sz = sizeof(chunk); - MEMCPY(&chunk, from, sz); - MEMCPY(out, &chunk, sz); + memcpy(&chunk, from, sz); + memcpy(out, &chunk, sz); return out + sz; } @@ -37,8 +37,8 @@ static inline unsigned char *copy_3_bytes(unsigned char *out, unsigned char *fro static inline unsigned char *copy_4_bytes(unsigned char *out, unsigned char *from) { uint32_t chunk; unsigned sz = sizeof(chunk); - MEMCPY(&chunk, from, sz); - MEMCPY(out, &chunk, sz); + memcpy(&chunk, from, sz); + memcpy(out, &chunk, sz); return out + sz; } @@ -60,8 +60,8 @@ static inline unsigned char *copy_7_bytes(unsigned char *out, unsigned char *fro static inline unsigned char *copy_8_bytes(unsigned char *out, unsigned char *from) { uint64_t chunk; unsigned sz = sizeof(chunk); - MEMCPY(&chunk, from, sz); - MEMCPY(out, &chunk, sz); + memcpy(&chunk, from, sz); + memcpy(out, &chunk, sz); return out + sz; } diff --git a/zutil.h b/zutil.h index e80cc316..9e005a7b 100644 --- a/zutil.h +++ b/zutil.h @@ -239,10 +239,8 @@ void ZLIB_INTERNAL zcfree(void *opaque, void *ptr); #endif #if (defined(__GNUC__) || defined(__clang__)) -#define MEMCPY __builtin_memcpy #define MEMSET __builtin_memset #else -#define MEMCPY memcpy #define MEMSET memset #endif