ruby-changes:50564
From: kazu <ko1@a...>
Date: Sat, 10 Mar 2018 09:33:18 +0900 (JST)
Subject: [ruby-changes:50564] kazu:r62708 (trunk): Fix error: implicit conversion loses integer precision
kazu 2018-03-10 09:33:11 +0900 (Sat, 10 Mar 2018) New Revision: 62708 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62708 Log: Fix error: implicit conversion loses integer precision http://ci.rvm.jp/results/trunk_clang_50@silicon-docker/627906 ``` iseq.h:41:36: error: implicit conversion loses integer precision: 'rb_num_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32] int cnt = iseq->body->variable.flip_count; ~~~ ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ ``` Modified files: trunk/compile.c trunk/iseq.h trunk/vm_core.h Index: vm_core.h =================================================================== --- vm_core.h (revision 62707) +++ vm_core.h (revision 62708) @@ -412,7 +412,7 @@ struct rb_iseq_constant_body { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L412 struct rb_call_cache *cc_entries; /* size is ci_size = ci_kw_size */ struct { - rb_num_t flip_count; + rb_snum_t flip_count; VALUE coverage; VALUE original_iseq; } variable; Index: iseq.h =================================================================== --- iseq.h (revision 62707) +++ iseq.h (revision 62708) @@ -35,10 +35,10 @@ rb_call_info_kw_arg_bytes(int keyword_le https://github.com/ruby/ruby/blob/trunk/iseq.h#L35 #define ISEQ_FLIP_CNT(iseq) (iseq)->body->variable.flip_count -static inline int +static inline rb_snum_t ISEQ_FLIP_CNT_INCREMENT(const rb_iseq_t *iseq) { - int cnt = iseq->body->variable.flip_count; + rb_snum_t cnt = iseq->body->variable.flip_count; iseq->body->variable.flip_count += 1; return cnt; } Index: compile.c =================================================================== --- compile.c (revision 62707) +++ compile.c (revision 62708) @@ -8751,7 +8751,7 @@ ibf_load_iseq_each(const struct ibf_load https://github.com/ruby/ruby/blob/trunk/compile.c#L8751 ISEQ_COVERAGE_SET(iseq, Qnil); ISEQ_ORIGINAL_ISEQ_CLEAR(iseq); - iseq->body->variable.flip_count = (int)body->variable.flip_count; + iseq->body->variable.flip_count = body->variable.flip_count; { VALUE realpath = Qnil, path = ibf_load_object(load, body->location.pathobj); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/