Skip to content

Commit

Permalink
* internal.h: declare internal functions here.
Browse files Browse the repository at this point in the history
* node.h: declare NODE dependent internal functions here.

* iseq.h: declare rb_iseq_t dependent internal functions here.

* vm_core.h: declare rb_thread_t dependent internal functions here.

* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
  enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
  iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
  proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
  thread.c, time.c, transcode.c, variable.c, vm.c,
  tool/compile_prelude.rb: don't declare internal functions declared
  in above headers.  include above headers if required.

  Note that rb_thread_mark() was declared as
  void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
  void rb_thread_mark(void *ptr) in vm.c.  Now it is declared as
  the later in internal.h.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed Jun 17, 2011
1 parent aba879a commit e7996eb
Show file tree
Hide file tree
Showing 40 changed files with 172 additions and 126 deletions.
23 changes: 23 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
Sat Jun 18 07:27:27 2011 Tanaka Akira <[email protected]>

* internal.h: declare internal functions here.

* node.h: declare NODE dependent internal functions here.

* iseq.h: declare rb_iseq_t dependent internal functions here.

* vm_core.h: declare rb_thread_t dependent internal functions here.

* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.

Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.

Sat Jun 18 02:36:00 2011 Kenta Murata <[email protected]>

* ext/bigdecimal/bigdecimal.c (VpNewRbClass): fix type of the 2nd
Expand Down
1 change: 1 addition & 0 deletions bignum.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "ruby/ruby.h"
#include "ruby/util.h"
#include "internal.h"

#include <math.h>
#include <float.h>
Expand Down
2 changes: 0 additions & 2 deletions class.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ rb_class_new(VALUE super)
return rb_class_boot(super);
}

VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);

static void
rb_mod_clone_method(VALUE klass, ID mid, const rb_method_entry_t *me)
{
Expand Down
2 changes: 1 addition & 1 deletion compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
**********************************************************************/

#include "ruby/ruby.h"
#include "internal.h"
#include <math.h>

#define USE_INSN_STACK_INCREASE 1
Expand Down Expand Up @@ -155,7 +156,6 @@ r_value(VALUE value)
#endif

#if CPDEBUG > 1 || CPDEBUG < 0
PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
#define debugs if (compile_debug_print_indent(1)) ruby_debug_printf
#define debug_compile(msg, v) ((void)(compile_debug_print_indent(1) && fputs((msg), stderr)), (v))
#else
Expand Down
5 changes: 1 addition & 4 deletions complex.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include "ruby.h"
#include "internal.h"
#include <math.h>

#define NDEBUG
Expand Down Expand Up @@ -508,8 +509,6 @@ imp2(hypot)

#define m_hypot(x,y) m_hypot_bang((x),(y))

extern VALUE rb_math_log(int argc, VALUE *argv);

static VALUE
m_log_bang(VALUE x)
{
Expand Down Expand Up @@ -1092,8 +1091,6 @@ nucomp_inexact_p(VALUE self)
}
#endif

extern VALUE rb_lcm(VALUE x, VALUE y);

/*
* call-seq:
* cmp.denominator -> integer
Expand Down
4 changes: 1 addition & 3 deletions cont.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
**********************************************************************/

#include "ruby/ruby.h"
#include "internal.h"
#include "vm_core.h"
#include "gc.h"
#include "eval_intern.h"
Expand Down Expand Up @@ -126,7 +127,6 @@ static VALUE rb_eFiberError;

NOINLINE(static VALUE cont_capture(volatile int *stat));

void rb_thread_mark(rb_thread_t *th);
#define THREAD_MUST_BE_RUNNING(th) do { \
if (!(th)->tag) rb_raise(rb_eThreadError, "not running thread"); \
} while (0)
Expand Down Expand Up @@ -409,8 +409,6 @@ cont_new(VALUE klass)
return cont;
}

void rb_vm_stack_to_heap(rb_thread_t *th);

static VALUE
cont_capture(volatile int *stat)
{
Expand Down
3 changes: 1 addition & 2 deletions dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include "ruby/ruby.h"
#include "ruby/encoding.h"
#include "internal.h"

#include <sys/types.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -1996,8 +1997,6 @@ file_s_fnmatch(int argc, VALUE *argv, VALUE obj)
return Qfalse;
}

VALUE rb_home_dir(const char *user, VALUE result);

