mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Replace mrb_intern_cstr to mrb_intern_lit.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user