aboutsummaryrefslogtreecommitdiffstats
path: root/vm_args.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-12-10 17:10:23 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-12-10 17:12:21 +0900
commit60c53ff6ee1eed054fc3d78ad6c06cbfc56900d6 (patch)
tree25071a3b67701302e097c9c0a998015dd2e19464 /vm_args.c
parente27d2013db18d124d1362b6cc81ecec806ef1a0d (diff)
downloadruby-60c53ff6ee1eed054fc3d78ad6c06cbfc56900d6.tar.gz
vm_core.h (iseq_unique_id): prefer uintptr_t instead of unsigned long
It produced a warning about type cast in LLP64 (i.e., windows).
Diffstat (limited to 'vm_args.c')
-rw-r--r--vm_args.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/vm_args.c b/vm_args.c
index c6c111865e..6c105f0ee0 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -597,38 +597,38 @@ static VALUE rb_warn_check(const rb_execution_context_t * const ec, const rb_ise
{
if (!iseq) return 0;
- const void *const callee = (void *)(iseq->body->iseq_unique_id * 2);
+ const st_data_t callee = (st_data_t)(iseq->body->iseq_unique_id * 2);
const rb_control_frame_t * const cfp = rb_vm_get_ruby_level_next_cfp(ec, ec->cfp);
if (!cfp) return 0;
- const void *const caller = cfp->pc;
+ const st_data_t caller = (st_data_t)cfp->pc;
if (!caller_to_callees) {
caller_to_callees = st_init_numtable();
}
st_data_t val;
- if (st_lookup(caller_to_callees, (st_data_t) caller, &val)) {
+ if (st_lookup(caller_to_callees, caller, &val)) {
st_table *callees;
if (val & 1) {
val &= ~(st_data_t)1;
- if (val == (st_data_t) callee) return 1; /* already warned */
+ if (val == callee) return 1; /* already warned */
callees = st_init_numtable();
st_insert(callees, val, 1);
}
else {
callees = (st_table *) val;
- if (st_is_member(callees, (st_data_t) callee)) return 1; /* already warned */
+ if (st_is_member(callees, callee)) return 1; /* already warned */
}
- st_insert(callees, (st_data_t) callee, 1);
- st_insert(caller_to_callees, (st_data_t) caller, (st_data_t) callees);
+ st_insert(callees, callee, 1);
+ st_insert(caller_to_callees, caller, (st_data_t) callees);
}
else {
- st_insert(caller_to_callees, (st_data_t) caller, ((st_data_t) callee) | 1);
+ st_insert(caller_to_callees, caller, callee | 1);
}
return 0; /* not warned yet for the pair of caller and callee */