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

ruby-changes:45077

From: naruse <ko1@a...>
Date: Thu, 22 Dec 2016 18:44:36 +0900 (JST)
Subject: [ruby-changes:45077] naruse:r57150 (trunk): suppress warning: implicit conversion changes signedness

naruse	2016-12-22 18:44:30 +0900 (Thu, 22 Dec 2016)

  New Revision: 57150

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

  Log:
    suppress warning: implicit conversion changes signedness
    
    It causes [Bug #13060]

  Modified files:
    trunk/include/ruby/ruby.h
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 57149)
+++ include/ruby/ruby.h	(revision 57150)
@@ -441,7 +441,7 @@ enum ruby_special_consts { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L441
 #endif
 #define SYMBOL_FLAG RUBY_SYMBOL_FLAG
 
-#define RB_TEST(v) !(((VALUE)(v) & ~RUBY_Qnil) == 0)
+#define RB_TEST(v) !(((VALUE)(v) & (VALUE)~RUBY_Qnil) == 0)
 #define RB_NIL_P(v) !((VALUE)(v) != RUBY_Qnil)
 #define RTEST(v) RB_TEST(v)
 #define NIL_P(v) RB_NIL_P(v)
@@ -1617,7 +1617,7 @@ rb_alloc_tmp_buffer2(volatile VALUE *sto https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1617
     }
     else {
 	size_t size, max = LONG_MAX - sizeof(VALUE) + 1;
-	if (RB_UNLIKELY(rb_mul_size_overflow(count, elsize, max, &size))) {
+	if (RB_UNLIKELY(rb_mul_size_overflow(cnt, elsize, max, &size))) {
 	    ruby_malloc_size_overflow(cnt, elsize);
 	}
 	cnt = (size + sizeof(VALUE) - 1) / sizeof(VALUE);

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

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