Use `uint32_t` to avoid signed integer overflow warning; #3816

parent 8c408379
...@@ -91,7 +91,7 @@ mrb_float_id(mrb_float f) ...@@ -91,7 +91,7 @@ mrb_float_id(mrb_float f)
{ {
const char *p = (const char*)&f; const char *p = (const char*)&f;
int len = sizeof(f); int len = sizeof(f);
mrb_int id = 0; uint32_t id = 0;
/* normalize -0.0 to 0.0 */ /* normalize -0.0 to 0.0 */
if (f == 0) f = 0.0; if (f == 0) f = 0.0;
...@@ -101,7 +101,7 @@ mrb_float_id(mrb_float f) ...@@ -101,7 +101,7 @@ mrb_float_id(mrb_float f)
} }
id = id + (id>>5); id = id + (id>>5);
return id; return (mrb_int)id;
} }
MRB_API mrb_int MRB_API mrb_int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment