diff --git a/ChangeLog b/ChangeLog index 0033f7f203..e37a928220 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Mon Jun 25 04:20:14 2007 Koichi Sasada + + * eval_*.h: rename to eval_*.ci. + + * common.mk: ditto. + + * eval_error.ci: remove ruby_set_current_source(). + + * error.c, eval.c, ruby.c: ditto. + + * eval_safe.c, proc.c: remove unused macros. + Mon Jun 25 03:37:20 2007 Koichi Sasada * insnhelper.ci (caller_setup_args): add need_block_check option. diff --git a/common.mk b/common.mk index 47041139e1..3e335561d9 100644 --- a/common.mk +++ b/common.mk @@ -407,8 +407,8 @@ error.$(OBJEXT): {$(VPATH)}error.c {$(VPATH)}ruby.h {$(VPATH)}config.h \ {$(VPATH)}thread_$(THREAD_MODEL).h euc_jp.$(OBJEXT): {$(VPATH)}euc_jp.c {$(VPATH)}regenc.h \ {$(VPATH)}oniguruma.h {$(VPATH)}config.h -eval.$(OBJEXT): {$(VPATH)}eval.c {$(VPATH)}eval_error.h {$(VPATH)}eval_intern.h \ - {$(VPATH)}eval_method.h {$(VPATH)}eval_safe.h {$(VPATH)}eval_jump.h \ +eval.$(OBJEXT): {$(VPATH)}eval.c {$(VPATH)}eval_error.ci {$(VPATH)}eval_intern.h \ + {$(VPATH)}eval_method.ci {$(VPATH)}eval_safe.ci {$(VPATH)}eval_jump.ci \ {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}yarvcore.h \ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \ {$(VPATH)}node.h {$(VPATH)}util.h {$(VPATH)}signal.h \ diff --git a/error.c b/error.c index 283e9c856f..6b5aac0126 100644 --- a/error.c +++ b/error.c @@ -52,7 +52,6 @@ err_position(char *buf, long len) static int compile_position(char *buf, long len) { - ruby_set_current_source(); return err_position_0(buf, len, ruby_sourcefile, ruby_sourceline); } diff --git a/eval.c b/eval.c index 65f972918f..e156c9c263 100644 --- a/eval.c +++ b/eval.c @@ -40,10 +40,10 @@ static VALUE eval(VALUE, VALUE, VALUE, char *, int); static inline VALUE rb_yield_0(int argc, VALUE *argv); static VALUE rb_call(VALUE, VALUE, ID, int, const VALUE *, int); -#include "eval_error.h" -#include "eval_method.h" -#include "eval_safe.h" -#include "eval_jump.h" +#include "eval_error.ci" +#include "eval_method.ci" +#include "eval_safe.ci" +#include "eval_jump.ci" /* initialize ruby */ @@ -691,7 +691,6 @@ rb_longjmp(int tag, VALUE mesg) mesg = rb_exc_new(rb_eRuntimeError, 0, 0); } - ruby_set_current_source(); if (ruby_sourcefile && !NIL_P(mesg)) { at = get_backtrace(mesg); if (NIL_P(at)) { @@ -1708,7 +1707,6 @@ eval(VALUE self, VALUE src, VALUE scope, char *file, int line) NODE *stored_cref_stack = 0; if (file == 0) { - ruby_set_current_source(); file = ruby_sourcefile; line = ruby_sourceline; } diff --git a/eval_error.h b/eval_error.ci similarity index 94% rename from eval_error.h rename to eval_error.ci index 8792462dfe..63428991f3 100644 --- a/eval_error.h +++ b/eval_error.ci @@ -2,17 +2,6 @@ * included by eval.c */ -#define SET_CURRENT_SOURCE() ((void)0) - -void -ruby_set_current_source(void) -{ - if (ruby_current_node) { - ruby_sourcefile = ruby_current_node->nd_file; - ruby_sourceline = nd_line(ruby_current_node); - } -} - static void warn_printf(const char *fmt, ...) { @@ -31,7 +20,6 @@ warn_printf(const char *fmt, ...) static void error_pos(void) { - ruby_set_current_source(); if (ruby_sourcefile) { if (ruby_sourceline == 0) { warn_printf("%s", ruby_sourcefile); @@ -84,7 +72,6 @@ error_print(void) if (EXEC_TAG()) goto error; if (NIL_P(errat)) { - ruby_set_current_source(); if (ruby_sourcefile) warn_printf("%s:%d", ruby_sourcefile, ruby_sourceline); else diff --git a/eval_jump.h b/eval_jump.ci similarity index 100% rename from eval_jump.h rename to eval_jump.ci diff --git a/eval_method.h b/eval_method.ci similarity index 100% rename from eval_method.h rename to eval_method.ci diff --git a/eval_safe.h b/eval_safe.ci similarity index 88% rename from eval_safe.h rename to eval_safe.ci index 0566335bee..aef5767da9 100644 --- a/eval_safe.h +++ b/eval_safe.ci @@ -10,6 +10,8 @@ 4 - no global (non-tainted) variable modification/no direct output */ +#define SAFE_LEVEL_MAX 4 + int rb_safe_level(void) { @@ -22,16 +24,6 @@ rb_set_safe_level_force(int safe) GET_THREAD()->safe_level = safe; } -static VALUE safe_getter _((void)); -static void safe_setter _((VALUE val)); - -#define PROC_TSHIFT (FL_USHIFT+1) -#define PROC_TMASK (FL_USER1|FL_USER2|FL_USER3) -#define PROC_TMAX (PROC_TMASK >> PROC_TSHIFT) -#define PROC_NOSAFE FL_USER4 - -#define SAFE_LEVEL_MAX PROC_TMASK - /* $SAFE accessor */ void rb_set_safe_level(int level) diff --git a/proc.c b/proc.c index 18ffb76661..cb53a0f8ca 100644 --- a/proc.c +++ b/proc.c @@ -240,13 +240,6 @@ bind_eval(int argc, VALUE *argv, VALUE bindval) return rb_f_eval(argc+1, args, Qnil /* self will be searched in eval */); } -#define PROC_TSHIFT (FL_USHIFT+1) -#define PROC_TMASK (FL_USER1|FL_USER2|FL_USER3) -#define PROC_TMAX (PROC_TMASK >> PROC_TSHIFT) -#define PROC_NOSAFE FL_USER4 - -#define SAFE_LEVEL_MAX PROC_TMASK - static VALUE proc_new(VALUE klass, int is_lambda) { diff --git a/ruby.c b/ruby.c index fb9c5595d8..449df7a1e3 100644 --- a/ruby.c +++ b/ruby.c @@ -376,7 +376,6 @@ require_libraries(void) ruby_current_node = 0; Init_ext(); /* should be called here for some reason :-( */ ruby_current_node = save[1]; - ruby_set_current_source(); req_list_last = 0; while (list) { int state; @@ -390,7 +389,6 @@ require_libraries(void) free(list); list = tmp; ruby_current_node = save[1]; - ruby_set_current_source(); } req_list_head.next = 0; ruby_eval_tree = save[0];