Skip to content

Commit 9e91469

Browse files
committed
code: avoid casting former enums to int * in cfg.c and dir.c
Signed-off-by: Hans Zandbelt <[email protected]>
1 parent 1ef3fd4 commit 9e91469

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/cfg/cfg.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ const char *oidc_cmd_trace_parent_set(cmd_parms *cmd, void *struct_ptr, const ch
375375
{OIDC_TRACE_PARENT_PROPAGATE, OIDC_TRACE_PARENT_PROPAGATE_STR},
376376
{OIDC_TRACE_PARENT_GENERATE, OIDC_TRACE_PARENT_GENERATE_STR}};
377377
const char *rv =
378-
oidc_cfg_parse_option(cmd->pool, options, OIDC_CFG_OPTIONS_SIZE(options), arg, (int *)&cfg->trace_parent);
378+
oidc_cfg_parse_option(cmd->pool, options, OIDC_CFG_OPTIONS_SIZE(options), arg, &cfg->trace_parent);
379379
return OIDC_CONFIG_DIR_RV(cmd, rv);
380380
}
381381

@@ -481,8 +481,8 @@ const char *oidc_cmd_state_input_headers_set(cmd_parms *cmd, void *m, const char
481481
{OIDC_STATE_INPUT_HEADERS_X_FORWARDED_FOR, OIDC_STATE_INPUT_HEADERS_AS_X_FORWARDED_FOR},
482482
{OIDC_STATE_INPUT_HEADERS_USER_AGENT | OIDC_STATE_INPUT_HEADERS_X_FORWARDED_FOR,
483483
OIDC_STATE_INPUT_HEADERS_AS_BOTH}};
484-
const char *rv = oidc_cfg_parse_option(cmd->pool, options, OIDC_CFG_OPTIONS_SIZE(options), arg,
485-
(int *)&cfg->state_input_headers);
484+
const char *rv =
485+
oidc_cfg_parse_option(cmd->pool, options, OIDC_CFG_OPTIONS_SIZE(options), arg, &cfg->state_input_headers);
486486
return OIDC_CONFIG_DIR_RV(cmd, rv);
487487
}
488488

@@ -541,7 +541,7 @@ const char *oidc_cmd_cookie_same_site_set(cmd_parms *cmd, void *m, const char *a
541541
{OIDC_SAMESITE_COOKIE_LAX, OIDC_SAMESITE_COOKIE_LAX_STR},
542542
{OIDC_SAMESITE_COOKIE_STRICT, OIDC_SAMESITE_COOKIE_STRICT_STR}};
543543
const char *rv = oidc_cfg_parse_option_ignore_case(cmd->pool, options, OIDC_CFG_OPTIONS_SIZE(options), arg,
544-
(int *)&cfg->cookie_same_site);
544+
&cfg->cookie_same_site);
545545
return OIDC_CONFIG_DIR_RV(cmd, rv);
546546
}
547547

src/cfg/dir.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ const char *oidc_cmd_dir_pass_claims_as_set(cmd_parms *cmd, void *m, const char
306306
{OIDC_APPINFO_PASS_BOTH, OIDC_APPINFO_PASS_BOTH_STR}};
307307

308308
rv = oidc_cfg_parse_option(cmd->pool, pass_options, OIDC_CFG_OPTIONS_SIZE(pass_options), arg1,
309-
(int *)&dir_cfg->pass_info_in);
309+
&dir_cfg->pass_info_in);
310310

311311
static const oidc_cfg_option_t encoding_options[] = {
312312
{OIDC_APPINFO_ENCODING_NONE, OIDC_APPINFO_ENCODING_NONE_STR},
@@ -315,7 +315,7 @@ const char *oidc_cmd_dir_pass_claims_as_set(cmd_parms *cmd, void *m, const char
315315

316316
if ((rv == NULL) && (arg2 != NULL))
317317
rv = oidc_cfg_parse_option(cmd->pool, encoding_options, OIDC_CFG_OPTIONS_SIZE(encoding_options), arg2,
318-
(int *)&dir_cfg->pass_info_encoding);
318+
&dir_cfg->pass_info_encoding);
319319

320320
return OIDC_CONFIG_DIR_RV(cmd, rv);
321321
}
@@ -348,7 +348,7 @@ const char *oidc_cmd_dir_unauth_action_set(cmd_parms *cmd, void *m, const char *
348348
oidc_dir_cfg_t *dir_cfg = (oidc_dir_cfg_t *)m;
349349
const char *rv =
350350
oidc_cfg_parse_option(cmd->pool, unauth_action_options, OIDC_CFG_OPTIONS_SIZE(unauth_action_options), arg1,
351-
(int *)&dir_cfg->unauth_action);
351+
&dir_cfg->unauth_action);
352352
if (rv == NULL)
353353
rv = oidc_util_apr_expr_parse(cmd, arg2, &dir_cfg->unauth_expression, FALSE);
354354
return OIDC_CONFIG_DIR_RV(cmd, rv);
@@ -368,8 +368,8 @@ const char *oidc_cmd_dir_unautz_action_set(cmd_parms *cmd, void *m, const char *
368368
{OIDC_UNAUTZ_RETURN401, OIDC_UNAUTZ_RETURN401_STR},
369369
{OIDC_UNAUTZ_AUTHENTICATE, OIDC_UNAUTZ_AUTHENTICATE_STR},
370370
{OIDC_UNAUTZ_RETURN302, OIDC_UNAUTZ_RETURN302_STR}};
371-
const char *rv = oidc_cfg_parse_option(cmd->pool, options, OIDC_CFG_OPTIONS_SIZE(options), arg1,
372-
(int *)&dir_cfg->unautz_action);
371+
const char *rv =
372+
oidc_cfg_parse_option(cmd->pool, options, OIDC_CFG_OPTIONS_SIZE(options), arg1, &dir_cfg->unautz_action);
373373
if ((rv == NULL) && (arg2 != NULL)) {
374374
dir_cfg->unauthz_arg = apr_pstrdup(cmd->pool, arg2);
375375
} else if (dir_cfg->unautz_action == OIDC_UNAUTZ_RETURN302) {

0 commit comments

Comments
 (0)