Skip to content

Commit

Permalink
* eval.c, hash.c, load.c, proc.c, range.c, thread.c, time.c: don't
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
akr committed Jun 18, 2011
1 parent bc46292 commit 5ed8c08
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 11 deletions.
11 changes: 11 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Sat Jun 18 17:23:38 2011 Tanaka Akira <[email protected]>

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

* internal.h: declarations declared in include/ruby/*.h removed.
Expand Down
1 change: 1 addition & 0 deletions array.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "ruby/util.h"
#include "ruby/st.h"
#include "ruby/encoding.h"
#include "internal.h"

#ifndef ARRAY_DEBUG
# define NDEBUG
Expand Down
2 changes: 1 addition & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
2 changes: 0 additions & 2 deletions eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion load.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 0 additions & 2 deletions proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions range.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
1 change: 0 additions & 1 deletion thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down
1 change: 0 additions & 1 deletion time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions vm_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 *);
Expand Down

0 comments on commit 5ed8c08

Please sign in to comment.