[前][次][番号順一覧][スレッド一覧]

ruby-changes:20115

From: akr <ko1@a...>
Date: Sat, 18 Jun 2011 12:51:45 +0900 (JST)
Subject: [ruby-changes:20115] akr:r32163 (trunk): * method.h, internal.h iseq.h: declare internal functions.

akr	2011-06-18 12:49:33 +0900 (Sat, 18 Jun 2011)

  New Revision: 32163

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32163

  Log:
    * method.h, internal.h iseq.h: declare internal functions.
    
    * compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
      thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
      declare internal functions.
    
      Note that rb_method_entry_eq() is defined in vm_method.c but
      there was a declaration in proc.c with different const-ness.
      Now it is declared in method.h with same const-ness to the
      definition.
    
    * object.c (rb_mod_module_exec): don't declare functions declared in
      include/ruby/intern.h.

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
    trunk/eval.c
    trunk/internal.h
    trunk/iseq.c
    trunk/iseq.h
    trunk/method.h
    trunk/object.c
    trunk/parse.y
    trunk/proc.c
    trunk/process.c
    trunk/thread.c
    trunk/vm.c
    trunk/vm_eval.c
    trunk/vm_insnhelper.c
    trunk/vm_method.c

Index: method.h
===================================================================
--- method.h	(revision 32162)
+++ method.h	(revision 32163)
@@ -95,6 +95,7 @@
 rb_method_entry_t *rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_flag_t noex);
 
 int rb_method_entry_arity(const rb_method_entry_t *me);
+int rb_method_entry_eq(const rb_method_entry_t *m1, const rb_method_entry_t *m2);
 
 void rb_mark_method_entry(const rb_method_entry_t *me);
 void rb_free_method_entry(rb_method_entry_t *me);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 32162)
+++ ChangeLog	(revision 32163)
@@ -1,3 +1,19 @@
+Sat Jun 18 12:42:17 2011  Tanaka Akira  <akr@f...>
+
+	* method.h, internal.h iseq.h: declare internal functions.
+
+	* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
+	  thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
+	  declare internal functions.
+
+	  Note that rb_method_entry_eq() is defined in vm_method.c but
+	  there was a declaration in proc.c with different const-ness.
+	  Now it is declared in method.h with same const-ness to the
+	  definition.
+
+	* object.c (rb_mod_module_exec): don't declare functions declared in
+	  include/ruby/intern.h.
+	  
 Sat Jun 18 12:05:08 2011  Nobuyoshi Nakada  <nobu@r...>
 
 	* include/ruby/backward/classext.h: for evil gems.  fixed #4803
