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

ruby-changes:40346

From: normal <ko1@a...>
Date: Tue, 3 Nov 2015 06:51:10 +0900 (JST)
Subject: [ruby-changes:40346] normal:r52427 (trunk): variable.c: remove casts for rb_class_ivar_set callers

normal	2015-11-03 06:50:24 +0900 (Tue, 03 Nov 2015)

  New Revision: 52427

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

  Log:
    variable.c: remove casts for rb_class_ivar_set callers
    
    Casting any arguments of rb_class_ivar_set to st_data_t is wrong
    as the function does not take any st_data_t parameters anymore.
    There's no functional change, as ID, VALUE, and st_data_t are
    all the same type, but this reduces confusion and improves
    maintainability for future type changes.
    
    * variable.c (find_class_path): remove cast for rb_class_ivar_set
      (rb_ivar_set): ditto
      (rb_cvar_set): ditto

  Modified files:
    trunk/ChangeLog
    trunk/variable.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52426)
+++ ChangeLog	(revision 52427)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Nov  3 06:48:58 2015  Eric Wong  <e@8...>
+
+	* variable.c (find_class_path): remove cast for rb_class_ivar_set
+	  (rb_ivar_set): ditto
+	  (rb_cvar_set): ditto
+
 Tue Nov  3 06:18:21 2015  Eric Wong  <e@8...>
 
 	* variable.c (rb_global_tbl): convert to id_table
Index: variable.c
===================================================================
--- variable.c	(revision 52426)
+++ variable.c	(revision 52427)
@@ -159,7 +159,7 @@ find_class_path(VALUE klass, ID preferre https://github.com/ruby/ruby/blob/trunk/variable.c#L159
 	if (!RCLASS_IV_TBL(klass)) {
 	    RCLASS_IV_TBL(klass) = st_init_numtable();
 	}
-	rb_class_ivar_set(klass, (st_data_t)classpath, arg.path);
+	rb_class_ivar_set(klass, classpath, arg.path);
 
 	st_delete(RCLASS_IV_TBL(klass), &tmp, 0);
 	return arg.path;
@@ -1412,7 +1412,7 @@ rb_ivar_set(VALUE obj, ID id, VALUE val) https://github.com/ruby/ruby/blob/trunk/variable.c#L1412
       case T_CLASS:
       case T_MODULE:
 	if (!RCLASS_IV_TBL(obj)) RCLASS_IV_TBL(obj) = st_init_numtable();
-	rb_class_ivar_set(obj, (st_data_t)id, val);
+	rb_class_ivar_set(obj, id, val);
         break;
       default:
 	generic_ivar_set(obj, id, val);
@@ -2802,7 +2802,7 @@ rb_cvar_set(VALUE klass, ID id, VALUE va https://github.com/ruby/ruby/blob/trunk/variable.c#L2802
 	RCLASS_IV_TBL(target) = st_init_numtable();
     }
 
-    rb_class_ivar_set(target, (st_data_t)id, (st_data_t)val);
+    rb_class_ivar_set(target, id, val);
 }
 
 VALUE

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

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