Skip to content
Browse files

* 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.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 19f3866 commit 7da3ea811e71bcf2445fe63608b15645ef205240 @akr akr committed Jun 18, 2011
Showing with 39 additions and 23 deletions.
  1. +16 −0 ChangeLog
  2. +0 −1 compile.c
  3. +2 −6 eval.c
  4. +18 −0 internal.h
  5. +0 −1 iseq.c
  6. +1 −0 iseq.h
  7. +1 −0 method.h
  8. +0 −5 object.c
  9. +0 −1 parse.y
  10. +0 −1 proc.c
  11. +0 −2 process.c
  12. +0 −1 thread.c
  13. +0 −1 vm.c
  14. +0 −1 vm_eval.c
  15. +0 −1 vm_insnhelper.c
  16. +1 −2 vm_method.c
View
16 ChangeLog
@@ -1,3 +1,19 @@
+Sat Jun 18 12:42:17 2011 Tanaka Akira <akr@fsij.org>
+
+ * 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@ruby-lang.org>
* include/ruby/backward/classext.h: for evil gems. fixed #4803
View
1 compile.c
@@ -537,7 +537,6 @@ int
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;
View
8 eval.c
@@ -1196,12 +1196,8 @@ Init_eval(void)
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);
View
18 internal.h
@@ -48,6 +48,8 @@ VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj);
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 @@ VALUE rb_check_backtrace(VALUE);
/* 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 @@ VALUE rb_rational_reciprocal(VALUE x);
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_execute_interrupts(VALUE th);
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,12 +179,17 @@ void rb_thread_recycle_stack_release(VALUE *);
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);
View
1 iseq.c
@@ -271,7 +271,6 @@ prepare_iseq_build(rb_iseq_t *iseq,
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);
View
1 iseq.h
@@ -29,6 +29,7 @@ struct st_table *ruby_insn_make_insn_table(void);
/* 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;
View
1 method.h
@@ -95,6 +95,7 @@ rb_method_entry_t *rb_method_entry_get_without_cache(VALUE klass, ID id);
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);
View
5 object.c
@@ -426,8 +426,6 @@ inspect_obj(VALUE obj, VALUE str, int recur)
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 @@ rb_class_s_alloc(VALUE klass)
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 @@ rb_f_array(VALUE obj, VALUE arg)
void
Init_Object(void)
{
- extern void Init_class_hierarchy(void);
int i;
Init_class_hierarchy();
View
1 parse.y
@@ -5111,7 +5111,6 @@ debug_lines(const char *f)
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);
View
1 proc.c
@@ -1022,7 +1022,6 @@ static VALUE
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;
View
2 process.c
@@ -2919,8 +2919,6 @@ rb_f_exit(int argc, VALUE *argv)
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)) {
View
1 thread.c
@@ -3025,7 +3025,6 @@ clear_coverage_i(st_data_t key, st_data_t val, st_data_t dummy)
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);
View
1 vm.c
@@ -1967,7 +1967,6 @@ m_core_set_postexe(VALUE self, VALUE iseqval)
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);
View
1 vm_eval.c
@@ -1038,7 +1038,6 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
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");
View
1 vm_insnhelper.c
@@ -1699,7 +1699,6 @@ opt_eq_func(VALUE recv, VALUE obj, IC ic)
{
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;
View
3 vm_method.c
@@ -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 @@ rb_method_entry_make(VALUE klass, ID mid, rb_method_type_t type,
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));

0 comments on commit 7da3ea8

Please sign in to comment.
Something went wrong with that request. Please try again.