[nginx] svn commit: r4782 - trunk/src/core

mdounin at mdounin.ru mdounin at mdounin.ru
Fri Aug 3 09:07:30 UTC 2012


Author: mdounin
Date: 2012-08-03 09:07:30 +0000 (Fri, 03 Aug 2012)
New Revision: 4782
URL: http://trac.nginx.org/nginx/changeset/4782/nginx

Log:
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.


Modified:
   trunk/src/core/ngx_string.c
   trunk/src/core/ngx_string.h

Modified: trunk/src/core/ngx_string.c
===================================================================
--- trunk/src/core/ngx_string.c	2012-08-03 09:00:25 UTC (rev 4781)
+++ trunk/src/core/ngx_string.c	2012-08-03 09:07:30 UTC (rev 4782)
@@ -1827,7 +1827,7 @@
 #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);

Modified: trunk/src/core/ngx_string.h
===================================================================
--- trunk/src/core/ngx_string.h	2012-08-03 09:00:25 UTC (rev 4781)
+++ trunk/src/core/ngx_string.h	2012-08-03 09:07:30 UTC (rev 4782)
@@ -89,7 +89,7 @@
 
 #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



More information about the nginx-devel mailing list