Fixes for compiling mruby as C++

This commit is contained in:
Tomasz Dąbrowski
2016-11-22 13:19:05 +01:00
committed by Yukihiro "Matz" Matsumoto
parent 477e12c182
commit 1af9e363f2
7 changed files with 30 additions and 14 deletions
+2 -2
View File
@@ -160,7 +160,7 @@ static void
output_backtrace_i(mrb_state *mrb, struct backtrace_location_raw *loc_raw, void *data)
{
struct backtrace_location loc;
struct output_backtrace_args *args = data;
struct output_backtrace_args *args = (struct output_backtrace_args *)data;
loc.i = loc_raw->i;
loc.lineno = loc_raw->lineno;
@@ -338,7 +338,7 @@ save_backtrace_i(mrb_state *mrb,
else {
new_n_allocated = mrb->backtrace.n_allocated * 2;
}
mrb->backtrace.entries =
mrb->backtrace.entries = (mrb_backtrace_entry *)
mrb_realloc(mrb,
mrb->backtrace.entries,
sizeof(mrb_backtrace_entry) * new_n_allocated);
+1 -1
View File
@@ -361,7 +361,7 @@ mrb_memsearch(const void *x0, mrb_int m, const void *y0, mrb_int n)
return 0;
}
else if (m == 1) {
const unsigned char *ys = memchr(y, *x, n);
const unsigned char *ys = (const unsigned char *)memchr(y, *x, n);
if (ys)
return ys - y;