summaryrefslogtreecommitdiffhomepage
path: root/src/state.c
diff options
context:
space:
mode:
authorJun Hiroe <[email protected]>2014-07-03 18:23:09 +0900
committerJun Hiroe <[email protected]>2014-07-03 18:26:42 +0900
commit569ea74021bc9837a729f34591b4f8a174b98221 (patch)
tree91378a0455fcdf9ce39da647c2a3e66313f82bfc /src/state.c
parent9a5f98fec861170a7d6fb263a180c6e90c1a5bc0 (diff)
downloadmruby-569ea74021bc9837a729f34591b4f8a174b98221.tar.gz
mruby-569ea74021bc9837a729f34591b4f8a174b98221.zip
Use *_EMBED_* macro in state.c
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/state.c b/src/state.c
index 8857d3294..6ce429c7e 100644
--- a/src/state.c
+++ b/src/state.c
@@ -190,9 +190,9 @@ mrb_str_pool(mrb_state *mrb, mrb_value str)
}
else {
ns->flags = 0;
- if (s->flags & MRB_STR_EMBED) {
+ if (RSTR_EMBED_P(s)) {
ptr = s->as.ary;
- len = (mrb_int)((s->flags & MRB_STR_EMBED_LEN_MASK) >> MRB_STR_EMBED_LEN_SHIFT);
+ len = RSTR_EMBED_LEN(s);
}
else {
ptr = s->as.heap.ptr;
@@ -200,9 +200,8 @@ mrb_str_pool(mrb_state *mrb, mrb_value str)
}
if (len < RSTRING_EMBED_LEN_MAX) {
- ns->flags |= MRB_STR_EMBED;
- ns->flags &= ~MRB_STR_EMBED_LEN_MASK;
- ns->flags |= (size_t)len << MRB_STR_EMBED_LEN_SHIFT;
+ RSTR_SET_EMBED_FLAG(ns);
+ RSTR_SET_EMBED_LEN(ns, len);
if (ptr) {
memcpy(ns->as.ary, ptr, len);
}