From a1d3384ce54726799be050f4dae5d947536ab2cb Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 12 May 2017 09:00:07 +0900 Subject: DONTMERGE compat/regex: make it compile with -Werror=int-to-pointer-cast The change by 56a1a3ab ("Silence GCC's "cast of pointer to integer of a different size" warning", 2015-10-26) may need resurrecting; I do not think an unprotected #include is the best way to do this, but for the purpose of places that needs further work, thishsould do. Signed-off-by: Junio C Hamano --- compat/regex/regcomp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compat/regex/regcomp.c b/compat/regex/regcomp.c index 5e9ea26cd4..5688a639bf 100644 --- a/compat/regex/regcomp.c +++ b/compat/regex/regcomp.c @@ -24,9 +24,7 @@ License along with the GNU C Library; if not, see . */ -#ifdef HAVE_STDINT_H #include -#endif #ifdef HAVE_STRINGS_H #include @@ -2641,7 +2639,7 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa, old_tree = NULL; if (elem->token.type == SUBEXP) - postorder (elem, mark_opt_subexp, (void *) (long) elem->token.opr.idx); + postorder (elem, mark_opt_subexp, (void *) (intptr_t) elem->token.opr.idx); tree = create_tree (dfa, elem, NULL, (end == -1 ? OP_DUP_ASTERISK : OP_ALT)); if (BE (tree == NULL, 0)) @@ -3868,7 +3866,7 @@ create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right, static reg_errcode_t mark_opt_subexp (void *extra, bin_tree_t *node) { - int idx = (int) (long) extra; + int idx = (int) (intptr_t) extra; if (node->token.type == SUBEXP && node->token.opr.idx == idx) node->token.opt_subexp = 1; -- cgit v1.2.1