From d8444593774466d835b982c215035d98bc52f3e0 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Thu, 28 Oct 2021 09:12:14 +0900 Subject: Fix a warning ``` ../gc.c:2342:45: warning: comparison of integers of different signs: 'short' and 'size_t' (aka 'unsigned long') [-Wsign-compare] GC_ASSERT(size_pools[pool_id].slot_size == slot_size); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ ``` Add cast to short, because `GC_ASSERT`s in `size_pool_for_size` already use cast to short. --- gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gc.c b/gc.c index b5d5df692b..cfe0f3098b 100644 --- a/gc.c +++ b/gc.c @@ -2339,7 +2339,7 @@ size_pool_slot_size(unsigned char pool_id) #if RGENGC_CHECK_MODE rb_objspace_t *objspace = &rb_objspace; - GC_ASSERT(size_pools[pool_id].slot_size == slot_size); + GC_ASSERT(size_pools[pool_id].slot_size == (short)slot_size); #endif return slot_size; -- cgit v1.2.3