Index: iseq.c
===================================================================
--- iseq.c	(revision 32162)
+++ iseq.c	(revision 32163)
@@ -271,7 +271,6 @@
 
     iseq->coverage = Qfalse;
     if (!GET_THREAD()->parse_in_eval) {
-	extern VALUE rb_get_coverages(void);
 	VALUE coverages = rb_get_coverages();
 	if (RTEST(coverages)) {
 	    iseq->coverage = rb_hash_lookup(coverages, filename);
Index: object.c
===================================================================
--- object.c	(revision 32162)
+++ object.c	(revision 32163)
@@ -426,8 +426,6 @@
 static VALUE
 rb_obj_inspect(VALUE obj)
 {
-    extern int rb_obj_basic_to_s_p(VALUE);
-
     if (TYPE(obj) == T_OBJECT && rb_obj_basic_to_s_p(obj)) {
         int has_ivar = 0;
         VALUE *ptr = ROBJECT_IVPTR(obj);
@@ -1499,8 +1497,6 @@
 static VALUE
 rb_mod_initialize(VALUE module)
 {
-    extern VALUE rb_mod_module_exec(int argc, VALUE *argv, VALUE mod);
-
     if (rb_block_given_p()) {
 	rb_mod_module_exec(1, &module, module);
     }
@@ -2579,7 +2575,6 @@
 void
 Init_Object(void)
 {
-    extern void Init_class_hierarchy(void);
     int i;
 
     Init_class_hierarchy();
Index: iseq.h
===================================================================
--- iseq.h	(revision 32162)
+++ iseq.h	(revision 32163)
@@ -29,6 +29,7 @@
 
 /* proc.c */
 rb_iseq_t *rb_method_get_iseq(VALUE body);
+rb_iseq_t *rb_proc_get_iseq(VALUE proc, int *is_proc);
 
 struct rb_compile_option_struct {
     int inline_const_cache;
Index: compile.c
===================================================================
--- compile.c	(revision 32162)
+++ compile.c	(revision 32163)
@@ -537,7 +537,6 @@
 rb_iseq_translate_threaded_code(rb_iseq_t *iseq)
 {
 #if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
-    extern const void **rb_vm_get_insns_address_table(void);
     const void * const *table = rb_vm_get_insns_address_table();
     unsigned long i;
 
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 32162)
+++ vm_eval.c	(revision 32163)
@@ -1038,7 +1038,6 @@
 	    VALUE errinfo = th->errinfo;
 	    if (strcmp(file, "(eval)") == 0) {
 		VALUE mesg, errat, bt2;
-		extern VALUE rb_get_backtrace(VALUE info);
 		ID id_mesg;
 
 		CONST_ID(id_mesg, "mesg");
Index: proc.c
===================================================================
--- proc.c	(revision 32162)
+++ proc.c	(revision 32163)
@@ -1022,7 +1022,6 @@
 method_eq(VALUE method, VALUE other)
 {
     struct METHOD *m1, *m2;
-    extern int rb_method_entry_eq(rb_method_entry_t *m1, rb_method_entry_t *m2);
 
     if (!rb_obj_is_method(other))
 	return Qfalse;
Index: thread.c
===================================================================
--- thread.c	(revision 32162)
+++ thread.c	(revision 32163)
@@ -3025,7 +3025,6 @@
 static void
 clear_coverage(void)
 {
-    extern VALUE rb_get_coverages(void);
     VALUE coverages = rb_get_coverages();
     if (RTEST(coverages)) {
 	st_foreach(RHASH_TBL(coverages), clear_coverage_i, 0);
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 32162)
+++ vm_method.c	(revision 32163)
@@ -1,5 +1,5 @@
 /*
- * This file is included by vm.h
+ * This file is included by vm.c
  */
 
 #define CACHE_SIZE 0x800
@@ -188,7 +188,6 @@
 	    old_def->alias_count == 0 &&
 	    old_def->type != VM_METHOD_TYPE_UNDEF &&
 	    old_def->type != VM_METHOD_TYPE_ZSUPER) {
-	    extern rb_iseq_t *rb_proc_get_iseq(VALUE proc, int *is_proc);
 	    rb_iseq_t *iseq = 0;
 
 	    rb_warning("method redefined; discarding old %s", rb_id2name(mid));
Index: eval.c
===================================================================
--- eval.c	(revision 32162)
+++ eval.c	(revision 32163)
@@ -1196,12 +1196,8 @@
 
     rb_undef_method(rb_cClass, "module_function");
 
-    {
-	extern void Init_vm_eval(void);
-	extern void Init_eval_method(void);
-	Init_vm_eval();
-	Init_eval_method();
-    }
+    Init_vm_eval();
+    Init_eval_method();
 
     rb_define_singleton_method(rb_cModule, "nesting", rb_mod_nesting, 0);
     rb_define_singleton_method(rb_cModule, "constants", rb_mod_s_constants, -1);
Index: parse.y
===================================================================
--- parse.y	(revision 32162)
+++ parse.y	(revision 32163)
@@ -5111,7 +5111,6 @@
 static VALUE
 coverage(const char *f, int n)
 {
-    extern VALUE rb_get_coverages(void);
     VALUE coverages = rb_get_coverages();
     if (RTEST(coverages) && RBASIC(coverages)->klass == 0) {
 	VALUE fname = rb_str_new2(f);
Index: process.c
===================================================================
--- process.c	(revision 32162)
+++ process.c	(revision 32163)
@@ -2919,8 +2919,6 @@
 VALUE
 rb_f_abort(int argc, VALUE *argv)
 {
-    extern void ruby_error_print(void);
-
     rb_secure(4);
     if (argc == 0) {
 	if (!NIL_P(GET_THREAD()->errinfo)) {
Index: internal.h
===================================================================
--- internal.h	(revision 32162)
+++ internal.h	(revision 32163)
@@ -48,6 +48,8 @@
 VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj);
 VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj);
 VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj);
+int rb_obj_basic_to_s_p(VALUE);
+extern void Init_class_hierarchy(void);
 
 /* compile.c */
 int rb_dvar_defined(ID);
@@ -75,6 +77,13 @@
 /* eval.c */
 ID rb_frame_callee(void);
 
+/* eval_error.c */
+void ruby_error_print(void);
+VALUE rb_get_backtrace(VALUE info);
+
+/* eval_jump.c */
+void rb_call_end_proc(VALUE data);
+
 /* file.c */
 VALUE rb_home_dir(const char *user, VALUE result);
 VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
@@ -114,6 +123,9 @@
 int rb_num_to_uint(VALUE val, unsigned int *ret);
 int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl);
 
+/* object.c */
+VALUE rb_obj_equal(VALUE obj1, VALUE obj2);
+
 /* parse.y */
 VALUE rb_parser_get_yydebug(VALUE);
 VALUE rb_parser_set_yydebug(VALUE, VALUE);
@@ -149,6 +161,7 @@
 void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
 void rb_clear_trace_func(void);
 VALUE rb_thread_backtrace(VALUE thval);
+VALUE rb_get_coverages(void);
 
 /* thread_pthread.c, thread_win32.c */
 void Init_native_thread(void);
@@ -166,13 +179,18 @@
 void rb_vm_change_state(void);
 void rb_vm_inc_const_missing_count(void);
 void rb_thread_mark(void *th);
+const void **rb_vm_get_insns_address_table(void);
 
 /* vm_dump.c */
 void rb_vm_bugreport(void);
 
 /* vm_eval.c */
 VALUE rb_funcall_passing_block(VALUE recv, ID mid, int argc, const VALUE *argv);
+void Init_vm_eval(void);
 
+/* vm_method.c */
+void Init_eval_method(void);
+
 /* miniprelude.c, prelude.c */
 void Init_prelude(void);
 
Index: vm.c
===================================================================
--- vm.c	(revision 32162)
+++ vm.c	(revision 32163)
@@ -1967,7 +1967,6 @@
 	rb_thread_t *th = GET_THREAD();
 	rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp);
 	VALUE proc;
-	extern void rb_call_end_proc(VALUE data);
 
 	GetISeqPtr(iseqval, blockiseq);
 
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 32162)
+++ vm_insnhelper.c	(revision 32163)
@@ -1699,7 +1699,6 @@
 
     {
 	const rb_method_entry_t *me = vm_method_search(idEq, CLASS_OF(recv), ic);
-	extern VALUE rb_obj_equal(VALUE obj1, VALUE obj2);
 
 	if (check_cfunc(me, rb_obj_equal)) {
 	    return recv == obj ? Qtrue : Qfalse;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]