From dc21e636eb63d0fb688d7e068c4b82ccb64cd9af Mon Sep 17 00:00:00 2001 From: knu Date: Wed, 3 Dec 2008 07:39:37 +0000 Subject: [PATCH] * regex.c (re_compile_pattern): Use %ld for pointer differences. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ regex.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e49248967..1a9f6f8e60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Dec 3 16:38:11 2008 Akinori MUSHA + + * regex.c (re_compile_pattern): Use %ld for pointer differences. + Wed Dec 3 16:25:55 2008 Akinori MUSHA * pack.c (rb_utf8_to_uv), intern.h: Rename utf8_to_uv to diff --git a/regex.c b/regex.c index 06f982e7c7..968c5efca2 100644 --- a/regex.c +++ b/regex.c @@ -1364,8 +1364,8 @@ re_compile_pattern(pattern, size, bufp) /* If there is no previous pattern, char not special. */ if (!laststart) { snprintf(error_msg, ERROR_MSG_MAX_SIZE, - "invalid regular expression; there's no previous pattern, to which '%c' would define cardinality at %d", - c, p-pattern); + "invalid regular expression; there's no previous pattern, to which '%c' would define cardinality at %ld", + c, (long)(p-pattern)); FREE_AND_RETURN(stackb, error_msg); } /* If there is a sequence of repetition chars, @@ -2028,8 +2028,8 @@ re_compile_pattern(pattern, size, bufp) /* If there is no previous pattern, this is an invalid pattern. */ if (!laststart) { snprintf(error_msg, ERROR_MSG_MAX_SIZE, - "invalid regular expression; there's no previous pattern, to which '{' would define cardinality at %d", - p-pattern); + "invalid regular expression; there's no previous pattern, to which '{' would define cardinality at %ld", + (long)(p-pattern)); FREE_AND_RETURN(stackb, error_msg); } if( p == pend)