ruby-changes:50565
From: kazu <ko1@a...>
Date: Sat, 10 Mar 2018 09:34:29 +0900 (JST)
Subject: [ruby-changes:50565] kazu:r62709 (trunk): Fix warning: cast from pointer to integer of different size
kazu 2018-03-10 09:34:24 +0900 (Sat, 10 Mar 2018) New Revision: 62709 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62709 Log: Fix warning: cast from pointer to integer of different size ``` .../ruby/iseq.c: In function ?\226?\128?\152rb_vm_insn_null_translator?\226?\128?\153: .../ruby/iseq.c:137:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] return (int)addr; ^ ``` Modified files: trunk/iseq.c Index: iseq.c =================================================================== --- iseq.c (revision 62708) +++ iseq.c (revision 62709) @@ -116,10 +116,10 @@ rb_iseq_free(const rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/iseq.c#L116 } #if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE -static int +static VALUE rb_vm_insn_addr2insn2(const void *addr) { - int insn; + VALUE insn; const void * const *table = rb_vm_get_insns_address_table(); for (insn = 0; insn < VM_INSTRUCTION_SIZE; insn++) { @@ -131,14 +131,14 @@ rb_vm_insn_addr2insn2(const void *addr) https://github.com/ruby/ruby/blob/trunk/iseq.c#L131 } #endif -static int +static VALUE rb_vm_insn_null_translator(const void *addr) { - return (int)addr; + return (VALUE)addr; } typedef void iseq_value_itr_t(void *ctx, VALUE obj); -typedef int rb_vm_insns_translator_t(const void *addr); +typedef VALUE rb_vm_insns_translator_t(const void *addr); static int iseq_extract_values(const VALUE *code, size_t pos, iseq_value_itr_t * func, void *data, rb_vm_insns_translator_t * translator) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/