fix: src\hash.c(27): warning C4244: '=': conversion from 'mrb_int' to 'khint_t', possible loss of data
MODIFY
include/mruby/string.h
include/mruby/string.h
@@ -409,7 +409,7 @@ MRB_API int mrb_str_cmp(mrb_state *mrb, mrb_value str1, mrb_value str2);
MRB_API char *mrb_str_to_cstr(mrb_state *mrb, mrb_value str);
mrb_value mrb_str_pool(mrb_state *mrb, mrb_value str);
-mrb_int mrb_str_hash(mrb_state *mrb, mrb_value str);
+uint32_t mrb_str_hash(mrb_state *mrb, mrb_value str);
mrb_value mrb_str_dump(mrb_state *mrb, mrb_value str);
/*

MODIFY
src/string.c
src/string.c
@@ -1467,7 +1467,7 @@ mrb_str_substr(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len)
return str_substr(mrb, str, beg, len);
}
-mrb_int
+uint32_t
mrb_str_hash(mrb_state *mrb, mrb_value str)
{
/* 1-8-7 */
@@ -1480,7 +1480,7 @@ mrb_str_hash(mrb_state *mrb, mrb_value str)
key = key*65599 + *p;
p++;
}
- return (mrb_int)(key + (key>>5));
+ return (uint32_t)(key + (key>>5));
}
/* 15.2.10.5.20 */

fix: src\hash.c(27): warning C4244: '=': conversion from 'mrb_int' to 'khint_t', possible loss of data