diff --git a/ractor.c b/ractor.c index 0c17d575ee..96c51eca70 100644 --- a/ractor.c +++ b/ractor.c @@ -2706,7 +2706,7 @@ obj_refer_only_shareables_p(VALUE obj) static int obj_traverse_replace_i(VALUE obj, struct obj_traverse_replace_data *data) { - VALUE replacement; + st_data_t replacement; if (RB_SPECIAL_CONST_P(obj)) { data->replacement = obj; @@ -2719,14 +2719,14 @@ obj_traverse_replace_i(VALUE obj, struct obj_traverse_replace_data *data) case traverse_stop: return 1; // stop search } - replacement = data->replacement; + replacement = (st_data_t)data->replacement; - if (UNLIKELY(st_lookup(obj_traverse_replace_rec(data), (st_data_t)obj, (st_data_t *)&replacement))) { - data->replacement = replacement; + if (UNLIKELY(st_lookup(obj_traverse_replace_rec(data), (st_data_t)obj, &replacement))) { + data->replacement = (VALUE)replacement; return 0; } else { - st_insert(obj_traverse_replace_rec(data), (st_data_t)obj, (st_data_t)replacement); + st_insert(obj_traverse_replace_rec(data), (st_data_t)obj, replacement); } if (!data->move) { @@ -2872,7 +2872,7 @@ obj_traverse_replace_i(VALUE obj, struct obj_traverse_replace_data *data) rb_bug("unreachable"); } - data->replacement = replacement; + data->replacement = (VALUE)replacement; if (data->leave_func(obj, data) == traverse_stop) { return 1; @@ -3052,9 +3052,9 @@ ractor_local_storage_mark(rb_ractor_t *r) for (int i=0; ilocal_storage, (st_data_t *)&key, &val) && - key->type->free) { + st_data_t val, k = (st_data_t)key; + if (st_delete(r->local_storage, &k, &val) && + (key = (rb_ractor_local_key_t)k)->type->free) { (*key->type->free)((void *)val); } } @@ -3179,9 +3179,9 @@ ractor_local_set(rb_ractor_local_key_t key, void *ptr) VALUE rb_ractor_local_storage_value(rb_ractor_local_key_t key) { - VALUE val; - if (ractor_local_ref(key, (void **)&val)) { - return val; + void *val; + if (ractor_local_ref(key, &val)) { + return (VALUE)val; } else { return Qnil; diff --git a/vm_method.c b/vm_method.c index 36a2c15e4b..c4b95f9391 100644 --- a/vm_method.c +++ b/vm_method.c @@ -1021,8 +1021,9 @@ rb_vm_lookup_overloaded_cme(const rb_callable_method_entry_t *cme) static void delete_overloaded_cme(const rb_callable_method_entry_t *cme) { + st_data_t cme_data = (st_data_t)cme; ASSERT_vm_locking(); - st_delete(overloaded_cme_table(), (st_data_t *)&cme, NULL); + st_delete(overloaded_cme_table(), &cme_data, NULL); } static const rb_callable_method_entry_t * diff --git a/win32/win32.c b/win32/win32.c index c202e65e92..7f879b397f 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -855,7 +855,7 @@ socklist_lookup(SOCKET sock, int *flagp) thread_exclusive(socklist) { if (!socklist) continue; - ret = st_lookup(socklist, (st_data_t)sock, (st_data_t *)&data); + ret = st_lookup(socklist, (st_data_t)sock, &data); if (ret && flagp) *flagp = (int)data; } diff --git a/yjit_codegen.c b/yjit_codegen.c index aef5c0790d..cd46685b57 100644 --- a/yjit_codegen.c +++ b/yjit_codegen.c @@ -3212,9 +3212,9 @@ jit_thread_s_current(jitstate_t *jit, ctx_t *ctx, const struct rb_callinfo *ci, static method_codegen_t lookup_cfunc_codegen(const rb_method_definition_t *def) { - method_codegen_t gen_fn; - if (st_lookup(yjit_method_codegen_table, def->method_serial, (st_data_t *)&gen_fn)) { - return gen_fn; + st_data_t gen_fn; + if (st_lookup(yjit_method_codegen_table, def->method_serial, &gen_fn)) { + return (method_codegen_t)gen_fn; } return NULL; }