Commit 99df6eee authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1224 from h2so5/remove-mrb_class_obj_get

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