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

ruby-changes:42359

From: nobu <ko1@a...>
Date: Wed, 30 Mar 2016 10:27:08 +0900 (JST)
Subject: [ruby-changes:42359] nobu:r54433 (trunk): rational.c: pure declarations

nobu	2016-03-30 10:27:03 +0900 (Wed, 30 Mar 2016)

  New Revision: 54433

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

  Log:
    rational.c: pure declarations
    
    * rational.c (get_dat1, get_dat2): turn into pure variable
      declarations only, not mixed code and declarations.

  Modified files:
    trunk/rational.c
Index: rational.c
===================================================================
--- rational.c	(revision 54432)
+++ rational.c	(revision 54433)
@@ -395,13 +395,10 @@ f_lcm(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/rational.c#L395
 }
 
 #define get_dat1(x) \
-    struct RRational *dat;\
-    dat = ((struct RRational *)(x))
+    struct RRational *dat = RRATIONAL(x)
 
 #define get_dat2(x,y) \
-    struct RRational *adat, *bdat;\
-    adat = ((struct RRational *)(x));\
-    bdat = ((struct RRational *)(y))
+    struct RRational *adat = RRATIONAL(x), *bdat = RRATIONAL(y)
 
 #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))

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

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