Mercurial > hg > nginx
comparison src/http/ngx_http_script.c @ 7271:9e25a5380a21
Silenced -Wcast-function-type warnings (closes #1546).
Cast to intermediate "void *" to lose compiler knowledge about the original
type and pass the warning. This is not a real fix but rather a workaround.
Found by gcc8.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 07 May 2018 09:54:37 +0000 |
parents | 3fb9b5eb75c0 |
children | 5efc23d83bc2 |
comparison
equal
deleted
inserted
replaced
7270:46c0c7ef4913 | 7271:9e25a5380a21 |
---|---|
693 sizeof(ngx_http_script_copy_code_t), NULL); | 693 sizeof(ngx_http_script_copy_code_t), NULL); |
694 if (code == NULL) { | 694 if (code == NULL) { |
695 return NGX_ERROR; | 695 return NGX_ERROR; |
696 } | 696 } |
697 | 697 |
698 code->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code; | 698 code->code = (ngx_http_script_code_pt) (void *) |
699 ngx_http_script_copy_len_code; | |
699 code->len = len; | 700 code->len = len; |
700 | 701 |
701 size = (sizeof(ngx_http_script_copy_code_t) + len + sizeof(uintptr_t) - 1) | 702 size = (sizeof(ngx_http_script_copy_code_t) + len + sizeof(uintptr_t) - 1) |
702 & ~(sizeof(uintptr_t) - 1); | 703 & ~(sizeof(uintptr_t) - 1); |
703 | 704 |
782 sizeof(ngx_http_script_var_code_t), NULL); | 783 sizeof(ngx_http_script_var_code_t), NULL); |
783 if (code == NULL) { | 784 if (code == NULL) { |
784 return NGX_ERROR; | 785 return NGX_ERROR; |
785 } | 786 } |
786 | 787 |
787 code->code = (ngx_http_script_code_pt) ngx_http_script_copy_var_len_code; | 788 code->code = (ngx_http_script_code_pt) (void *) |
789 ngx_http_script_copy_var_len_code; | |
788 code->index = (uintptr_t) index; | 790 code->index = (uintptr_t) index; |
789 | 791 |
790 code = ngx_http_script_add_code(*sc->values, | 792 code = ngx_http_script_add_code(*sc->values, |
791 sizeof(ngx_http_script_var_code_t), | 793 sizeof(ngx_http_script_var_code_t), |
792 &sc->main); | 794 &sc->main); |
1176 NULL); | 1178 NULL); |
1177 if (code == NULL) { | 1179 if (code == NULL) { |
1178 return NGX_ERROR; | 1180 return NGX_ERROR; |
1179 } | 1181 } |
1180 | 1182 |
1181 code->code = (ngx_http_script_code_pt) | 1183 code->code = (ngx_http_script_code_pt) (void *) |
1182 ngx_http_script_copy_capture_len_code; | 1184 ngx_http_script_copy_capture_len_code; |
1183 code->n = 2 * n; | 1185 code->n = 2 * n; |
1184 | 1186 |
1185 | 1187 |
1186 code = ngx_http_script_add_code(*sc->values, | 1188 code = ngx_http_script_add_code(*sc->values, |
1187 sizeof(ngx_http_script_copy_capture_code_t), | 1189 sizeof(ngx_http_script_copy_capture_code_t), |
1291 NULL); | 1293 NULL); |
1292 if (code == NULL) { | 1294 if (code == NULL) { |
1293 return NGX_ERROR; | 1295 return NGX_ERROR; |
1294 } | 1296 } |
1295 | 1297 |
1296 code->code = (ngx_http_script_code_pt) ngx_http_script_full_name_len_code; | 1298 code->code = (ngx_http_script_code_pt) (void *) |
1299 ngx_http_script_full_name_len_code; | |
1297 code->conf_prefix = sc->conf_prefix; | 1300 code->conf_prefix = sc->conf_prefix; |
1298 | 1301 |
1299 code = ngx_http_script_add_code(*sc->values, | 1302 code = ngx_http_script_add_code(*sc->values, |
1300 sizeof(ngx_http_script_full_name_code_t), | 1303 sizeof(ngx_http_script_full_name_code_t), |
1301 &sc->main); | 1304 &sc->main); |