Add explicit type cast to return value from `mrmchr`; ref #4940

C++ is stricter in implicit type casting.
parent 6d9109bf
...@@ -516,7 +516,7 @@ mrb_memsearch_qs(const unsigned char *xs, mrb_int m, const unsigned char *ys, mr ...@@ -516,7 +516,7 @@ mrb_memsearch_qs(const unsigned char *xs, mrb_int m, const unsigned char *ys, mr
const unsigned char *ye = ys+n-m+1; const unsigned char *ye = ys+n-m+1;
for (;;) { for (;;) {
y = memchr(y, xs[0], (size_t)(ye-y)); y = (const unsigned char*)memchr(y, xs[0], (size_t)(ye-y));
if (y == NULL) return -1; if (y == NULL) return -1;
if (memcmp(xs, y, m) == 0) { if (memcmp(xs, y, m) == 0) {
return (mrb_int)(y - ys); return (mrb_int)(y - ys);
......
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