mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Remove commented out code. Remove redundant function calls.
This commit is contained in:
@@ -272,7 +272,6 @@ mrb_value mrb_obj_clone(mrb_state *mrb, mrb_value self);
|
||||
mrb_value mrb_exc_new(mrb_state *mrb, struct RClass *c, const char *ptr, long len);
|
||||
void mrb_exc_raise(mrb_state *mrb, mrb_value exc);
|
||||
|
||||
int mrb_block_given_p(void);
|
||||
void mrb_raise(mrb_state *mrb, struct RClass *c, const char *msg);
|
||||
void mrb_raisef(mrb_state *mrb, struct RClass *c, const char *fmt, ...);
|
||||
void mrb_warn(const char *fmt, ...);
|
||||
|
||||
+1
-2
@@ -187,8 +187,7 @@ str_dump_len(char *str, uint16_t len, int type)
|
||||
if (*src >= ' ' && *src <= '~') {
|
||||
dump_len++;
|
||||
} else {
|
||||
// dump_len += sprintf(buf, "\\%03o", *src & 0377);
|
||||
dump_len += 4;
|
||||
dump_len += 4; /* octet "\\nnn" */
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@ mrb_lastline_get(mrb_state *mrb)
|
||||
mrb_value
|
||||
mrb_exec_recursive(mrb_state *mrb, mrb_value (*func) (mrb_state *, mrb_value, mrb_value, int), mrb_value obj, void *arg)
|
||||
{
|
||||
// return mrb_exec_recursive(mrb, io_puts_ary, line, &out);
|
||||
return func(mrb, obj, *(mrb_value*)arg, 0);
|
||||
}
|
||||
|
||||
@@ -118,7 +117,7 @@ mrb_to_id(mrb_state *mrb, mrb_value name)
|
||||
mrb_value
|
||||
mrb_block_proc(void)
|
||||
{
|
||||
return mrb_nil_value();//proc_new(mrb_cProc, FALSE);
|
||||
return mrb_nil_value();
|
||||
}
|
||||
|
||||
static mrb_int
|
||||
|
||||
@@ -181,12 +181,6 @@ mrb_hash_dup(mrb_state *mrb, mrb_value hash)
|
||||
return mrb_obj_value(ret);
|
||||
}
|
||||
|
||||
static void
|
||||
mrb_hash_modify_check(mrb_state *mrb, mrb_value hash)
|
||||
{
|
||||
//if (OBJ_FROZEN(hash)) mrb_error_frozen("hash");
|
||||
}
|
||||
|
||||
mrb_value
|
||||
mrb_check_hash_type(mrb_state *mrb, mrb_value hash)
|
||||
{
|
||||
@@ -207,7 +201,6 @@ mrb_hash_tbl(mrb_state *mrb, mrb_value hash)
|
||||
static void
|
||||
mrb_hash_modify(mrb_state *mrb, mrb_value hash)
|
||||
{
|
||||
//mrb_hash_modify_check(mrb, hash);
|
||||
mrb_hash_tbl(mrb, hash);
|
||||
}
|
||||
|
||||
@@ -755,7 +748,6 @@ mrb_hash_replace(mrb_state *mrb, mrb_value hash)
|
||||
khiter_t k;
|
||||
|
||||
mrb_get_args(mrb, "o", &hash2);
|
||||
mrb_hash_modify_check(mrb, hash);
|
||||
hash2 = to_hash(mrb, hash2);
|
||||
if (mrb_obj_equal(mrb, hash, hash2)) return hash;
|
||||
mrb_hash_clear(mrb, hash);
|
||||
|
||||
@@ -1319,7 +1319,6 @@ mrb_str_include(mrb_state *mrb, mrb_value self)
|
||||
return mrb_true_value();
|
||||
return mrb_false_value();
|
||||
}
|
||||
//StringValue(arg);
|
||||
mrb_string_value(mrb, &str2);
|
||||
i = mrb_str_index(mrb, self, str2, 0);
|
||||
|
||||
@@ -1985,14 +1984,6 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mrb_block_given_p()
|
||||
{
|
||||
/*if (ruby_frame->iter == ITER_CUR && ruby_block)
|
||||
return 1;*//*Qtrue*/
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* 15.2.10.5.37 */
|
||||
/*
|
||||
* call-seq:
|
||||
@@ -2281,8 +2272,6 @@ mrb_cstr_to_dbl(mrb_state *mrb, const char * p, int badcheck)
|
||||
{
|
||||
char *end;
|
||||
double d;
|
||||
// const char *ellipsis = "";
|
||||
// int w;
|
||||
#if !defined(DBL_DIG)
|
||||
#define DBL_DIG 16
|
||||
#endif
|
||||
@@ -2353,7 +2342,6 @@ mrb_str_to_dbl(mrb_state *mrb, mrb_value str, int badcheck)
|
||||
char *s;
|
||||
int len;
|
||||
|
||||
//StringValue(str);
|
||||
mrb_string_value(mrb, &str);
|
||||
s = RSTRING_PTR(str);
|
||||
len = RSTRING_LEN(str);
|
||||
|
||||
@@ -172,12 +172,6 @@ static mrb_value (*const ref_func[])(mrb_state*, mrb_value) = {
|
||||
mrb_struct_ref9,
|
||||
};
|
||||
|
||||
static void
|
||||
mrb_struct_modify(mrb_value s)
|
||||
{
|
||||
//if (OBJ_FROZEN(s)) mrb_error_frozen("Struct");
|
||||
}
|
||||
|
||||
mrb_sym
|
||||
mrb_id_attrset(mrb_state *mrb, mrb_sym id)
|
||||
{
|
||||
@@ -212,7 +206,6 @@ mrb_struct_set(mrb_state *mrb, mrb_value obj, mrb_value val)
|
||||
members = mrb_struct_members(mrb, obj);
|
||||
ptr_members = RARRAY_PTR(members);
|
||||
len = RARRAY_LEN(members);
|
||||
mrb_struct_modify(obj);
|
||||
ptr = RSTRUCT_PTR(obj);
|
||||
for (i=0; i<len; i++) {
|
||||
slot = ptr_members[i];
|
||||
@@ -429,7 +422,6 @@ mrb_struct_initialize_withArg(mrb_state *mrb, int argc, mrb_value *argv, mrb_val
|
||||
int n;
|
||||
struct RStruct *st;
|
||||
|
||||
mrb_struct_modify(self);
|
||||
n = num_members(mrb, klass);
|
||||
if (n < argc) {
|
||||
mrb_raise(mrb, E_ARGUMENT_ERROR, "struct size differs");
|
||||
@@ -616,7 +608,6 @@ mrb_struct_aset_id(mrb_state *mrb, mrb_value s, mrb_sym id, mrb_value val)
|
||||
|
||||
members = mrb_struct_members(mrb, s);
|
||||
len = RARRAY_LEN(members);
|
||||
mrb_struct_modify(s);
|
||||
if (RSTRUCT_LEN(s) != len) {
|
||||
mrb_raisef(mrb, E_TYPE_ERROR, "struct size differs (%ld required %ld given)",
|
||||
len, RSTRUCT_LEN(s));
|
||||
@@ -678,7 +669,6 @@ mrb_struct_aset(mrb_state *mrb, mrb_value s)
|
||||
mrb_raisef(mrb, E_INDEX_ERROR, "offset %ld too large for struct(size:%ld)",
|
||||
i, RSTRUCT_LEN(s));
|
||||
}
|
||||
mrb_struct_modify(s);
|
||||
return RSTRUCT_PTR(s)[i] = val;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user