diff options
| -rw-r--r-- | src/codegen.c | 12 | ||||
| -rw-r--r-- | src/error.c | 31 | ||||
| -rw-r--r-- | src/error.h | 1 | ||||
| -rw-r--r-- | src/etc.c | 8 | ||||
| -rw-r--r-- | src/hash.c | 8 | ||||
| -rw-r--r-- | src/kernel.c | 13 | ||||
| -rw-r--r-- | src/load.c | 8 | ||||
| -rw-r--r-- | src/object.c | 8 | ||||
| -rw-r--r-- | src/parse.y | 8 | ||||
| -rw-r--r-- | src/range.c | 8 | ||||
| -rw-r--r-- | src/string.c | 2 | ||||
| -rw-r--r-- | src/variable.c | 8 |
12 files changed, 1 insertions, 114 deletions
diff --git a/src/codegen.c b/src/codegen.c index 1bdc2d21c..b64a18b96 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -298,20 +298,8 @@ push_(codegen_scope *s) s->sp++; nregs_update; } -#if 0 -static void -push_n_(codegen_scope *s, int n) -{ - if (s->sp + n > 511) { - codegen_error(s, "too complex expression"); - } - s->sp += n; - nregs_update; -} -#endif #define push() push_(s) -#define push_n(n) push_n_(s, n) #define pop() (s->sp--) #define pop_n(n) (s->sp-=(n)) #define cursp() (s->sp) diff --git a/src/error.c b/src/error.c index bb334322f..3585f1634 100644 --- a/src/error.c +++ b/src/error.c @@ -20,14 +20,6 @@ #define warn_printf printf -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - mrb_value mrb_exc_new(mrb_state *mrb, struct RClass *c, const char *ptr, long len) { @@ -300,28 +292,6 @@ sysexit_status(mrb_state *mrb, mrb_value err) return mrb_fixnum(st); } -void -error_pos(void) -{ -#if 0 - const char *sourcefile = mrb_sourcefile(); - int sourceline = mrb_sourceline(); - - if (sourcefile) { - if (sourceline == 0) { - warn_printf("%s", sourcefile); - } - else if (mrb_frame_callee()) { - warn_printf("%s:%d:in `%s'", sourcefile, sourceline, - mrb_sym2name(mrb, mrb_frame_callee())); - } - else { - warn_printf("%s:%d", sourcefile, sourceline); - } - } -#endif -} - static void set_backtrace(mrb_state *mrb, mrb_value info, mrb_value bt) { @@ -428,7 +398,6 @@ mrb_init_exception(mrb_state *mrb) // eScriptError = mrb_define_class(mrb, "ScriptError", mrb->eException_class); /* 15.2.37 */ // mrb_define_class(mrb, "SyntaxError", eScriptError); /* 15.2.38 */ // mrb_define_class(mrb, "LoadError", eScriptError); /* 15.2.39 */ - // mrb_define_class(mrb, "NotImplementedError", eScriptError_class); // mrb_define_class(mrb, "SystemCallError", mrb->eStandardError_class); /* 15.2.36 */ mrb_define_class(mrb, "LocalJumpError", mrb->eStandardError_class); /* 15.2.25 */ diff --git a/src/error.h b/src/error.h index 8a86e7d3d..e4d6acb6c 100644 --- a/src/error.h +++ b/src/error.h @@ -14,7 +14,6 @@ struct RException { void mrb_sys_fail(mrb_state *mrb, const char *mesg); void mrb_bug_errno(const char*, int); int sysexit_status(mrb_state *mrb, mrb_value err); -void error_pos(void); mrb_value mrb_exc_new3(mrb_state *mrb, struct RClass* c, mrb_value str); mrb_value make_exception(mrb_state *mrb, int argc, mrb_value *argv, int isstr); mrb_value mrb_make_exception(mrb_state *mrb, int argc, mrb_value *argv); @@ -10,14 +10,6 @@ #include "mruby/numeric.h" #include "mruby/data.h" -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - struct RData* mrb_data_object_alloc(mrb_state *mrb, struct RClass *klass, void *ptr, const struct mrb_data_type *type) { diff --git a/src/hash.c b/src/hash.c index 4a85fcec3..fe5336dc1 100644 --- a/src/hash.c +++ b/src/hash.c @@ -33,14 +33,6 @@ mrb_hash_ht_hash_equal(mrb_state *mrb, mrb_value a, mrb_value b) KHASH_INIT(ht, mrb_value, mrb_value, 1, mrb_hash_ht_hash_func, mrb_hash_ht_hash_equal); -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - static void mrb_hash_modify(mrb_state *mrb, mrb_value hash); static inline mrb_value diff --git a/src/kernel.c b/src/kernel.c index 4856af7ad..6dfe6be19 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -34,22 +34,9 @@ typedef enum { NOEX_RESPONDS = 0x80 } mrb_method_flag_t; -#ifdef INCLUDE_REGEXP -#include "re.h" -#include "regint.h" -#endif - KHASH_INIT(mt, mrb_sym, struct RProc*, 1, kh_int_hash_func, kh_int_hash_equal) KHASH_INIT(iv, mrb_sym, mrb_value, 1, kh_int_hash_func, kh_int_hash_equal) -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - struct obj_ivar_tag { mrb_value obj; int (*func)(mrb_sym key, mrb_value val, void * arg); diff --git a/src/load.c b/src/load.c index 053ec2d7e..1f853df00 100644 --- a/src/load.c +++ b/src/load.c @@ -13,14 +13,6 @@ #endif #include "mruby/irep.h" -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - typedef struct _RiteFILE { FILE* fp; diff --git a/src/object.c b/src/object.c index c9ea3f8eb..a30e7c58a 100644 --- a/src/object.c +++ b/src/object.c @@ -11,14 +11,6 @@ #include "mruby/class.h" #include "mruby/numeric.h" -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - int mrb_obj_eq(mrb_state *mrb, mrb_value v1, mrb_value v2) { diff --git a/src/parse.y b/src/parse.y index 7ca0cda80..5e44dd85a 100644 --- a/src/parse.y +++ b/src/parse.y @@ -41,14 +41,6 @@ static void backref_error(parser_state *p, node *n); #define identchar(c) (isalnum(c) || (c) == '_' || !isascii(c)) -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - typedef unsigned int stack_type; #define BITSTACK_PUSH(stack, n) ((stack) = ((stack)<<1)|((n)&1)) diff --git a/src/range.c b/src/range.c index acec1514e..a158dd920 100644 --- a/src/range.c +++ b/src/range.c @@ -15,14 +15,6 @@ #include <stdio.h> #include <string.h> -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - #ifndef OTHER #define OTHER 2 #endif diff --git a/src/string.c b/src/string.c index 14041127a..a9e155c72 100644 --- a/src/string.c +++ b/src/string.c @@ -763,7 +763,7 @@ num_index: len = RSTRING_LEN(str); switch (mrb_range_beg_len(mrb, indx, &beg, &len, len, 0)) { - case 0/*FLASE*/: + case FALSE: break; case 2/*OTHER*/: return mrb_nil_value(); diff --git a/src/variable.c b/src/variable.c index b8957fb6a..47029da28 100644 --- a/src/variable.c +++ b/src/variable.c @@ -21,14 +21,6 @@ KHASH_INIT(iv, mrb_sym, mrb_value, 1, kh_int_hash_func, kh_int_hash_equal) -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - static void mark_tbl(mrb_state *mrb, struct kh_iv *h) { |
