Avoid `unsigned int`; Use `mrb_int` instead.
MODIFY
include/mruby.h
include/mruby.h
@@ -1195,8 +1195,8 @@ MRB_API void mrb_close(mrb_state *mrb);
MRB_API void* mrb_default_allocf(mrb_state*, void*, size_t, void*);
MRB_API mrb_value mrb_top_self(mrb_state *mrb);
-MRB_API mrb_value mrb_top_run(mrb_state *mrb, const struct RProc *proc, mrb_value self, unsigned int stack_keep);
-MRB_API mrb_value mrb_vm_run(mrb_state *mrb, const struct RProc *proc, mrb_value self, unsigned int stack_keep);
+MRB_API mrb_value mrb_top_run(mrb_state *mrb, const struct RProc *proc, mrb_value self, mrb_int stack_keep);
+MRB_API mrb_value mrb_vm_run(mrb_state *mrb, const struct RProc *proc, mrb_value self, mrb_int stack_keep);
MRB_API mrb_value mrb_vm_exec(mrb_state *mrb, const struct RProc *proc, const mrb_code *iseq);
/* compatibility macros */
#define mrb_toplevel_run_keep(m,p,k) mrb_top_run((m),(p),mrb_top_self(m),(k))

MODIFY
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
@@ -6555,7 +6555,7 @@ mrb_load_exec(mrb_state *mrb, struct mrb_parser_state *p, mrbc_context *c)
struct RClass *target = mrb->object_class;
struct RProc *proc;
mrb_value v;
- unsigned int keep = 0;
+ mrb_int keep = 0;
if (!p) {
return mrb_undef_value();

MODIFY
mrbgems/mruby-compiler/core/y.tab.c
mrbgems/mruby-compiler/core/y.tab.c
@@ -12447,7 +12447,7 @@ mrb_load_exec(mrb_state *mrb, struct mrb_parser_state *p, mrbc_context *c)
struct RClass *target = mrb->object_class;
struct RProc *proc;
mrb_value v;
- unsigned int keep = 0;
+ mrb_int keep = 0;
if (!p) {
return mrb_undef_value();

MODIFY
src/vm.c
src/vm.c
@@ -982,13 +982,13 @@ prepare_tagged_break(mrb_state *mrb, uint32_t tag, const struct RProc *proc, mrb
#endif
MRB_API mrb_value
-mrb_vm_run(mrb_state *mrb, const struct RProc *proc, mrb_value self, unsigned mrb_int stack_keep)
+mrb_vm_run(mrb_state *mrb, const struct RProc *proc, mrb_value self, mrb_int stack_keep)
{
const mrb_irep *irep = proc->body.irep;
mrb_value result;
struct mrb_context *c = mrb->c;
ptrdiff_t cioff = c->ci - c->cibase;
- unsigned mrb_int nregs = irep->nregs;
+ mrb_int nregs = irep->nregs;
if (!c->stack) {
stack_init(mrb);
@@ -2851,7 +2851,7 @@ mrb_run(mrb_state *mrb, const struct RProc *proc, mrb_value self)
}
MRB_API mrb_value
-mrb_top_run(mrb_state *mrb, const struct RProc *proc, mrb_value self, unsigned int stack_keep)
+mrb_top_run(mrb_state *mrb, const struct RProc *proc, mrb_value self, mrb_int stack_keep)
{
mrb_value v;

Avoid `unsigned int`; Use `mrb_int` instead.