diff options
| -rw-r--r-- | include/mruby/object.h | 6 | ||||
| -rw-r--r-- | src/array.c | 2 | ||||
| -rw-r--r-- | src/hash.c | 6 | ||||
| -rw-r--r-- | src/kernel.c | 2 | ||||
| -rw-r--r-- | src/string.c | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/include/mruby/object.h b/include/mruby/object.h index da44027e1..9347981d4 100644 --- a/include/mruby/object.h +++ b/include/mruby/object.h @@ -22,9 +22,9 @@ struct RBasic { }; #define mrb_basic_ptr(v) ((struct RBasic*)(mrb_ptr(v))) -#define RBASIC_FROZEN_P(o) ((o)->flags & MRB_FLAG_IS_FROZEN) -#define RBASIC_SET_FROZEN_FLAG(o) ((o)->flags |= MRB_FLAG_IS_FROZEN) -#define RBASIC_UNSET_FROZEN_FLAG(o) ((o)->flags &= ~MRB_FLAG_IS_FROZEN) +#define MRB_FROZEN_P(o) ((o)->flags & MRB_FLAG_IS_FROZEN) +#define MRB_SET_FROZEN_FLAG(o) ((o)->flags |= MRB_FLAG_IS_FROZEN) +#define MRB_UNSET_FROZEN_FLAG(o) ((o)->flags &= ~MRB_FLAG_IS_FROZEN) struct RObject { MRB_OBJECT_HEADER; diff --git a/src/array.c b/src/array.c index c6bac7b47..7601e9c17 100644 --- a/src/array.c +++ b/src/array.c @@ -108,7 +108,7 @@ ary_fill_with_nil(mrb_value *ptr, mrb_int size) static void ary_modify(mrb_state *mrb, struct RArray *a) { - if (RBASIC_FROZEN_P(a)) { + if (MRB_FROZEN_P(a)) { mrb_raise(mrb, E_RUNTIME_ERROR, "can't modify frozen array"); } diff --git a/src/hash.c b/src/hash.c index d0e865b5c..c65c8926e 100644 --- a/src/hash.c +++ b/src/hash.c @@ -98,9 +98,9 @@ static void mrb_hash_modify(mrb_state *mrb, mrb_value hash); static inline mrb_value mrb_hash_ht_key(mrb_state *mrb, mrb_value key) { - if (mrb_string_p(key) && !RBASIC_FROZEN_P(mrb_str_ptr(key))) { + if (mrb_string_p(key) && !MRB_FROZEN_P(mrb_str_ptr(key))) { key = mrb_str_dup(mrb, key); - RBASIC_SET_FROZEN_FLAG(mrb_str_ptr(key)); + MRB_SET_FROZEN_FLAG(mrb_str_ptr(key)); } return key; } @@ -278,7 +278,7 @@ mrb_hash_tbl(mrb_state *mrb, mrb_value hash) static void mrb_hash_modify(mrb_state *mrb, mrb_value hash) { - if (RBASIC_FROZEN_P(mrb_hash_ptr(hash))) { + if (MRB_FROZEN_P(mrb_hash_ptr(hash))) { mrb_raise(mrb, E_RUNTIME_ERROR, "can't modify frozen hash"); } mrb_hash_tbl(mrb, hash); diff --git a/src/kernel.c b/src/kernel.c index 78e57a17a..a5166deb2 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -455,7 +455,7 @@ mrb_obj_freeze(mrb_state *mrb, mrb_value self) { struct RBasic *b = mrb_basic_ptr(self); - RBASIC_SET_FROZEN_FLAG(b); + MRB_SET_FROZEN_FLAG(b); return self; } diff --git a/src/string.c b/src/string.c index 7234ecf2b..ee5aa04f3 100644 --- a/src/string.c +++ b/src/string.c @@ -501,7 +501,7 @@ str_index(mrb_state *mrb, mrb_value str, mrb_value sub, mrb_int offset) static void check_frozen(mrb_state *mrb, struct RString *s) { - if (RBASIC_FROZEN_P(s)) { + if (MRB_FROZEN_P(s)) { mrb_raise(mrb, E_RUNTIME_ERROR, "can't modify frozen string"); } } @@ -2208,7 +2208,7 @@ mrb_string_value_cstr(mrb_state *mrb, mrb_value *ptr) char *p = RSTR_PTR(ps); if (!p || p[len] != '\0') { - if (RBASIC_FROZEN_P(ps)) { + if (MRB_FROZEN_P(ps)) { *ptr = str = mrb_str_dup(mrb, str); ps = mrb_str_ptr(str); } |
