Mercurial > hg > nginx-quic
comparison src/http/modules/ngx_http_map_module.c @ 5362:79b9101cecf4
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 04 Sep 2013 21:16:59 +0400 |
parents | 5482671df278 |
children | 2a621245f4cf |
comparison
equal
deleted
inserted
replaced
5361:7094d6da2806 | 5362:79b9101cecf4 |
---|---|
129 if (value == NULL) { | 129 if (value == NULL) { |
130 value = map->default_value; | 130 value = map->default_value; |
131 } | 131 } |
132 | 132 |
133 if (!value->valid) { | 133 if (!value->valid) { |
134 value = ngx_http_get_flushed_variable(r, (ngx_uint_t) value->data); | 134 value = ngx_http_get_flushed_variable(r, (uintptr_t) value->data); |
135 | 135 |
136 if (value == NULL || value->not_found) { | 136 if (value == NULL || value->not_found) { |
137 value = &ngx_http_variable_null_value; | 137 value = &ngx_http_variable_null_value; |
138 } | 138 } |
139 } | 139 } |
412 } | 412 } |
413 | 413 |
414 var = ctx->var_values.elts; | 414 var = ctx->var_values.elts; |
415 | 415 |
416 for (i = 0; i < ctx->var_values.nelts; i++) { | 416 for (i = 0; i < ctx->var_values.nelts; i++) { |
417 if (index == (ngx_int_t) var[i].data) { | 417 if (index == (intptr_t) var[i].data) { |
418 var = &var[i]; | 418 var = &var[i]; |
419 goto found; | 419 goto found; |
420 } | 420 } |
421 } | 421 } |
422 | 422 |
427 | 427 |
428 var->valid = 0; | 428 var->valid = 0; |
429 var->no_cacheable = 0; | 429 var->no_cacheable = 0; |
430 var->not_found = 0; | 430 var->not_found = 0; |
431 var->len = 0; | 431 var->len = 0; |
432 var->data = (u_char *) index; | 432 var->data = (u_char *) (intptr_t) index; |
433 | 433 |
434 goto found; | 434 goto found; |
435 } | 435 } |
436 | 436 |
437 key = 0; | 437 key = 0; |