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

ruby-changes:39310

From: nobu <ko1@a...>
Date: Sun, 26 Jul 2015 15:24:35 +0900 (JST)
Subject: [ruby-changes:39310] nobu:r51391 (trunk): vm_insnhelper.c: suppress a warning

nobu	2015-07-26 15:24:18 +0900 (Sun, 26 Jul 2015)

  New Revision: 51391

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

  Log:
    vm_insnhelper.c: suppress a warning
    
    * vm_insnhelper.c (vm_setivar): cast to long both side of a
      conditional expression to suppress a sign-compare warning.

  Modified files:
    trunk/vm_insnhelper.c
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 51390)
+++ vm_insnhelper.c	(revision 51391)
@@ -765,7 +765,7 @@ vm_setivar(VALUE obj, ID id, VALUE val, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L765
 	if (LIKELY(
 	    (!is_attr && ic->ic_serial == RCLASS_SERIAL(klass)) ||
 	    (is_attr && ci->aux.index > 0))) {
-	    long index = !is_attr ? (long)ic->ic_value.index : ci->aux.index-1;
+	    long index = !is_attr ? (long)ic->ic_value.index : (long)ci->aux.index-1;
 	    long len = ROBJECT_NUMIV(obj);
 	    VALUE *ptr = ROBJECT_IVPTR(obj);
 

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

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