[前][次][番号順一覧][スレッド一覧]

ruby-changes:12490

From: nobu <ko1@a...>
Date: Sat, 18 Jul 2009 12:06:19 +0900 (JST)
Subject: [ruby-changes:12490] Ruby:r24192 (ruby_1_8): * ruby.h (RFLOAT_VALUE, RSTRING_END, RREGEXP_SRC_*, RBIGNUM_*):

nobu	2009-07-18 12:06:02 +0900 (Sat, 18 Jul 2009)

  New Revision: 24192

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24192

  Log:
    * ruby.h (RFLOAT_VALUE, RSTRING_END, RREGEXP_SRC_*, RBIGNUM_*):
      backported macros for compatiblity from trunk.

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/ruby.h

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 24191)
+++ ruby_1_8/ChangeLog	(revision 24192)
@@ -1,5 +1,8 @@
-Sat Jul 18 11:15:23 2009  Nobuyoshi Nakada  <nobu@r...>
+Sat Jul 18 12:05:45 2009  Nobuyoshi Nakada  <nobu@r...>
 
+	* ruby.h (RFLOAT_VALUE, RSTRING_END, RREGEXP_SRC_*, RBIGNUM_*):
+	  backported macros for compatiblity from trunk.
+
 	* re.h (RMATCH_REGS): added for compatibility.
 
 Sat Jul 18 07:56:00 2009  Hidetoshi NAGAI  <nagai@a...>
Index: ruby_1_8/ruby.h
===================================================================
--- ruby_1_8/ruby.h	(revision 24191)
+++ ruby_1_8/ruby.h	(revision 24192)
@@ -342,6 +342,7 @@
     struct RBasic basic;
     double value;
 };
+#define RFLOAT_VALUE(v) (RFLOAT(v)->value)
 
 #define ELTS_SHARED FL_USER2
 
@@ -356,6 +357,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;
@@ -375,6 +377,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;
@@ -437,6 +441,12 @@
     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))

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]