From 288f6e1b898681a0f4385ed9fd2c73f405e968d9 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 26 Jul 2015 06:24:18 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_insnhelper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm_insnhelper.c b/vm_insnhelper.c index c2256471bd..d0ab1f34c5 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -765,7 +765,7 @@ vm_setivar(VALUE obj, ID id, VALUE val, IC ic, rb_call_info_t *ci, int is_attr) 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);