Mercurial > hg > nginx
comparison src/core/ngx_string.h @ 3644:5d3282cfc43c
fix a bug when ngx_cpymem() returns a cast type:
p = (type *) ngx_cpymem(...)
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 24 Jun 2010 15:17:06 +0000 |
parents | 6802ba529ec4 |
children | 7224d008faaf |
comparison
equal
deleted
inserted
replaced
3643:762712d69672 | 3644:5d3282cfc43c |
---|---|
87 | 87 |
88 | 88 |
89 #if (NGX_MEMCPY_LIMIT) | 89 #if (NGX_MEMCPY_LIMIT) |
90 | 90 |
91 void *ngx_memcpy(void *dst, void *src, size_t n); | 91 void *ngx_memcpy(void *dst, void *src, size_t n); |
92 #define ngx_cpymem(dst, src, n) ((u_char *) ngx_memcpy(dst, src, n)) + (n) | 92 #define ngx_cpymem(dst, src, n) (((u_char *) ngx_memcpy(dst, src, n)) + (n)) |
93 | 93 |
94 #else | 94 #else |
95 | 95 |
96 /* | 96 /* |
97 * gcc3, msvc, and icc7 compile memcpy() to the inline "rep movs". | 97 * gcc3, msvc, and icc7 compile memcpy() to the inline "rep movs". |
98 * gcc3 compiles memcpy(d, s, 4) to the inline "mov"es. | 98 * gcc3 compiles memcpy(d, s, 4) to the inline "mov"es. |
99 * icc8 compile memcpy(d, s, 4) to the inline "mov"es or XMM moves. | 99 * icc8 compile memcpy(d, s, 4) to the inline "mov"es or XMM moves. |
100 */ | 100 */ |
101 #define ngx_memcpy(dst, src, n) (void) memcpy(dst, src, n) | 101 #define ngx_memcpy(dst, src, n) (void) memcpy(dst, src, n) |
102 #define ngx_cpymem(dst, src, n) ((u_char *) memcpy(dst, src, n)) + (n) | 102 #define ngx_cpymem(dst, src, n) (((u_char *) memcpy(dst, src, n)) + (n)) |
103 | 103 |
104 #endif | 104 #endif |
105 | 105 |
106 | 106 |
107 #if ( __INTEL_COMPILER >= 800 ) | 107 #if ( __INTEL_COMPILER >= 800 ) |