Mercurial > hg > nginx
changeset 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 | 0ad3dde83947 |
children | 7c350e517168 |
files | src/http/modules/ngx_http_fastcgi_module.c src/http/modules/ngx_http_grpc_module.c src/http/modules/ngx_http_proxy_module.c src/http/modules/ngx_http_scgi_module.c src/http/modules/ngx_http_uwsgi_module.c src/http/ngx_http_script.c src/stream/ngx_stream_script.c |
diffstat | 7 files changed, 16 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_fastcgi_module.c Wed Aug 07 03:56:31 2024 +0300 +++ b/src/http/modules/ngx_http_fastcgi_module.c Wed Aug 07 03:56:38 2024 +0300 @@ -3436,7 +3436,7 @@ return NGX_ERROR; } - copy->code = (ngx_http_script_code_pt) (void *) + copy->code = (ngx_http_script_code_pt) (uintptr_t) ngx_http_script_copy_len_code; copy->len = src[i].key.len; @@ -3446,7 +3446,7 @@ return NGX_ERROR; } - copy->code = (ngx_http_script_code_pt) (void *) + copy->code = (ngx_http_script_code_pt) (uintptr_t) ngx_http_script_copy_len_code; copy->len = src[i].skip_empty;
--- a/src/http/modules/ngx_http_grpc_module.c Wed Aug 07 03:56:31 2024 +0300 +++ b/src/http/modules/ngx_http_grpc_module.c Wed Aug 07 03:56:38 2024 +0300 @@ -4677,7 +4677,7 @@ return NGX_ERROR; } - copy->code = (ngx_http_script_code_pt) (void *) + copy->code = (ngx_http_script_code_pt) (uintptr_t) ngx_http_script_copy_len_code; copy->len = src[i].key.len;
--- a/src/http/modules/ngx_http_proxy_module.c Wed Aug 07 03:56:31 2024 +0300 +++ b/src/http/modules/ngx_http_proxy_module.c Wed Aug 07 03:56:38 2024 +0300 @@ -4047,7 +4047,7 @@ return NGX_ERROR; } - copy->code = (ngx_http_script_code_pt) (void *) + copy->code = (ngx_http_script_code_pt) (uintptr_t) ngx_http_script_copy_len_code; copy->len = src[i].key.len;
--- a/src/http/modules/ngx_http_scgi_module.c Wed Aug 07 03:56:31 2024 +0300 +++ b/src/http/modules/ngx_http_scgi_module.c Wed Aug 07 03:56:38 2024 +0300 @@ -1820,7 +1820,7 @@ return NGX_ERROR; } - copy->code = (ngx_http_script_code_pt) (void *) + copy->code = (ngx_http_script_code_pt) (uintptr_t) ngx_http_script_copy_len_code; copy->len = src[i].key.len + 1; @@ -1830,7 +1830,7 @@ return NGX_ERROR; } - copy->code = (ngx_http_script_code_pt) (void *) + copy->code = (ngx_http_script_code_pt) (uintptr_t) ngx_http_script_copy_len_code; copy->len = src[i].skip_empty;
--- a/src/http/modules/ngx_http_uwsgi_module.c Wed Aug 07 03:56:31 2024 +0300 +++ b/src/http/modules/ngx_http_uwsgi_module.c Wed Aug 07 03:56:38 2024 +0300 @@ -2118,7 +2118,7 @@ return NGX_ERROR; } - copy->code = (ngx_http_script_code_pt) (void *) + copy->code = (ngx_http_script_code_pt) (uintptr_t) ngx_http_script_copy_len_code; copy->len = src[i].key.len; @@ -2128,7 +2128,7 @@ return NGX_ERROR; } - copy->code = (ngx_http_script_code_pt) (void *) + copy->code = (ngx_http_script_code_pt) (uintptr_t) ngx_http_script_copy_len_code; copy->len = src[i].skip_empty;
--- a/src/http/ngx_http_script.c Wed Aug 07 03:56:31 2024 +0300 +++ b/src/http/ngx_http_script.c Wed Aug 07 03:56:38 2024 +0300 @@ -822,7 +822,7 @@ 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 @@ 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 @@ 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 @@ 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;
--- a/src/stream/ngx_stream_script.c Wed Aug 07 03:56:31 2024 +0300 +++ b/src/stream/ngx_stream_script.c Wed Aug 07 03:56:38 2024 +0300 @@ -686,7 +686,7 @@ return NGX_ERROR; } - code->code = (ngx_stream_script_code_pt) (void *) + code->code = (ngx_stream_script_code_pt) (uintptr_t) ngx_stream_script_copy_len_code; code->len = len; @@ -777,7 +777,7 @@ return NGX_ERROR; } - code->code = (ngx_stream_script_code_pt) (void *) + code->code = (ngx_stream_script_code_pt) (uintptr_t) ngx_stream_script_copy_var_len_code; code->index = (uintptr_t) index; @@ -867,7 +867,7 @@ return NGX_ERROR; } - code->code = (ngx_stream_script_code_pt) (void *) + code->code = (ngx_stream_script_code_pt) (uintptr_t) ngx_stream_script_copy_capture_len_code; code->n = 2 * n; @@ -959,7 +959,7 @@ return NGX_ERROR; } - code->code = (ngx_stream_script_code_pt) (void *) + code->code = (ngx_stream_script_code_pt) (uintptr_t) ngx_stream_script_full_name_len_code; code->conf_prefix = sc->conf_prefix;