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:
Yukihiro "Matz" Matsumoto
2025-08-22 21:34:57 +09:00
parent 5f9808587b
commit cc71d93714
+1 -1
View File
@@ -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