Skip to content

Commit

Permalink
* internal.h: declare more internal functions.
Browse files Browse the repository at this point in the history
* iseq.h (rb_method_get_iseq): declared.

* compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c,
  ruby.c, time.c, util.c, vm.c: don't declare internal functions.

* eval.c, parse.y, thread_pthread.c: non-existing function declarations
  removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed Jun 18, 2011
1 parent c657586 commit afd7e46
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 29 deletions.
12 changes: 12 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
Sat Jun 18 10:22:39 2011 Tanaka Akira <[email protected]>

* internal.h: declare more internal functions.

* iseq.h (rb_method_get_iseq): declared.

* compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c,
ruby.c, time.c, util.c, vm.c: don't declare internal functions.

* eval.c, parse.y, thread_pthread.c: non-existing function declarations
removed.

Sat Jun 18 08:12:54 2011 Tanaka Akira <[email protected]>

* common.mk: dependencies updated.
Expand Down
2 changes: 0 additions & 2 deletions compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ struct iseq_compile_data_ensure_node_stack {
#define compile_debug iseq->compile_data->option->debug_level
#endif

NORETURN(PRINTF_ARGS(void rb_compile_bug(const char*, int, const char*, ...), 3, 4));

#if CPDEBUG

#define compile_debug_print_indent(level) \
Expand Down
3 changes: 0 additions & 3 deletions eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@

#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))

VALUE proc_invoke(VALUE, VALUE, VALUE, VALUE);
VALUE rb_binding_new(void);
NORETURN(void rb_raise_jump(VALUE));

ID rb_frame_callee(void);
VALUE rb_eLocalJumpError;
VALUE rb_eSysStackError;

Expand Down
2 changes: 0 additions & 2 deletions eval_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ error_pos(void)
}
}

VALUE rb_check_backtrace(VALUE);

static VALUE
get_backtrace(VALUE info)
{
Expand Down
16 changes: 16 additions & 0 deletions internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ struct rb_classext_struct {
struct st_table *const_tbl;
};

struct vtm; /* defined by timev.h */

/* bignum.c */
VALUE rb_big_fdiv(VALUE x, VALUE y);
VALUE rb_big_uminus(VALUE x);
Expand All @@ -40,6 +42,7 @@ int rb_dvar_defined(ID);
int rb_local_defined(ID);
int rb_parse_in_eval(void);
int rb_parse_in_main(void);
VALUE rb_insns_name_array(void);

/* debug.c */
PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
Expand All @@ -53,10 +56,19 @@ ID rb_id_encoding(void);
/* encoding.c */
void rb_gc_mark_encodings(void);

/* error.c */
NORETURN(PRINTF_ARGS(void rb_compile_bug(const char*, int, const char*, ...), 3, 4));
VALUE rb_check_backtrace(VALUE);

/* eval.c */
ID rb_frame_callee(void);

/* file.c */
VALUE rb_home_dir(const char *user, VALUE result);
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
void Init_File(void);
const char *ruby_find_basename(const char *, long *, long *);
const char *ruby_find_extname(const char *, long *);

/* gc.c */
void Init_heap(void);
Expand Down Expand Up @@ -88,6 +100,7 @@ void Init_newline(void);
/* numeric.c */
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);

/* parse.y */
VALUE rb_parser_get_yydebug(VALUE);
Expand All @@ -103,6 +116,9 @@ VALUE rb_reg_check_preprocess(VALUE);
/* signal.c */
int rb_get_next_signal(void);

/* strftime.c */
size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, const struct vtm *vtm, struct timespec *ts, int gmt);

/* string.c */
int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);

Expand Down
1 change: 0 additions & 1 deletion iseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,6 @@ iseq_s_disasm(VALUE klass, VALUE body)
{
VALUE ret = Qnil;
rb_iseq_t *iseq;
extern rb_iseq_t *rb_method_get_iseq(VALUE body);

rb_secure(1);

Expand Down
3 changes: 3 additions & 0 deletions iseq.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
struct st_table *ruby_insn_make_insn_table(void);

/* proc.c */
rb_iseq_t *rb_method_get_iseq(VALUE body);

struct rb_compile_option_struct {
int inline_const_cache;
int peephole_optimization;
Expand Down
5 changes: 0 additions & 5 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -10107,9 +10107,6 @@ static const rb_data_type_t parser_data_type = {
},
};

VALUE rb_parser_get_yydebug(VALUE);
VALUE rb_parser_set_yydebug(VALUE, VALUE);

#ifndef RIPPER
#undef rb_reserved_word

Expand Down Expand Up @@ -10584,8 +10581,6 @@ ripper_initialize(int argc, VALUE *argv, VALUE self)
return Qnil;
}

extern VALUE rb_thread_pass(void);

struct ripper_args {
struct parser_params *parser;
int argc;
Expand Down
1 change: 0 additions & 1 deletion proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ VALUE rb_cProc;

static VALUE bmcall(VALUE, VALUE);
static int method_arity(VALUE);
rb_iseq_t *rb_method_get_iseq(VALUE method);

/* Proc */

Expand Down
2 changes: 0 additions & 2 deletions range.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ step_i(VALUE i, void *arg)
return Qnil;
}

extern int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl);

static int
discrete_object_p(VALUE obj)
{
Expand Down
2 changes: 0 additions & 2 deletions ruby.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ usage(const char *name)
printf(" %s\n", *p++);
}

VALUE rb_get_load_path(void);

#ifdef MANGLED_PATH
static VALUE
rubylib_mangled_path(const char *s, unsigned int l)
Expand Down
1 change: 0 additions & 1 deletion thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ thread_cleanup_func(void *th_ptr, int atfork)
native_thread_destroy(th);
}

extern void ruby_error_print(void);
static VALUE rb_threadptr_raise(rb_thread_t *, int, VALUE *);

void
Expand Down
2 changes: 0 additions & 2 deletions thread_pthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,6 @@ thread_start_func_1(void *th_ptr)
return 0;
}

void rb_thread_create_control_thread(void);

struct cached_thread_entry {
volatile rb_thread_t **th_area;
pthread_cond_t *cond;
Expand Down
3 changes: 0 additions & 3 deletions time.c
Original file line number Diff line number Diff line change
Expand Up @@ -4285,9 +4285,6 @@ rb_strftime(char *s, size_t maxsize, const char *format,
const struct vtm *vtm, VALUE timev,
int gmt);

size_t
rb_strftime_timespec(char *s, size_t maxsize, const char *format, const struct vtm *vtm, struct timespec *ts, int gmt);

#define SMALLBUF 100
static size_t
rb_strftime_alloc(char **buf, const char *format,
Expand Down
4 changes: 1 addition & 3 deletions util.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 <ctype.h>
#include <stdio.h>
Expand Down Expand Up @@ -261,9 +262,6 @@ static const char suffix2[] = ".~~~";

#define strEQ(s1,s2) (strcmp((s1),(s2)) == 0)

extern const char *ruby_find_basename(const char *, long *, long *);
extern const char *ruby_find_extname(const char *, long *);

void
ruby_add_suffix(VALUE str, const char *suffix)
{
Expand Down
2 changes: 0 additions & 2 deletions vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ rb_vm_t *ruby_current_vm = 0;

static void thread_free(void *ptr);

VALUE rb_insns_name_array(void);

void vm_analysis_operand(int insn, int n, VALUE op);
void vm_analysis_register(int reg, int isset);
void vm_analysis_insn(int insn);
Expand Down

0 comments on commit afd7e46

Please sign in to comment.