Skip to content

Commit fbc32b4

Browse files
committed
bugfix: warning fixes when using the Microsoft Visual C++ compiler. thanks Edwin Cleton for the report.
1 parent a007ebc commit fbc32b4

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/ngx_http_array_var_module.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static ngx_command_t ngx_http_array_var_commands[] = {
7676
ngx_http_array_map_op,
7777
0,
7878
0,
79-
ngx_http_array_var_map_op
79+
(void *) ngx_http_array_var_map_op
8080
},
8181
{
8282
ngx_string("array_join"),
@@ -85,7 +85,7 @@ static ngx_command_t ngx_http_array_var_commands[] = {
8585
ngx_http_array_join,
8686
0,
8787
0,
88-
ngx_http_array_var_join
88+
(void *) ngx_http_array_var_join
8989
},
9090

9191
ngx_null_command
@@ -138,7 +138,7 @@ ngx_http_array_split(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
138138
}
139139

140140
filter.type = NDK_SET_VAR_MULTI_VALUE_DATA;
141-
filter.func = ngx_http_array_var_split;
141+
filter.func = (void *) ngx_http_array_var_split;
142142
filter.data = data;
143143

144144
value = cf->args->elts;
@@ -255,7 +255,7 @@ ngx_http_array_map(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
255255
}
256256

257257
filter.type = NDK_SET_VAR_VALUE_DATA;
258-
filter.func = ngx_http_array_var_map;
258+
filter.func = (void *) ngx_http_array_var_map;
259259
filter.data = data;
260260
filter.size = 1;
261261

@@ -309,7 +309,7 @@ ngx_http_array_map_op(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
309309
}
310310

311311
filter.type = NDK_SET_VAR_MULTI_VALUE_DATA;
312-
filter.func = (ndk_set_var_value_pt) cmd->post;
312+
filter.func = cmd->post;
313313
filter.data = data;
314314

315315
value = cf->args->elts;
@@ -368,7 +368,7 @@ ngx_http_array_join(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
368368
ngx_str_t *bad_arg;
369369

370370
filter.type = NDK_SET_VAR_MULTI_VALUE;
371-
filter.func = (ndk_set_var_value_pt) cmd->post;
371+
filter.func = cmd->post;
372372

373373
value = cf->args->elts;
374374

@@ -476,9 +476,13 @@ ngx_http_array_var_split(ngx_http_request_t *r,
476476
goto done;
477477
}
478478

479-
while (i != max - 1 && (last = ngx_http_array_var_strlstrn(pos, end,
480-
sep->data, sep->len - 1)))
481-
{
479+
while (i != max - 1) {
480+
last = ngx_http_array_var_strlstrn(pos, end, sep->data,
481+
sep->len - 1);
482+
if (last == NULL) {
483+
break;
484+
}
485+
482486
s = ngx_array_push(array);
483487
if (s == NULL) {
484488
return NGX_ERROR;

src/ngx_http_array_var_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ ngx_http_array_var_get_func_from_cmd(u_char *name,
7070
continue;
7171
}
7272

73-
return filter->func;
73+
return (ndk_set_var_value_pt) filter->func;
7474
}
7575
}
7676

0 commit comments

Comments
 (0)