Skip to content

Commit

Permalink
Upgrade mruby to 1.4.1 and upgrade included MGEMs.
Browse files Browse the repository at this point in the history
mrb_ary_len() was removed in 1.4. Replacement is RARRAY_LEN().
  • Loading branch information
Quintus committed Aug 4, 2018
1 parent 16e51cd commit 09a3f79
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mruby/mgems/mruby-json
2 changes: 1 addition & 1 deletion mruby/mgems/mruby-sleep
2 changes: 1 addition & 1 deletion mruby/mruby
Submodule mruby updated 215 files
2 changes: 1 addition & 1 deletion tsc/src/level/level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ void cLevel::Pause_All_Timers(bool pause)

// The timer class stores all its instances in the "instances"
// class-instance variable (cf. Timer.new source code). Iterate it.
mrb_int len = mrb_ary_len(p_state, timers);
mrb_int len = RARRAY_LEN(timers);
for(mrb_int i=0; i < len; i++) {
// Wire out the underlying C++ timer and pause it.
mrb_value rb_timer = mrb_ary_ref(p_state, timers, i);
Expand Down
2 changes: 1 addition & 1 deletion tsc/src/scripting/objects/mrb_uids.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ static mrb_value Index(mrb_state* p_state, mrb_value self)
static mrb_value Cache_Size(mrb_state* p_state, mrb_value self)
{
mrb_value keys = mrb_hash_keys(p_state, mrb_iv_get(p_state, self, mrb_intern_cstr(p_state, "cache")));
return mrb_fixnum_value(mrb_ary_len(p_state, keys));
return mrb_fixnum_value(RARRAY_LEN(keys));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tsc/src/scripting/objects/sprites/mrb_moving_sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ static mrb_value Set_Velocity(mrb_state* p_state, mrb_value self)

if (!mrb_array_p(ary))
mrb_raisef(p_state, MRB_TYPE_ERROR(p_state), "Not an array: '%s'", mrb_string_value_ptr(p_state, mrb_inspect(p_state, ary)));
if (mrb_ary_len(p_state, ary) != 2)
if (RARRAY_LEN(ary) != 2)
mrb_raise(p_state, MRB_ARGUMENT_ERROR(p_state), "Not a two-element array.");

mrb_float xvel = mrb_float(mrb_ary_ref(p_state, ary, 0));
Expand Down

0 comments on commit 09a3f79

Please sign in to comment.