diff options
| author | Ruslan Ermilov <ru@nginx.com> | 2012-05-29 09:19:51 +0000 |
|---|---|---|
| committer | Ruslan Ermilov <ru@nginx.com> | 2012-05-29 09:19:51 +0000 |
| commit | 94d8df609872916b4899f12269633447dd06e182 (patch) | |
| tree | f61939adbef271382640fd5f7c9a12162d36308d | |
| parent | 49fbd88466cb10da41d699eca29c99069a223b06 (diff) | |
| download | nginx-94d8df609872916b4899f12269633447dd06e182.tar.gz nginx-94d8df609872916b4899f12269633447dd06e182.tar.bz2 | |
geoip: got rid of ugly casts when calling ngx_free().
This is done by removing the "const" qualifier from the common return
type of handler functions returning either "const char *" or "char *".
| -rw-r--r-- | src/http/modules/ngx_http_geoip_module.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/http/modules/ngx_http_geoip_module.c b/src/http/modules/ngx_http_geoip_module.c index 66cd3fb21..0ce3bf1e5 100644 --- a/src/http/modules/ngx_http_geoip_module.c +++ b/src/http/modules/ngx_http_geoip_module.c @@ -28,7 +28,7 @@ typedef struct { } ngx_http_geoip_var_t; -typedef const char *(*ngx_http_geoip_variable_handler_pt)(GeoIP *, u_long addr); +typedef char *(*ngx_http_geoip_variable_handler_pt)(GeoIP *, u_long addr); static u_long ngx_http_geoip_addr(ngx_http_request_t *r, ngx_http_geoip_conf_t *gcf); @@ -292,7 +292,7 @@ ngx_http_geoip_org_variable(ngx_http_request_t *r, (ngx_http_geoip_variable_handler_pt) data; size_t len; - const char *val; + char *val; ngx_http_geoip_conf_t *gcf; gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip_module); @@ -310,7 +310,7 @@ ngx_http_geoip_org_variable(ngx_http_request_t *r, len = ngx_strlen(val); v->data = ngx_pnalloc(r->pool, len); if (v->data == NULL) { - ngx_free((void *) val); + ngx_free(val); return NGX_ERROR; } @@ -321,7 +321,7 @@ ngx_http_geoip_org_variable(ngx_http_request_t *r, v->no_cacheable = 0; v->not_found = 0; - ngx_free((void *) val); + ngx_free(val); return NGX_OK; |
