ruby-changes:14607
From: wyhaines <ko1@a...>
Date: Wed, 27 Jan 2010 23:59:29 +0900 (JST)
Subject: [ruby-changes:14607] Ruby:r26452 (ruby_1_8_6): Backport #1875 ; (RMATCH_REGS): added for compatibility.
wyhaines 2010-01-27 23:58:36 +0900 (Wed, 27 Jan 2010) New Revision: 26452 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26452 Log: Backport #1875 [ruby-core:24735]; (RMATCH_REGS): added for compatibility. (RFLOAT_VALUE, RSTRING_END, RREGEXP_SRC_*, RBIGNUM_*): backported macros for compatiblity from trunk. Modified files: branches/ruby_1_8_6/ChangeLog branches/ruby_1_8_6/re.h branches/ruby_1_8_6/ruby.h Index: ruby_1_8_6/ChangeLog =================================================================== --- ruby_1_8_6/ChangeLog (revision 26451) +++ ruby_1_8_6/ChangeLog (revision 26452) @@ -1,7 +1,10 @@ Wed Jan 27 22:16:00 2010 Kirk Haines <khaines@r...> - * io.c: Backport #1818 [ruby-core:24561]; (argf_eof): go to the next file if called after ARGF.close or ARGF.skip. + * re.h: Backport #1875 [ruby-core:24735]; (RMATCH_REGS): added for compatibility. + ruby.h: (RFLOAT_VALUE, RSTRING_END, RREGEXP_SRC_*, RBIGNUM_*): backported macros for compatiblity from trunk. + * io.c: Backport #1818 [ruby-core:24561]; (argf_eof): go to the next file if called after ARGF.close or ARGF.skip. r26451 + * lib/rexml/text.rb: Backport #1806 [ruby-core:24506]; (REXML::Text.normalize): call to_s for input. r26442 Tue Jan 26 3:03:00 2010 Kirk Haines <khaines@r...> Index: ruby_1_8_6/re.h =================================================================== --- ruby_1_8_6/re.h (revision 26451) +++ ruby_1_8_6/re.h (revision 26452) @@ -27,6 +27,7 @@ }; #define RMATCH(obj) (R_CAST(RMatch)(obj)) +#define RMATCH_REGS(obj) (R_CAST(RMatch)(obj)->regs VALUE rb_reg_regcomp _((VALUE)); long rb_reg_search _((VALUE, VALUE, long, long)); Index: ruby_1_8_6/ruby.h =================================================================== --- ruby_1_8_6/ruby.h (revision 26451) +++ ruby_1_8_6/ruby.h (revision 26452) @@ -335,6 +335,8 @@ double value; }; +#define RFLOAT_VALUE(v) (RFLOAT(v)->value) + #define ELTS_SHARED FL_USER2 struct RString { @@ -348,6 +350,7 @@ }; #define RSTRING_PTR(s) (RSTRING(s)->ptr) #define RSTRING_LEN(s) (RSTRING(s)->len) +#define RSTRING_END(s) (RSTRING_PTR(s)+RSTRING_LEN(s)) struct RArray { struct RBasic basic; @@ -367,6 +370,8 @@ long len; char *str; }; +#define RREGEXP_SRC_PTR(r) (RREGEXP(r)->src) +#define RREGEXP_SRC_LEN(r) (RREGEXP(r)->len) struct RHash { struct RBasic basic; @@ -424,7 +429,14 @@ long len; void *digits; }; +#define RBIGNUM_SIGN(b) (RBIGNUM(b)->sign) +#define RBIGNUM_SET_SIGN(b,s) (RBIGNUM(b)->sign = (s)) +#define RBIGNUM_POSITIVE_P(b) RBIGNUM_SIGN(b) +#define RBIGNUM_NEGATIVE_P(b) (!RBIGNUM_SIGN(b)) +#define RBIGNUM_LEN(b) (RBIGNUM(b)->len) +#define RBIGNUM_DIGITS(b) (RBIGNUM(b)->digits) + #define R_CAST(st) (struct st*) #define RBASIC(obj) (R_CAST(RBasic)(obj)) #define ROBJECT(obj) (R_CAST(RObject)(obj)) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/