Skip to content

Commit

Permalink
* eval_*.h: rename to eval_*.ci.
Browse files Browse the repository at this point in the history
* 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.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
ko1 committed Jun 24, 2007
1 parent 144ff32 commit 6bd0345
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 41 deletions.
12 changes: 12 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
Mon Jun 25 04:20:14 2007 Koichi Sasada <[email protected]>

* 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 <[email protected]>

* insnhelper.ci (caller_setup_args): add need_block_check option.
Expand Down
4 changes: 2 additions & 2 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 0 additions & 1 deletion error.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
10 changes: 4 additions & 6 deletions eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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;
}
Expand Down
13 changes: 0 additions & 13 deletions eval_error.h → eval_error.ci
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...)
{
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 2 additions & 10 deletions eval_safe.h → eval_safe.ci
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
4 - no global (non-tainted) variable modification/no direct output
*/

#define SAFE_LEVEL_MAX 4

int
rb_safe_level(void)
{
Expand All @@ -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)
Expand Down
7 changes: 0 additions & 7 deletions proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 0 additions & 2 deletions ruby.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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];
Expand Down

0 comments on commit 6bd0345

Please sign in to comment.