From d053bacb9cbeda00b8e7c6b982258ce7b025b2bd Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Fri, 3 Aug 2012 09:07:30 +0000 Subject: Added "const" to ngx_memcpy() with NGX_MEMCPY_LIMIT defined. This fixes warning produced during compilation of the ngx_http_geoip_module due to const qualifier being discarded. --- src/core/ngx_string.c | 2 +- src/core/ngx_string.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c index 8aaa1d2ed..3b392f7b2 100644 --- a/src/core/ngx_string.c +++ b/src/core/ngx_string.c @@ -1827,7 +1827,7 @@ ngx_sort(void *base, size_t n, size_t size, #if (NGX_MEMCPY_LIMIT) void * -ngx_memcpy(void *dst, void *src, size_t n) +ngx_memcpy(void *dst, const void *src, size_t n) { if (n > NGX_MEMCPY_LIMIT) { ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, "memcpy %uz bytes", n); diff --git a/src/core/ngx_string.h b/src/core/ngx_string.h index fa386ca72..92d246ebc 100644 --- a/src/core/ngx_string.h +++ b/src/core/ngx_string.h @@ -89,7 +89,7 @@ ngx_strlchr(u_char *p, u_char *last, u_char c) #if (NGX_MEMCPY_LIMIT) -void *ngx_memcpy(void *dst, void *src, size_t n); +void *ngx_memcpy(void *dst, const void *src, size_t n); #define ngx_cpymem(dst, src, n) (((u_char *) ngx_memcpy(dst, src, n)) + (n)) #else -- cgit