mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-array-ext: fix conversion warning in ary_init_temp_set
Cast mrb_int capacity to khint_t when calling kh_init_data to resolve C4244 warning about potential data loss in conversion from signed to unsigned type. The khash API expects khint_t (uint32_t) parameters. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -401,7 +401,7 @@ ary_rotate_bang(mrb_state *mrb, mrb_value self)
|
||||
static void
|
||||
ary_init_temp_set(mrb_state *mrb, ary_set_t *set, mrb_int capacity)
|
||||
{
|
||||
kh_init_data(ary_set, mrb, set, capacity > 0 ? capacity : 8);
|
||||
kh_init_data(ary_set, mrb, set, (khint_t)(capacity > 0 ? capacity : 8));
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user