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

ruby-changes:41813

From: nobu <ko1@a...>
Date: Mon, 22 Feb 2016 16:15:23 +0900 (JST)
Subject: [ruby-changes:41813] nobu:r53887 (trunk): internal.h: shortcut macros

nobu	2016-02-22 16:15:56 +0900 (Mon, 22 Feb 2016)

  New Revision: 53887

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53887

  Log:
    internal.h: shortcut macros
    
    * internal.h (RRATIONAL_SET_{NUM,DEN}): shortcut macros for
      internal only.

  Modified files:
    trunk/internal.h
Index: internal.h
===================================================================
--- internal.h	(revision 53886)
+++ internal.h	(revision 53887)
@@ -390,6 +390,8 @@ struct RRational { https://github.com/ruby/ruby/blob/trunk/internal.h#L390
 };
 
 #define RRATIONAL(obj) (R_CAST(RRational)(obj))
+#define RRATIONAL_SET_NUM(rat, n) RB_OBJ_WRITE((rat), &((struct RRational *)(rat))->num,(n))
+#define RRATIONAL_SET_DEN(rat, d) RB_OBJ_WRITE((rat), &((struct RRational *)(rat))->den,(d))
 
 struct RFloat {
     struct RBasic basic;

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

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