summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-11-05 12:18:13 -0800
committerJunio C Hamano <gitster@pobox.com>2015-11-05 12:18:13 -0800
commitace5348dcb427bbce015a42a21a46dc02ae1b37b (patch)
treefed189ce949052d5c6b52c888f5437d3bccccc9f /compat
parenta878e7e62b4826a95effa1420cff47807f9cb88b (diff)
parentfdcdb778551b904d57c127d9a3546f6a7c8792d3 (diff)
downloadgit-ace5348dcb427bbce015a42a21a46dc02ae1b37b.tar.gz
Merge branch 'js/misc-fixes' into maint
Various compilation fixes and squelching of warnings. * js/misc-fixes: Correct fscanf formatting string for I64u values Silence GCC's "cast of pointer to integer of a different size" warning Squelch warning about an integer overflow
Diffstat (limited to 'compat')
-rw-r--r--compat/regex/regcomp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/compat/regex/regcomp.c b/compat/regex/regcomp.c
index 06f3088708..fba5986399 100644
--- a/compat/regex/regcomp.c
+++ b/compat/regex/regcomp.c
@@ -18,6 +18,8 @@
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA. */
+#include <stdint.h>
+
static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,
size_t length, reg_syntax_t syntax);
static void re_compile_fastmap_iter (regex_t *bufp,
@@ -2577,7 +2579,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))
@@ -3806,7 +3808,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;