Skip to content

Commit c11d18e

Browse files
committed
object.h: unify MRB_FROZEN_P() and mrb_frozen_p()
1 parent 2100374 commit c11d18e

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

include/mruby/object.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ struct RBasic {
2323
#define mrb_basic_ptr(v) ((struct RBasic*)(mrb_ptr(v)))
2424

2525
#define MRB_OBJ_IS_FROZEN 1
26-
#define MRB_FROZEN_P(o) ((o)->frozen)
26+
#define mrb_frozen_p(o) ((o)->frozen)
2727
#define MRB_SET_FROZEN_FLAG(o) ((o)->frozen = 1)
2828
#define MRB_UNSET_FROZEN_FLAG(o) ((o)->frozen = 0)
29-
#define mrb_frozen_p(o) MRB_FROZEN_P(o)
3029

3130
struct RObject {
3231
MRB_OBJECT_HEADER;

src/class.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ mrb_define_method_raw(mrb_state *mrb, struct RClass *c, mrb_sym mid, mrb_method_
768768
}
769769
}
770770
else {
771-
mrb_assert(MRB_FROZEN_P(p) && MRB_PROC_SCOPE_P(p));
771+
mrb_assert(mrb_frozen_p(p) && MRB_PROC_SCOPE_P(p));
772772
mrb_assert(p->c == NULL && p->upper == NULL && p->e.target_class == NULL);
773773
}
774774
}

src/hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ ht_rehash(mrb_state *mrb, struct RHash *h)
987987
static mrb_value
988988
h_key_for(mrb_state *mrb, mrb_value key)
989989
{
990-
if (mrb_string_p(key) && !MRB_FROZEN_P(mrb_str_ptr(key))) {
990+
if (mrb_string_p(key) && !mrb_frozen_p(mrb_str_ptr(key))) {
991991
key = mrb_str_dup(mrb, key);
992992
MRB_SET_FROZEN_FLAG(mrb_str_ptr(key));
993993
}

0 commit comments

Comments
 (0)