ansificated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8b827f1a7d
commit
1f84a162df
3
dir.c
3
dir.c
@ -102,8 +102,7 @@ char *strchr(char*,char);
|
|||||||
#elif defined(__EMX__)
|
#elif defined(__EMX__)
|
||||||
# define Next(p) ((p) + emx_mblen(p))
|
# define Next(p) ((p) + emx_mblen(p))
|
||||||
static inline int
|
static inline int
|
||||||
emx_mblen(p)
|
emx_mblen(const char *p)
|
||||||
const char *p;
|
|
||||||
{
|
{
|
||||||
int n = mblen(p, RUBY_MBCHAR_MAXSIZE);
|
int n = mblen(p, RUBY_MBCHAR_MAXSIZE);
|
||||||
return (n < 0) ? 1 : n;
|
return (n < 0) ? 1 : n;
|
||||||
|
74
dln.c
74
dln.c
@ -182,10 +182,7 @@ static st_table *undef_tbl;
|
|||||||
static int load_lib();
|
static int load_lib();
|
||||||
|
|
||||||
static int
|
static int
|
||||||
load_header(fd, hdrp, disp)
|
load_header(int fd, struct exec *hdrp, long disp)
|
||||||
int fd;
|
|
||||||
struct exec *hdrp;
|
|
||||||
long disp;
|
|
||||||
{
|
{
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
@ -255,10 +252,7 @@ static int reloc_r_length[] = {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct relocation_info *
|
static struct relocation_info *
|
||||||
load_reloc(fd, hdrp, disp)
|
load_reloc(int fd, struct exec *hdrp, long disp)
|
||||||
int fd;
|
|
||||||
struct exec *hdrp;
|
|
||||||
long disp;
|
|
||||||
{
|
{
|
||||||
struct relocation_info *reloc;
|
struct relocation_info *reloc;
|
||||||
int size;
|
int size;
|
||||||
@ -281,10 +275,7 @@ load_reloc(fd, hdrp, disp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct nlist *
|
static struct nlist *
|
||||||
load_sym(fd, hdrp, disp)
|
load_sym(int fd, struct exec *hdrp, long disp)
|
||||||
int fd;
|
|
||||||
struct exec *hdrp;
|
|
||||||
long disp;
|
|
||||||
{
|
{
|
||||||
struct nlist * buffer;
|
struct nlist * buffer;
|
||||||
struct nlist * sym;
|
struct nlist * sym;
|
||||||
@ -325,9 +316,7 @@ load_sym(fd, hdrp, disp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static st_table *
|
static st_table *
|
||||||
sym_hash(hdrp, syms)
|
sym_hash(struct exec *hdrp, struct nlist *syms)
|
||||||
struct exec *hdrp;
|
|
||||||
struct nlist *syms;
|
|
||||||
{
|
{
|
||||||
st_table *tbl;
|
st_table *tbl;
|
||||||
struct nlist *sym = syms;
|
struct nlist *sym = syms;
|
||||||
@ -347,8 +336,7 @@ sym_hash(hdrp, syms)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dln_init(prog)
|
dln_init(const char *prog)
|
||||||
const char *prog;
|
|
||||||
{
|
{
|
||||||
char *file;
|
char *file;
|
||||||
int fd;
|
int fd;
|
||||||
@ -422,11 +410,7 @@ dln_init(prog)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static long
|
static long
|
||||||
load_text_data(fd, hdrp, bss, disp)
|
load_text_data(int fd, struct exec *hdrp, int bss, long disp)
|
||||||
int fd;
|
|
||||||
struct exec *hdrp;
|
|
||||||
int bss;
|
|
||||||
long disp;
|
|
||||||
{
|
{
|
||||||
int size;
|
int size;
|
||||||
unsigned char* addr;
|
unsigned char* addr;
|
||||||
@ -460,8 +444,7 @@ load_text_data(fd, hdrp, bss, disp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
undef_print(key, value)
|
undef_print(char *key, char *value)
|
||||||
char *key, *value;
|
|
||||||
{
|
{
|
||||||
fprintf(stderr, " %s\n", key);
|
fprintf(stderr, " %s\n", key);
|
||||||
return ST_CONTINUE;
|
return ST_CONTINUE;
|
||||||
@ -498,10 +481,7 @@ struct undef {
|
|||||||
|
|
||||||
static st_table *reloc_tbl = NULL;
|
static st_table *reloc_tbl = NULL;
|
||||||
static void
|
static void
|
||||||
link_undef(name, base, reloc)
|
link_undef(const char *name, long base, struct relocation_info *reloc)
|
||||||
const char *name;
|
|
||||||
long base;
|
|
||||||
struct relocation_info *reloc;
|
|
||||||
{
|
{
|
||||||
static int u_no = 0;
|
static int u_no = 0;
|
||||||
struct undef *obj;
|
struct undef *obj;
|
||||||
@ -534,10 +514,7 @@ struct reloc_arg {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
reloc_undef(no, undef, arg)
|
reloc_undef(int no, struct undef *undef, struct reloc_arg *arg)
|
||||||
int no;
|
|
||||||
struct undef *undef;
|
|
||||||
struct reloc_arg *arg;
|
|
||||||
{
|
{
|
||||||
int datum;
|
int datum;
|
||||||
char *address;
|
char *address;
|
||||||
@ -598,9 +575,7 @@ reloc_undef(no, undef, arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
unlink_undef(name, value)
|
unlink_undef(const char *name, long value)
|
||||||
const char *name;
|
|
||||||
long value;
|
|
||||||
{
|
{
|
||||||
struct reloc_arg arg;
|
struct reloc_arg arg;
|
||||||
|
|
||||||
@ -615,10 +590,7 @@ struct indr_data {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
reloc_repl(no, undef, data)
|
reloc_repl(int no, struct undef *undef, struct indr_data *data)
|
||||||
int no;
|
|
||||||
struct undef *undef;
|
|
||||||
struct indr_data *data;
|
|
||||||
{
|
{
|
||||||
if (strcmp(data->name0, undef->name) == 0) {
|
if (strcmp(data->name0, undef->name) == 0) {
|
||||||
free(undef->name);
|
free(undef->name);
|
||||||
@ -629,10 +601,7 @@ reloc_repl(no, undef, data)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
load_1(fd, disp, need_init)
|
load_1(int fd, long disp, const char *need_init)
|
||||||
int fd;
|
|
||||||
long disp;
|
|
||||||
const char *need_init;
|
|
||||||
{
|
{
|
||||||
static char *libc = LIBC_NAME;
|
static char *libc = LIBC_NAME;
|
||||||
struct exec hdr;
|
struct exec hdr;
|
||||||
@ -913,10 +882,7 @@ load_1(fd, disp, need_init)
|
|||||||
|
|
||||||
static int target_offset;
|
static int target_offset;
|
||||||
static int
|
static int
|
||||||
search_undef(key, value, lib_tbl)
|
search_undef(const char *key, int value, st_table *lib_tbl)
|
||||||
const char *key;
|
|
||||||
int value;
|
|
||||||
st_table *lib_tbl;
|
|
||||||
{
|
{
|
||||||
long offset;
|
long offset;
|
||||||
|
|
||||||
@ -933,8 +899,7 @@ struct symdef {
|
|||||||
char *dln_librrb_ary_path = DLN_DEFAULT_LIB_PATH;
|
char *dln_librrb_ary_path = DLN_DEFAULT_LIB_PATH;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
load_lib(lib)
|
load_lib(const char *lib)
|
||||||
const char *lib;
|
|
||||||
{
|
{
|
||||||
char *path, *file;
|
char *path, *file;
|
||||||
char armagic[SARMAG];
|
char armagic[SARMAG];
|
||||||
@ -1071,8 +1036,7 @@ load_lib(lib)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
load(file)
|
load(const char *file)
|
||||||
const char *file;
|
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
int result;
|
int result;
|
||||||
@ -1097,8 +1061,7 @@ load(file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void*
|
void*
|
||||||
dln_sym(name)
|
dln_sym(const char *name)
|
||||||
const char *name;
|
|
||||||
{
|
{
|
||||||
struct nlist *sym;
|
struct nlist *sym;
|
||||||
|
|
||||||
@ -1630,10 +1593,7 @@ dln_find_file(const char *fname, const char *path)
|
|||||||
|
|
||||||
#if defined(__CYGWIN32__)
|
#if defined(__CYGWIN32__)
|
||||||
const char *
|
const char *
|
||||||
conv_to_posix_path(win32, posix, len)
|
conv_to_posix_path(char *win32, char *posix, int len)
|
||||||
char *win32;
|
|
||||||
char *posix;
|
|
||||||
int len;
|
|
||||||
{
|
{
|
||||||
char *first = win32;
|
char *first = win32;
|
||||||
char *p = win32;
|
char *p = win32;
|
||||||
|
13
eval.c
13
eval.c
@ -87,9 +87,7 @@ typedef struct {
|
|||||||
|
|
||||||
NORETURN(static void rb_jump_context(rb_jmpbuf_t, int));
|
NORETURN(static void rb_jump_context(rb_jmpbuf_t, int));
|
||||||
static inline void
|
static inline void
|
||||||
rb_jump_context(env, val)
|
rb_jump_context(rb_jmpbuf_t env, int val)
|
||||||
rb_jmpbuf_t env;
|
|
||||||
int val;
|
|
||||||
{
|
{
|
||||||
env->status = val;
|
env->status = val;
|
||||||
setcontext(&env->context);
|
setcontext(&env->context);
|
||||||
@ -1344,8 +1342,7 @@ is_ruby_native_thread(void)
|
|||||||
|
|
||||||
# ifdef HAVE_NATIVETHREAD_KILL
|
# ifdef HAVE_NATIVETHREAD_KILL
|
||||||
void
|
void
|
||||||
ruby_native_thread_kill(sig)
|
ruby_native_thread_kill(int sig)
|
||||||
int sig;
|
|
||||||
{
|
{
|
||||||
NATIVETHREAD_KILL(ruby_thid, sig);
|
NATIVETHREAD_KILL(ruby_thid, sig);
|
||||||
}
|
}
|
||||||
@ -11763,8 +11760,7 @@ static int thread_init = 0;
|
|||||||
|
|
||||||
#if defined(_THREAD_SAFE)
|
#if defined(_THREAD_SAFE)
|
||||||
static void
|
static void
|
||||||
catch_timer(sig)
|
catch_timer(int sig)
|
||||||
int sig;
|
|
||||||
{
|
{
|
||||||
#if !defined(POSIX_SIGNAL) && !defined(BSD_SIGNAL)
|
#if !defined(POSIX_SIGNAL) && !defined(BSD_SIGNAL)
|
||||||
signal(sig, catch_timer);
|
signal(sig, catch_timer);
|
||||||
@ -11775,8 +11771,7 @@ catch_timer(sig)
|
|||||||
static pthread_t time_thread;
|
static pthread_t time_thread;
|
||||||
|
|
||||||
static void*
|
static void*
|
||||||
thread_timer(dummy)
|
thread_timer(void *dummy)
|
||||||
void *dummy;
|
|
||||||
{
|
{
|
||||||
for (;;) {
|
for (;;) {
|
||||||
#ifdef HAVE_NANOSLEEP
|
#ifdef HAVE_NANOSLEEP
|
||||||
|
3
gc.c
3
gc.c
@ -504,8 +504,7 @@ set_stack_end(VALUE **stack_end_p)
|
|||||||
#else
|
#else
|
||||||
static int grow_direction;
|
static int grow_direction;
|
||||||
static int
|
static int
|
||||||
stack_grow_direction(addr)
|
stack_grow_direction(VALUE *addr)
|
||||||
VALUE *addr;
|
|
||||||
{
|
{
|
||||||
SET_STACK_END;
|
SET_STACK_END;
|
||||||
|
|
||||||
|
3
object.c
3
object.c
@ -719,8 +719,7 @@ nil_inspect(VALUE obj)
|
|||||||
|
|
||||||
#ifdef NIL_PLUS
|
#ifdef NIL_PLUS
|
||||||
static VALUE
|
static VALUE
|
||||||
nil_plus(x, y)
|
nil_plus(VALUE x, VALUE y)
|
||||||
VALUE x, y;
|
|
||||||
{
|
{
|
||||||
switch (TYPE(y)) {
|
switch (TYPE(y)) {
|
||||||
case T_NIL:
|
case T_NIL:
|
||||||
|
18
process.c
18
process.c
@ -623,9 +623,7 @@ struct wait_data {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
wait_each(pid, status, data)
|
wait_each(int pid, int status, struct wait_data *data)
|
||||||
int pid, status;
|
|
||||||
struct wait_data *data;
|
|
||||||
{
|
{
|
||||||
if (data->status != -1) return ST_STOP;
|
if (data->status != -1) return ST_STOP;
|
||||||
|
|
||||||
@ -635,9 +633,7 @@ wait_each(pid, status, data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
waitall_each(pid, status, ary)
|
waitall_each(int pid, int status, VALUE ary)
|
||||||
int pid, status;
|
|
||||||
VALUE ary;
|
|
||||||
{
|
{
|
||||||
last_status_set(status, pid);
|
last_status_set(status, pid);
|
||||||
rb_ary_push(ary, rb_assoc_new(INT2NUM(pid), rb_last_status));
|
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)
|
#define proc_spawn_v(argv, prog) rb_w32_aspawn(P_NOWAIT, prog, argv)
|
||||||
#else
|
#else
|
||||||
static int
|
static int
|
||||||
proc_spawn_v(argv, prog)
|
proc_spawn_v(char **argv, char *prog)
|
||||||
char **argv;
|
|
||||||
char *prog;
|
|
||||||
{
|
{
|
||||||
char *extension;
|
char *extension;
|
||||||
int status;
|
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)
|
#define proc_spawn(str) rb_w32_spawn(P_NOWAIT, str, 0)
|
||||||
#else
|
#else
|
||||||
static int
|
static int
|
||||||
proc_spawn(str)
|
proc_spawn(char *str)
|
||||||
char *str;
|
|
||||||
{
|
{
|
||||||
char *s, *t;
|
char *s, *t;
|
||||||
char **argv, **a;
|
char **argv, **a;
|
||||||
@ -1266,8 +1259,7 @@ rb_exec(const struct rb_exec_arg *e)
|
|||||||
#define proc_syswait (VALUE (*)(VALUE))rb_syswait
|
#define proc_syswait (VALUE (*)(VALUE))rb_syswait
|
||||||
#else
|
#else
|
||||||
static VALUE
|
static VALUE
|
||||||
proc_syswait(pid)
|
proc_syswait(VALUE pid)
|
||||||
VALUE pid;
|
|
||||||
{
|
{
|
||||||
rb_syswait((int)pid);
|
rb_syswait((int)pid);
|
||||||
return Qnil;
|
return Qnil;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user