diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-05-12 09:00:07 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-12 09:00:12 +0900 |
commit | a1d3384ce54726799be050f4dae5d947536ab2cb (patch) | |
tree | 3b802b1f4b5c5a34ba1b8278c027f28fec92cf8c | |
parent | 169c59070589dbb31140d90655d1c919c0ae9d0b (diff) | |
download | git-ab/compat-regex-update.tar.gz |
DONTMERGE compat/regex: make it compile with -Werror=int-to-pointer-castab/compat-regex-update
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 <stdint.h> 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 <gitster@pobox.com>
-rw-r--r-- | compat/regex/regcomp.c | 6 |
1 files 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 <http://www.gnu.org/licenses/>. */ -#ifdef HAVE_STDINT_H #include <stdint.h> -#endif #ifdef HAVE_STRINGS_H #include <strings.h> @@ -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; |