Commit db96db6a authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

move declaration in the middle

parent da9e8ceb
...@@ -2694,14 +2694,10 @@ str_encode_bang(mrb_state *mrb, /*int argc, mrb_value *argv,*/ mrb_value str) ...@@ -2694,14 +2694,10 @@ str_encode_bang(mrb_state *mrb, /*int argc, mrb_value *argv,*/ mrb_value str)
{ {
mrb_value argv[16]; mrb_value argv[16];
int argc; int argc;
mrb_get_args(mrb, "*", &argv, &argc);
mrb_value newstr; mrb_value newstr;
int encidx; int encidx;
//if (OBJ_FROZEN(str)) { /* in future, may use str_frozen_check from string.c, but that's currently static */ mrb_get_args(mrb, "*", &argv, &argc);
// mrb_raise(mrb, mrb->eRuntimeError_class, "string frozen");
//}
newstr = str; newstr = str;
encidx = str_transcode(mrb, argc, argv, &newstr); encidx = str_transcode(mrb, argc, argv, &newstr);
...@@ -2770,10 +2766,12 @@ str_encode(mrb_state *mrb, /*int argc, mrb_value *argv,*/ mrb_value str) ...@@ -2770,10 +2766,12 @@ str_encode(mrb_state *mrb, /*int argc, mrb_value *argv,*/ mrb_value str)
{ {
mrb_value argv[16]; mrb_value argv[16];
int argc; int argc;
mrb_value newstr;
int encidx;
mrb_get_args(mrb, "*", &argv, &argc); mrb_get_args(mrb, "*", &argv, &argc);
mrb_value newstr = str; newstr = str;
int encidx = str_transcode(mrb, argc, argv, &newstr); encidx = str_transcode(mrb, argc, argv, &newstr);
if (encidx < 0) return mrb_str_dup(mrb, str); if (encidx < 0) return mrb_str_dup(mrb, str);
if (mrb_obj_equal(mrb, newstr, str)) { if (mrb_obj_equal(mrb, newstr, str)) {
...@@ -3908,11 +3906,11 @@ econv_insert_output(mrb_state *mrb, mrb_value self) ...@@ -3908,11 +3906,11 @@ econv_insert_output(mrb_state *mrb, mrb_value self)
{ {
mrb_value string; mrb_value string;
const char *insert_enc; const char *insert_enc;
mrb_econv_t *ec;
int ret; int ret;
mrb_get_args(mrb, "o", &string); mrb_get_args(mrb, "o", &string);
mrb_econv_t *ec = check_econv(mrb, self); ec = check_econv(mrb, self);
//StringValue(string); //StringValue(string);
mrb_string_value(mrb, &string); mrb_string_value(mrb, &string);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment