aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_map_module.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2013-09-04 21:16:59 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2013-09-04 21:16:59 +0400
commit2b0dba578fed500c1955979a8e281f4fad53bad9 (patch)
treee6f6e6e857fba187334f34036d6793ba8c2943ae /src/http/modules/ngx_http_map_module.c
parent5ab74625d6b28860a08d64ee808a62508a1491dc (diff)
downloadnginx-2b0dba578fed500c1955979a8e281f4fad53bad9.tar.gz
nginx-2b0dba578fed500c1955979a8e281f4fad53bad9.zip
Handling of ngx_int_t != intptr_t case.
Casts between pointers and integers produce warnings on size mismatch. To silence them, cast to (u)intptr_t should be used. Prevoiusly, casts to ngx_(u)int_t were used in some cases, and several ngx_int_t expressions had no casts. As of now it's mostly style as ngx_int_t is defined as intptr_t.
Diffstat (limited to 'src/http/modules/ngx_http_map_module.c')
-rw-r--r--src/http/modules/ngx_http_map_module.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/http/modules/ngx_http_map_module.c b/src/http/modules/ngx_http_map_module.c
index 13c8b97ff..3245e0413 100644
--- a/src/http/modules/ngx_http_map_module.c
+++ b/src/http/modules/ngx_http_map_module.c
@@ -131,7 +131,7 @@ ngx_http_map_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
}
if (!value->valid) {
- value = ngx_http_get_flushed_variable(r, (ngx_uint_t) value->data);
+ value = ngx_http_get_flushed_variable(r, (uintptr_t) value->data);
if (value == NULL || value->not_found) {
value = &ngx_http_variable_null_value;
@@ -414,7 +414,7 @@ ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
var = ctx->var_values.elts;
for (i = 0; i < ctx->var_values.nelts; i++) {
- if (index == (ngx_int_t) var[i].data) {
+ if (index == (intptr_t) var[i].data) {
var = &var[i];
goto found;
}
@@ -429,7 +429,7 @@ ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
var->no_cacheable = 0;
var->not_found = 0;
var->len = 0;
- var->data = (u_char *) index;
+ var->data = (u_char *) (intptr_t) index;
goto found;
}