Commit 1e5b00e7 authored by h2so5's avatar h2so5

Remove mrb_class_obj_get

parent 96637a77
......@@ -161,7 +161,6 @@ struct RClass * mrb_class_new(mrb_state *mrb, struct RClass *super);
struct RClass * mrb_module_new(mrb_state *mrb);
int mrb_class_defined(mrb_state *mrb, const char *name);
struct RClass * mrb_class_get(mrb_state *mrb, const char *name);
struct RClass * mrb_class_obj_get(mrb_state *mrb, const char *name);
mrb_value mrb_obj_dup(mrb_state *mrb, mrb_value obj);
mrb_value mrb_check_to_integer(mrb_state *mrb, mrb_value val, const char *method);
......@@ -308,22 +307,22 @@ void mrb_bug(const char *fmt, ...);
+ those E_* macros requires mrb_state* variable named mrb.
+ exception objects obtained from those macros are local to mrb
*/
#define E_RUNTIME_ERROR (mrb_class_obj_get(mrb, "RuntimeError"))
#define E_TYPE_ERROR (mrb_class_obj_get(mrb, "TypeError"))
#define E_ARGUMENT_ERROR (mrb_class_obj_get(mrb, "ArgumentError"))
#define E_INDEX_ERROR (mrb_class_obj_get(mrb, "IndexError"))
#define E_RANGE_ERROR (mrb_class_obj_get(mrb, "RangeError"))
#define E_NAME_ERROR (mrb_class_obj_get(mrb, "NameError"))
#define E_NOMETHOD_ERROR (mrb_class_obj_get(mrb, "NoMethodError"))
#define E_SCRIPT_ERROR (mrb_class_obj_get(mrb, "ScriptError"))
#define E_SYNTAX_ERROR (mrb_class_obj_get(mrb, "SyntaxError"))
#define E_LOCALJUMP_ERROR (mrb_class_obj_get(mrb, "LocalJumpError"))
#define E_REGEXP_ERROR (mrb_class_obj_get(mrb, "RegexpError"))
#define E_NOTIMP_ERROR (mrb_class_obj_get(mrb, "NotImplementedError"))
#define E_FLOATDOMAIN_ERROR (mrb_class_obj_get(mrb, "FloatDomainError"))
#define E_KEY_ERROR (mrb_class_obj_get(mrb, "KeyError"))
#define E_RUNTIME_ERROR (mrb_class_get(mrb, "RuntimeError"))
#define E_TYPE_ERROR (mrb_class_get(mrb, "TypeError"))
#define E_ARGUMENT_ERROR (mrb_class_get(mrb, "ArgumentError"))
#define E_INDEX_ERROR (mrb_class_get(mrb, "IndexError"))
#define E_RANGE_ERROR (mrb_class_get(mrb, "RangeError"))
#define E_NAME_ERROR (mrb_class_get(mrb, "NameError"))
#define E_NOMETHOD_ERROR (mrb_class_get(mrb, "NoMethodError"))
#define E_SCRIPT_ERROR (mrb_class_get(mrb, "ScriptError"))
#define E_SYNTAX_ERROR (mrb_class_get(mrb, "SyntaxError"))
#define E_LOCALJUMP_ERROR (mrb_class_get(mrb, "LocalJumpError"))
#define E_REGEXP_ERROR (mrb_class_get(mrb, "RegexpError"))
#define E_NOTIMP_ERROR (mrb_class_get(mrb, "NotImplementedError"))
#define E_FLOATDOMAIN_ERROR (mrb_class_get(mrb, "FloatDomainError"))
#define E_KEY_ERROR (mrb_class_get(mrb, "KeyError"))
mrb_value mrb_yield(mrb_state *mrb, mrb_value v, mrb_value blk);
mrb_value mrb_yield_argv(mrb_state *mrb, mrb_value b, int argc, mrb_value *argv);
......
......@@ -9,7 +9,7 @@
#include "mruby/range.h"
#include "mruby/string.h"
#define RANGE_CLASS (mrb_class_obj_get(mrb, "Range"))
#define RANGE_CLASS (mrb_class_get(mrb, "Range"))
static void
range_check(mrb_state *mrb, mrb_value a, mrb_value b)
......
......@@ -1066,15 +1066,6 @@ mrb_attr_get(mrb_state *mrb, mrb_value obj, mrb_sym id)
return mrb_iv_get(mrb, obj, id);
}
struct RClass *
mrb_class_obj_get(mrb_state *mrb, const char *name)
{
mrb_value mod = mrb_obj_value(mrb->object_class);
mrb_sym sym = mrb_intern(mrb, name);
return mrb_class_ptr(mrb_const_get(mrb, mod, sym));
}
struct csym_arg {
struct RClass *c;
mrb_sym sym;
......
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