From 1f84a162df294e01452ca369cf3745903effa7c3 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 13 Aug 2006 09:44:16 +0000 Subject: ansificated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- dir.c | 3 +-- dln.c | 74 +++++++++++++++------------------------------------------------ eval.c | 13 ++++------- gc.c | 3 +-- object.c | 3 +-- process.c | 18 +++++----------- 6 files changed, 29 insertions(+), 85 deletions(-) diff --git a/dir.c b/dir.c index cdca612783..3a8eb61b1c 100644 --- a/dir.c +++ b/dir.c @@ -102,8 +102,7 @@ char *strchr(char*,char); #elif defined(__EMX__) # define Next(p) ((p) + emx_mblen(p)) static inline int -emx_mblen(p) - const char *p; +emx_mblen(const char *p) { int n = mblen(p, RUBY_MBCHAR_MAXSIZE); return (n < 0) ? 1 : n; diff --git a/dln.c b/dln.c index 49a950119c..221e1a1f2e 100644 --- a/dln.c +++ b/dln.c @@ -182,10 +182,7 @@ static st_table *undef_tbl; static int load_lib(); static int -load_header(fd, hdrp, disp) - int fd; - struct exec *hdrp; - long disp; +load_header(int fd, struct exec *hdrp, long disp) { int size; @@ -255,10 +252,7 @@ static int reloc_r_length[] = { #endif static struct relocation_info * -load_reloc(fd, hdrp, disp) - int fd; - struct exec *hdrp; - long disp; +load_reloc(int fd, struct exec *hdrp, long disp) { struct relocation_info *reloc; int size; @@ -281,10 +275,7 @@ load_reloc(fd, hdrp, disp) } static struct nlist * -load_sym(fd, hdrp, disp) - int fd; - struct exec *hdrp; - long disp; +load_sym(int fd, struct exec *hdrp, long disp) { struct nlist * buffer; struct nlist * sym; @@ -325,9 +316,7 @@ load_sym(fd, hdrp, disp) } static st_table * -sym_hash(hdrp, syms) - struct exec *hdrp; - struct nlist *syms; +sym_hash(struct exec *hdrp, struct nlist *syms) { st_table *tbl; struct nlist *sym = syms; @@ -347,8 +336,7 @@ sym_hash(hdrp, syms) } static int -dln_init(prog) - const char *prog; +dln_init(const char *prog) { char *file; int fd; @@ -422,11 +410,7 @@ dln_init(prog) } static long -load_text_data(fd, hdrp, bss, disp) - int fd; - struct exec *hdrp; - int bss; - long disp; +load_text_data(int fd, struct exec *hdrp, int bss, long disp) { int size; unsigned char* addr; @@ -460,8 +444,7 @@ load_text_data(fd, hdrp, bss, disp) } static int -undef_print(key, value) - char *key, *value; +undef_print(char *key, char *value) { fprintf(stderr, " %s\n", key); return ST_CONTINUE; @@ -498,10 +481,7 @@ struct undef { static st_table *reloc_tbl = NULL; static void -link_undef(name, base, reloc) - const char *name; - long base; - struct relocation_info *reloc; +link_undef(const char *name, long base, struct relocation_info *reloc) { static int u_no = 0; struct undef *obj; @@ -534,10 +514,7 @@ struct reloc_arg { }; static int -reloc_undef(no, undef, arg) - int no; - struct undef *undef; - struct reloc_arg *arg; +reloc_undef(int no, struct undef *undef, struct reloc_arg *arg) { int datum; char *address; @@ -598,9 +575,7 @@ reloc_undef(no, undef, arg) } static void -unlink_undef(name, value) - const char *name; - long value; +unlink_undef(const char *name, long value) { struct reloc_arg arg; @@ -615,10 +590,7 @@ struct indr_data { }; static int -reloc_repl(no, undef, data) - int no; - struct undef *undef; - struct indr_data *data; +reloc_repl(int no, struct undef *undef, struct indr_data *data) { if (strcmp(data->name0, undef->name) == 0) { free(undef->name); @@ -629,10 +601,7 @@ reloc_repl(no, undef, data) #endif static int -load_1(fd, disp, need_init) - int fd; - long disp; - const char *need_init; +load_1(int fd, long disp, const char *need_init) { static char *libc = LIBC_NAME; struct exec hdr; @@ -913,10 +882,7 @@ load_1(fd, disp, need_init) static int target_offset; static int -search_undef(key, value, lib_tbl) - const char *key; - int value; - st_table *lib_tbl; +search_undef(const char *key, int value, st_table *lib_tbl) { long offset; @@ -933,8 +899,7 @@ struct symdef { char *dln_librrb_ary_path = DLN_DEFAULT_LIB_PATH; static int -load_lib(lib) - const char *lib; +load_lib(const char *lib) { char *path, *file; char armagic[SARMAG]; @@ -1071,8 +1036,7 @@ load_lib(lib) } static int -load(file) - const char *file; +load(const char *file) { int fd; int result; @@ -1097,8 +1061,7 @@ load(file) } void* -dln_sym(name) - const char *name; +dln_sym(const char *name) { struct nlist *sym; @@ -1630,10 +1593,7 @@ dln_find_file(const char *fname, const char *path) #if defined(__CYGWIN32__) const char * -conv_to_posix_path(win32, posix, len) - char *win32; - char *posix; - int len; +conv_to_posix_path(char *win32, char *posix, int len) { char *first = win32; char *p = win32; diff --git a/eval.c b/eval.c index 48ecb28a92..8ebfbe93bc 100644 --- a/eval.c +++ b/eval.c @@ -87,9 +87,7 @@ typedef struct { NORETURN(static void rb_jump_context(rb_jmpbuf_t, int)); static inline void -rb_jump_context(env, val) - rb_jmpbuf_t env; - int val; +rb_jump_context(rb_jmpbuf_t env, int val) { env->status = val; setcontext(&env->context); @@ -1344,8 +1342,7 @@ is_ruby_native_thread(void) # ifdef HAVE_NATIVETHREAD_KILL void -ruby_native_thread_kill(sig) - int sig; +ruby_native_thread_kill(int sig) { NATIVETHREAD_KILL(ruby_thid, sig); } @@ -11763,8 +11760,7 @@ static int thread_init = 0; #if defined(_THREAD_SAFE) static void -catch_timer(sig) - int sig; +catch_timer(int sig) { #if !defined(POSIX_SIGNAL) && !defined(BSD_SIGNAL) signal(sig, catch_timer); @@ -11775,8 +11771,7 @@ catch_timer(sig) static pthread_t time_thread; static void* -thread_timer(dummy) - void *dummy; +thread_timer(void *dummy) { for (;;) { #ifdef HAVE_NANOSLEEP diff --git a/gc.c b/gc.c index ea1bdf0ecb..5a786cc02e 100644 --- a/gc.c +++ b/gc.c @@ -504,8 +504,7 @@ set_stack_end(VALUE **stack_end_p) #else static int grow_direction; static int -stack_grow_direction(addr) - VALUE *addr; +stack_grow_direction(VALUE *addr) { SET_STACK_END; diff --git a/object.c b/object.c index 398dc6a1a7..d40d19efea 100644 --- a/object.c +++ b/object.c @@ -719,8 +719,7 @@ nil_inspect(VALUE obj) #ifdef NIL_PLUS static VALUE -nil_plus(x, y) - VALUE x, y; +nil_plus(VALUE x, VALUE y) { switch (TYPE(y)) { case T_NIL: diff --git a/process.c b/process.c index 42b9d67e26..c286c80c9a 100644 --- a/process.c +++ b/process.c @@ -623,9 +623,7 @@ struct wait_data { }; static int -wait_each(pid, status, data) - int pid, status; - struct wait_data *data; +wait_each(int pid, int status, struct wait_data *data) { if (data->status != -1) return ST_STOP; @@ -635,9 +633,7 @@ wait_each(pid, status, data) } static int -waitall_each(pid, status, ary) - int pid, status; - VALUE ary; +waitall_each(int pid, int status, VALUE ary) { last_status_set(status, pid); rb_ary_push(ary, rb_assoc_new(INT2NUM(pid), rb_last_status)); @@ -1065,9 +1061,7 @@ rb_proc_exec(const char *str) #define proc_spawn_v(argv, prog) rb_w32_aspawn(P_NOWAIT, prog, argv) #else static int -proc_spawn_v(argv, prog) - char **argv; - char *prog; +proc_spawn_v(char **argv, char *prog) { char *extension; int status; @@ -1131,8 +1125,7 @@ proc_spawn_n(int argc, VALUE *argv, VALUE prog) #define proc_spawn(str) rb_w32_spawn(P_NOWAIT, str, 0) #else static int -proc_spawn(str) - char *str; +proc_spawn(char *str) { char *s, *t; char **argv, **a; @@ -1266,8 +1259,7 @@ rb_exec(const struct rb_exec_arg *e) #define proc_syswait (VALUE (*)(VALUE))rb_syswait #else static VALUE -proc_syswait(pid) - VALUE pid; +proc_syswait(VALUE pid) { rb_syswait((int)pid); return Qnil; -- cgit v1.2.3