summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-02 04:39:44 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-02 04:39:44 +0000
commit21daa56b2aa2d4afc6e61b0e6b0f4dd78df620ca (patch)
tree44af7c3cce6e6197bf7a15fd3c8ab323fb8a343a /ext
parent737332061566781684501216991e5a20edcca03b (diff)
* re.c: Introduce RREGEXP_PTR.
patch by dbussink. partially merge https://github.com/ruby/ruby/pull/497 * include/ruby/ruby.h: ditto. * gc.c: ditto. * ext/strscan/strscan.c: ditto. * parse.y: ditto. * string.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/strscan/strscan.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index f7592c9..e75bf66 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -460,7 +460,7 @@ strscan_do_scan(VALUE self, VALUE regex, int succptr, int getstr, int headonly)
p->regex = regex;
re = rb_reg_prepare_re(regex, p->str);
- tmpreg = re != RREGEXP(regex)->ptr;
+ tmpreg = re != RREGEXP_PTR(regex);
if (!tmpreg) RREGEXP(regex)->usecnt++;
if (headonly) {
@@ -480,8 +480,8 @@ strscan_do_scan(VALUE self, VALUE regex, int succptr, int getstr, int headonly)
onig_free(re);
}
else {
- onig_free(RREGEXP(regex)->ptr);
- RREGEXP(regex)->ptr = re;
+ onig_free(RREGEXP_PTR(regex));
+ RREGEXP_PTR(regex) = re;
}
}
@@ -978,7 +978,7 @@ name_to_backref_number(struct re_registers *regs, VALUE regexp, const char* name
{
int num;
- num = onig_name_to_backref_number(RREGEXP(regexp)->ptr,
+ num = onig_name_to_backref_number(RREGEXP_PTR(regexp),
(const unsigned char* )name, (const unsigned char* )name_end, regs);
if (num >= 1) {
return num;