/*
* call-seq:
* Dir.home() -> "/home/me"
Expand Down
1 change: 1 addition & 0 deletions encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "ruby/ruby.h"
#include "ruby/encoding.h"
#include "internal.h"
#include "regenc.h"
#include <ctype.h>
#ifndef NO_LOCALE_CHARMAP
Expand Down
2 changes: 0 additions & 2 deletions enumerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,8 +1018,6 @@ generator_init(VALUE obj, VALUE proc)
return obj;
}

VALUE rb_obj_is_proc(VALUE proc);

/* :nodoc: */
static VALUE
generator_initialize(int argc, VALUE *argv, VALUE obj)
Expand Down
3 changes: 1 addition & 2 deletions error.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "ruby/ruby.h"
#include "ruby/st.h"
#include "ruby/encoding.h"
#include "internal.h"
#include "vm_core.h"

#include <stdio.h>
Expand Down Expand Up @@ -230,8 +231,6 @@ rb_warn_m(VALUE self, VALUE mesg)
return Qnil;
}

void rb_vm_bugreport(void);

static void
report_bug(const char *file, int line, const char *fmt, va_list args)
{
Expand Down
12 changes: 1 addition & 11 deletions eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "gc.h"
#include "ruby/vm.h"
#include "ruby/encoding.h"
#include "internal.h"
#include "vm_core.h"

#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
Expand All @@ -35,12 +36,6 @@ VALUE rb_eSysStackError;

/* initialize ruby */

void rb_clear_trace_func(void);

void rb_call_inits(void);
void Init_heap(void);
void Init_BareVM(void);

void
ruby_init(void)
{
Expand Down Expand Up @@ -69,8 +64,6 @@ ruby_init(void)
GET_VM()->running = 1;
}

extern void rb_clear_trace_func(void);

void *
ruby_options(int argc, char **argv)
{
Expand Down Expand Up @@ -1053,9 +1046,6 @@ top_include(int argc, VALUE *argv, VALUE self)
return rb_mod_include(argc, argv, rb_cObject);
}

VALUE rb_f_trace_var();
VALUE rb_f_untrace_var();

static VALUE *
errinfo_place(rb_thread_t *th)
{
Expand Down
5 changes: 1 addition & 4 deletions file.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "ruby/io.h"
#include "ruby/util.h"
#include "dln.h"
#include "internal.h"

#ifdef HAVE_UNISTD_H
#include <unistd.h>
Expand Down Expand Up @@ -2203,8 +2204,6 @@ rb_file_s_lchown(int argc, VALUE *argv)
#define rb_file_s_lchown rb_f_notimplement
#endif

struct timespec rb_time_timespec(VALUE time);

struct utime_args {
const struct timespec* tsp;
VALUE atime, mtime;
Expand Down Expand Up @@ -5088,8 +5087,6 @@ is_explicit_relative(const char *path)
return isdirsep(*path);
}

VALUE rb_get_load_path(void);

static VALUE
copy_path_class(VALUE path, VALUE orig)
{
Expand Down
6 changes: 0 additions & 6 deletions gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) /* empty */
#endif

int rb_io_fptr_finalize(struct rb_io_t*);

#define rb_setjmp(env) RUBY_SETJMP(env)
#define rb_jmp_buf rb_jmpbuf_t

Expand Down Expand Up @@ -2364,8 +2362,6 @@ obj_free(rb_objspace_t *objspace, VALUE obj)

#define GC_NOTIFY 0

void rb_vm_mark(void *ptr);

#if STACK_GROW_DIRECTION < 0
#define GET_STACK_BOUNDS(start, end, appendix) ((start) = STACK_END, (end) = STACK_START)
#elif STACK_GROW_DIRECTION > 0
Expand Down Expand Up @@ -2406,8 +2402,6 @@ mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th)
#endif
}

void rb_gc_mark_encodings(void);

static void
gc_clear_mark_on_sweep_slots(rb_objspace_t *objspace)
{
Expand Down
2 changes: 0 additions & 2 deletions hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,6 @@ rb_hash_default_proc(VALUE hash)
return Qnil;
}

VALUE rb_obj_is_proc(VALUE proc);

/*
* call-seq:
* hsh.default_proc = proc_obj -> proc_obj
Expand Down
1 change: 1 addition & 0 deletions inits.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
**********************************************************************/

#include "ruby/ruby.h"
#include "internal.h"

#define CALL(n) {void Init_##n(void); Init_##n();}

Expand Down
Loading

0 comments on commit e7996eb

Please sign in to comment.