Mercurial > hg > nginx
diff src/http/ngx_http_script.c @ 9312:098019656024
Changed script length code casts to work with -Wpedantic.
Script length code casts though "void *", as introduced in
7271:9e25a5380a21 to silence -Wcast-function-type warnings, result
in "ISO C forbids conversion of function pointer to object pointer type"
warnings with -Wpedantic. Fix is to cast though uintptr_t instead.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 07 Aug 2024 03:56:38 +0300 |
parents | d26db4f82d7d |
children |
line wrap: on
line diff
--- a/src/http/ngx_http_script.c +++ b/src/http/ngx_http_script.c @@ -822,7 +822,7 @@ ngx_http_script_add_copy_code(ngx_http_s return NGX_ERROR; } - code->code = (ngx_http_script_code_pt) (void *) + code->code = (ngx_http_script_code_pt) (uintptr_t) ngx_http_script_copy_len_code; code->len = len; @@ -912,7 +912,7 @@ ngx_http_script_add_var_code(ngx_http_sc return NGX_ERROR; } - code->code = (ngx_http_script_code_pt) (void *) + code->code = (ngx_http_script_code_pt) (uintptr_t) ngx_http_script_copy_var_len_code; code->index = (uintptr_t) index; @@ -1308,7 +1308,7 @@ ngx_http_script_add_capture_code(ngx_htt return NGX_ERROR; } - code->code = (ngx_http_script_code_pt) (void *) + code->code = (ngx_http_script_code_pt) (uintptr_t) ngx_http_script_copy_capture_len_code; code->n = 2 * n; @@ -1423,7 +1423,7 @@ ngx_http_script_add_full_name_code(ngx_h return NGX_ERROR; } - code->code = (ngx_http_script_code_pt) (void *) + code->code = (ngx_http_script_code_pt) (uintptr_t) ngx_http_script_full_name_len_code; code->conf_prefix = sc->conf_prefix;