[nginx] Style: NGX_PTR_SIZE replaced with sizeof(void *).

Maxim Dounin mdounin at mdounin.ru
Thu Dec 3 17:54:25 UTC 2015


details:   http://hg.nginx.org/nginx/rev/fcbac620ae83
branches:  
changeset: 6314:fcbac620ae83
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Thu Dec 03 20:06:45 2015 +0300
description:
Style: NGX_PTR_SIZE replaced with sizeof(void *).

The NGX_PTR_SIZE macro is only needed in preprocessor directives where
it's not possible to use sizeof().

diffstat:

 src/core/ngx_string.c           |  2 +-
 src/http/ngx_http_core_module.c |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diffs (24 lines):

diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c
--- a/src/core/ngx_string.c
+++ b/src/core/ngx_string.c
@@ -410,7 +410,7 @@ ngx_vslprintf(u_char *buf, u_char *last,
                 hex = 2;
                 sign = 0;
                 zero = '0';
-                width = NGX_PTR_SIZE * 2;
+                width = 2 * sizeof(void *);
                 break;
 
             case 'c':
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -3503,7 +3503,7 @@ ngx_http_core_merge_srv_conf(ngx_conf_t 
     /* TODO: it does not merge, it inits only */
 
     ngx_conf_merge_size_value(conf->connection_pool_size,
-                              prev->connection_pool_size, NGX_PTR_SIZE * 64);
+                              prev->connection_pool_size, 64 * sizeof(void *));
     ngx_conf_merge_size_value(conf->request_pool_size,
                               prev->request_pool_size, 4096);
     ngx_conf_merge_msec_value(conf->client_header_timeout,



More information about the nginx-devel mailing list