From 5ed8c08aa0277b30e00cb27cc2da1d785c145170 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 18 Jun 2011 08:26:19 +0000 Subject: [PATCH] * eval.c, hash.c, load.c, proc.c, range.c, thread.c, time.c: don't declare internal functions. * internal.h, vm_core.h: declare internal functions. * array.c: include internal.h. * common.mk: update dependency for array.o. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 11 +++++++++++ array.c | 1 + common.mk | 2 +- eval.c | 2 -- hash.c | 1 - internal.h | 7 +++++++ load.c | 1 - proc.c | 2 -- range.c | 2 -- thread.c | 1 - time.c | 1 - vm_core.h | 3 +++ 12 files changed, 23 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index ef9733759e..835983dc3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Sat Jun 18 17:23:38 2011 Tanaka Akira + + * eval.c, hash.c, load.c, proc.c, range.c, thread.c, time.c: don't + declare internal functions. + + * internal.h, vm_core.h: declare internal functions. + + * array.c: include internal.h. + + * common.mk: update dependency for array.o. + Sat Jun 18 13:39:33 2011 Tanaka Akira * internal.h: declarations declared in include/ruby/*.h removed. diff --git a/array.c b/array.c index c58f88f66b..5fb0c64cb3 100644 --- a/array.c +++ b/array.c @@ -15,6 +15,7 @@ #include "ruby/util.h" #include "ruby/st.h" #include "ruby/encoding.h" +#include "internal.h" #ifndef ARRAY_DEBUG # define NDEBUG diff --git a/common.mk b/common.mk index dc1a8a32f4..20bc23befb 100644 --- a/common.mk +++ b/common.mk @@ -584,7 +584,7 @@ VM_CORE_H_INCLUDES = {$(VPATH)}vm_core.h {$(VPATH)}thread_$(THREAD_MODEL).h \ $(ID_H_INCLUDES) array.$(OBJEXT): {$(VPATH)}array.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \ - $(ENCODING_H_INCLUDES) + $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h bignum.$(OBJEXT): {$(VPATH)}bignum.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \ {$(VPATH)}internal.h class.$(OBJEXT): {$(VPATH)}class.c $(RUBY_H_INCLUDES) \ diff --git a/eval.c b/eval.c index 21eb02e7a9..b4516e36cd 100644 --- a/eval.c +++ b/eval.c @@ -115,8 +115,6 @@ ruby_cleanup(volatile int ex) volatile VALUE errs[2]; rb_thread_t *th = GET_THREAD(); int nerr; - void rb_threadptr_interrupt(rb_thread_t *th); - void rb_threadptr_check_signal(rb_thread_t *mth); rb_threadptr_interrupt(th); rb_threadptr_check_signal(th); diff --git a/hash.c b/hash.c index aa038a7147..2045a536c1 100644 --- a/hash.c +++ b/hash.c @@ -510,7 +510,6 @@ rb_hash_aref(VALUE hash, VALUE key) st_data_t val; if (!RHASH(hash)->ntbl || !st_lookup(RHASH(hash)->ntbl, key, &val)) { - int rb_method_basic_definition_p(VALUE klass, ID id); if (!FL_TEST(hash, HASH_PROC_DEFAULT) && rb_method_basic_definition_p(CLASS_OF(hash), id_default)) { return RHASH_IFNONE(hash); diff --git a/internal.h b/internal.h index 3a80460b9e..c242f450e3 100644 --- a/internal.h +++ b/internal.h @@ -39,6 +39,9 @@ struct rb_classext_struct { struct vtm; /* defined by timev.h */ +/* array.c */ +VALUE rb_ary_last(int, VALUE *, VALUE); + /* bignum.c */ VALUE rb_big_fdiv(VALUE x, VALUE y); VALUE rb_big_uminus(VALUE x); @@ -123,6 +126,9 @@ VALUE rb_obj_equal(VALUE obj1, VALUE obj2); VALUE rb_parser_get_yydebug(VALUE); VALUE rb_parser_set_yydebug(VALUE, VALUE); +/* proc.c */ +VALUE rb_proc_location(VALUE self); + /* rational.c */ VALUE rb_lcm(VALUE x, VALUE y); @@ -173,6 +179,7 @@ void rb_vm_bugreport(void); /* vm_eval.c */ void Init_vm_eval(void); +VALUE rb_current_realfilepath(void); /* vm_method.c */ void Init_eval_method(void); diff --git a/load.c b/load.c index 5d9d293273..b819bf37f9 100644 --- a/load.c +++ b/load.c @@ -467,7 +467,6 @@ rb_f_require(VALUE obj, VALUE fname) VALUE rb_f_require_relative(VALUE obj, VALUE fname) { - VALUE rb_current_realfilepath(void); VALUE base = rb_current_realfilepath(); if (NIL_P(base)) { rb_raise(rb_eLoadError, "cannot infer basepath"); diff --git a/proc.c b/proc.c index ebcd794e80..d8077e7ef4 100644 --- a/proc.c +++ b/proc.c @@ -1421,8 +1421,6 @@ rb_method_call(int argc, VALUE *argv, VALUE method) } if ((state = EXEC_TAG()) == 0) { rb_thread_t *th = GET_THREAD(); - VALUE rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc, const VALUE *argv, - const rb_method_entry_t *me); PASS_PASSED_BLOCK_TH(th); result = rb_vm_call(th, data->recv, data->id, argc, argv, &data->me); diff --git a/range.c b/range.c index 8a77add7d7..083c70a165 100644 --- a/range.c +++ b/range.c @@ -600,8 +600,6 @@ range_first(int argc, VALUE *argv, VALUE range) static VALUE range_last(int argc, VALUE *argv, VALUE range) { - VALUE rb_ary_last(int, VALUE *, VALUE); - if (argc == 0) return RANGE_END(range); return rb_ary_last(argc, argv, rb_Array(range)); } diff --git a/thread.c b/thread.c index 1825d8d825..9324371d16 100644 --- a/thread.c +++ b/thread.c @@ -613,7 +613,6 @@ thread_initialize(VALUE thread, VALUE args) } GetThreadPtr(thread, th); if (th->first_args) { - VALUE rb_proc_location(VALUE self); VALUE proc = th->first_proc, line, loc; const char *file; if (!proc || !RTEST(loc = rb_proc_location(proc))) { diff --git a/time.c b/time.c index 5e69ff5dbb..5dbf9b22ca 100644 --- a/time.c +++ b/time.c @@ -4519,7 +4519,6 @@ strftimev(const char *fmt, VALUE time) static VALUE time_strftime(VALUE time, VALUE format) { - void rb_enc_copy(VALUE, VALUE); struct time_object *tobj; char buffer[SMALLBUF], *buf = buffer; const char *fmt; diff --git a/vm_core.h b/vm_core.h index 94025b953c..ea58f3b17f 100644 --- a/vm_core.h +++ b/vm_core.h @@ -647,6 +647,8 @@ VALUE rb_vm_make_proc(rb_thread_t *th, const rb_block_t *block, VALUE klass); VALUE rb_vm_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp); void rb_vm_inc_const_missing_count(void); void rb_vm_gvl_destroy(rb_vm_t *vm); +VALUE rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc, + const VALUE *argv, const rb_method_entry_t *me); void rb_thread_start_timer_thread(void); void rb_thread_stop_timer_thread(void); @@ -698,6 +700,7 @@ void rb_threadptr_check_signal(rb_thread_t *mth); void rb_threadptr_signal_raise(rb_thread_t *th, int sig); void rb_threadptr_signal_exit(rb_thread_t *th); void rb_threadptr_execute_interrupts(rb_thread_t *); +void rb_threadptr_interrupt(rb_thread_t *th); void rb_thread_lock_unlock(rb_thread_lock_t *); void rb_thread_lock_destroy(rb_thread_lock_t *);