diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-01-29 18:32:26 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-01-29 18:32:26 +0900 |
| commit | 825241205f07d387ea2490e43de58658cbc35ab6 (patch) | |
| tree | eb6ac61b2f308bc138ef84451befc7f0a1d99a8b | |
| parent | 4a7309d327956cdab7450405a5334b997de55a25 (diff) | |
| download | mruby-825241205f07d387ea2490e43de58658cbc35ab6.tar.gz mruby-825241205f07d387ea2490e43de58658cbc35ab6.zip | |
Replace `mrb_intern_cstr` to `mrb_intern_lit`.
| -rw-r--r-- | mrbgems/mruby-io/src/io.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mrbgems/mruby-io/src/io.c b/mrbgems/mruby-io/src/io.c index b9d136a5a..0469c0545 100644 --- a/mrbgems/mruby-io/src/io.c +++ b/mrbgems/mruby-io/src/io.c @@ -447,7 +447,7 @@ mrb_io_s_popen(mrb_state *mrb, mrb_value klass) pid = pi.dwProcessId; } - mrb_iv_set(mrb, io, mrb_intern_cstr(mrb, "@buf"), mrb_str_new_cstr(mrb, "")); + mrb_iv_set(mrb, io, mrb_intern_lit(mrb, "@buf"), mrb_str_new_cstr(mrb, "")); fptr = mrb_io_alloc(mrb); fptr->fd = _open_osfhandle((intptr_t)ofd[0], 0); @@ -555,7 +555,7 @@ mrb_io_s_popen(mrb_state *mrb, mrb_value klass) fd = pw[1]; } - mrb_iv_set(mrb, io, mrb_intern_cstr(mrb, "@buf"), mrb_str_new_cstr(mrb, "")); + mrb_iv_set(mrb, io, mrb_intern_lit(mrb, "@buf"), mrb_str_new_cstr(mrb, "")); fptr = mrb_io_alloc(mrb); fptr->fd = fd; @@ -624,8 +624,8 @@ mrb_io_initialize_copy(mrb_state *mrb, mrb_value copy) DATA_TYPE(copy) = &mrb_io_type; DATA_PTR(copy) = fptr_copy; - buf = mrb_iv_get(mrb, orig, mrb_intern_cstr(mrb, "@buf")); - mrb_iv_set(mrb, copy, mrb_intern_cstr(mrb, "@buf"), buf); + buf = mrb_iv_get(mrb, orig, mrb_intern_lit(mrb, "@buf")); + mrb_iv_set(mrb, copy, mrb_intern_lit(mrb, "@buf"), buf); fptr_copy->fd = mrb_dup(mrb, fptr_orig->fd, &failed); if (failed) { @@ -717,7 +717,7 @@ mrb_io_initialize(mrb_state *mrb, mrb_value io) flags = mrb_io_mode_to_flags(mrb, mode); - mrb_iv_set(mrb, io, mrb_intern_cstr(mrb, "@buf"), mrb_str_new_cstr(mrb, "")); + mrb_iv_set(mrb, io, mrb_intern_lit(mrb, "@buf"), mrb_str_new_cstr(mrb, "")); fptr = (struct mrb_io *)DATA_PTR(io); if (fptr != NULL) { @@ -1106,7 +1106,7 @@ time2timeval(mrb_state *mrb, mrb_value time) static int mrb_io_read_data_pending(mrb_state *mrb, mrb_value io) { - mrb_value buf = mrb_iv_get(mrb, io, mrb_intern_cstr(mrb, "@buf")); + mrb_value buf = mrb_iv_get(mrb, io, mrb_intern_lit(mrb, "@buf")); if (mrb_string_p(buf) && RSTRING_LEN(buf) > 0) { return 1; } @@ -1128,7 +1128,7 @@ mrb_io_s_pipe(mrb_state *mrb, mrb_value klass) } r = mrb_obj_value(mrb_data_object_alloc(mrb, mrb_class_ptr(klass), NULL, &mrb_io_type)); - mrb_iv_set(mrb, r, mrb_intern_cstr(mrb, "@buf"), mrb_str_new_cstr(mrb, "")); + mrb_iv_set(mrb, r, mrb_intern_lit(mrb, "@buf"), mrb_str_new_cstr(mrb, "")); fptr_r = mrb_io_alloc(mrb); fptr_r->fd = pipes[0]; fptr_r->readable = 1; @@ -1138,7 +1138,7 @@ mrb_io_s_pipe(mrb_state *mrb, mrb_value klass) DATA_PTR(r) = fptr_r; w = mrb_obj_value(mrb_data_object_alloc(mrb, mrb_class_ptr(klass), NULL, &mrb_io_type)); - mrb_iv_set(mrb, w, mrb_intern_cstr(mrb, "@buf"), mrb_str_new_cstr(mrb, "")); + mrb_iv_set(mrb, w, mrb_intern_lit(mrb, "@buf"), mrb_str_new_cstr(mrb, "")); fptr_w = mrb_io_alloc(mrb); fptr_w->fd = pipes[1]; fptr_w->readable = 0; |
