1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* node.h (struct rb_thread.locals): explicit as struct.

[ruby-core:10585]

* eval.c, node.h (enum rb_thread_status, struct rb_thread,
  rb_curr_thread, rb_main_thread): prefixed.  [ruby-core:10586]

* file.c (chompdirsep): made an unprefixed name static.

* io.c (io_fread): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-03-24 14:40:08 +00:00
parent 2898d5c5a8
commit d33cc535c3
5 changed files with 39 additions and 26 deletions

View file

@ -1,3 +1,15 @@
Sat Mar 24 23:40:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* node.h (struct rb_thread.locals): explicit as struct.
[ruby-core:10585]
* eval.c, node.h (enum rb_thread_status, struct rb_thread,
rb_curr_thread, rb_main_thread): prefixed. [ruby-core:10586]
* file.c (chompdirsep): made an unprefixed name static.
* io.c (io_fread): ditto.
Sat Mar 24 01:54:03 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> Sat Mar 24 01:54:03 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (ruby_cleanup): exit by SystemExit and SignalException in END * eval.c (ruby_cleanup): exit by SystemExit and SignalException in END

25
eval.c
View file

@ -243,8 +243,8 @@ static int scope_vmode;
#define SCOPE_SET(f) (scope_vmode=(f)) #define SCOPE_SET(f) (scope_vmode=(f))
#define SCOPE_TEST(f) (scope_vmode&(f)) #define SCOPE_TEST(f) (scope_vmode&(f))
VALUE (*ruby_sandbox_save)(struct thread *) = NULL; VALUE (*ruby_sandbox_save)_((rb_thread_t));
VALUE (*ruby_sandbox_restore)(struct thread *) = NULL; VALUE (*ruby_sandbox_restore)_((rb_thread_t));
NODE* ruby_current_node; NODE* ruby_current_node;
int ruby_safe_level = 0; int ruby_safe_level = 0;
/* safe-level: /* safe-level:
@ -1073,8 +1073,11 @@ NODE *ruby_top_cref;
ruby_scope = _scope; \ ruby_scope = _scope; \
scope_vmode = SCOPE_PUBLIC scope_vmode = SCOPE_PUBLIC
rb_thread_t curr_thread = 0; rb_thread_t rb_curr_thread;
rb_thread_t main_thread; rb_thread_t rb_main_thread;
#define main_thread rb_main_thread
#define curr_thread rb_curr_thread
static void scope_dup _((struct SCOPE *)); static void scope_dup _((struct SCOPE *));
#define POP_SCOPE() \ #define POP_SCOPE() \
@ -9832,8 +9835,6 @@ extern VALUE rb_last_status;
# endif # endif
#endif #endif
/* typedef struct thread * rb_thread_t; */
#define THREAD_RAISED 0x200 /* temporary flag */ #define THREAD_RAISED 0x200 /* temporary flag */
#define THREAD_TERMINATING 0x400 /* persistent flag */ #define THREAD_TERMINATING 0x400 /* persistent flag */
#define THREAD_NO_ENSURE 0x800 /* persistent flag */ #define THREAD_NO_ENSURE 0x800 /* persistent flag */
@ -9856,7 +9857,7 @@ struct thread_status_t {
int safe; int safe;
enum thread_status status; enum rb_thread_status status;
int wait_for; int wait_for;
int fd; int fd;
fd_set readfds; fd_set readfds;
@ -9958,7 +9959,7 @@ rb_trap_eval(cmd, sig, safe)
static const char * static const char *
thread_status_name(status) thread_status_name(status)
enum thread_status status; enum rb_thread_status status;
{ {
switch (status) { switch (status) {
case THREAD_RUNNABLE: case THREAD_RUNNABLE:
@ -11016,7 +11017,7 @@ rb_thread_join(th, limit)
rb_thread_t th; rb_thread_t th;
double limit; double limit;
{ {
enum thread_status last_status = THREAD_RUNNABLE; enum rb_thread_status last_status = THREAD_RUNNABLE;
if (rb_thread_critical) rb_thread_deadlock(); if (rb_thread_critical) rb_thread_deadlock();
if (!rb_thread_dead(th)) { if (!rb_thread_dead(th)) {
@ -11399,7 +11400,7 @@ rb_thread_pass()
VALUE VALUE
rb_thread_stop() rb_thread_stop()
{ {
enum thread_status last_status = THREAD_RUNNABLE; enum rb_thread_status last_status = THREAD_RUNNABLE;
rb_thread_critical = 0; rb_thread_critical = 0;
if (curr_thread == curr_thread->next) { if (curr_thread == curr_thread->next) {
@ -11663,7 +11664,7 @@ rb_thread_group(thread)
#endif #endif
#define THREAD_ALLOC(th) do {\ #define THREAD_ALLOC(th) do {\
th = ALLOC(struct thread);\ th = ALLOC(struct rb_thread);\
\ \
th->next = 0;\ th->next = 0;\
th->prev = 0;\ th->prev = 0;\
@ -11828,7 +11829,7 @@ rb_thread_start_0(fn, arg, th)
volatile rb_thread_t th_save = th; volatile rb_thread_t th_save = th;
volatile VALUE thread = th->thread; volatile VALUE thread = th->thread;
struct BLOCK *volatile saved_block = 0; struct BLOCK *volatile saved_block = 0;
enum thread_status status; enum rb_thread_status status;
int state; int state;
if (OBJ_FROZEN(curr_thread->thgroup)) { if (OBJ_FROZEN(curr_thread->thgroup)) {

2
file.c
View file

@ -2433,7 +2433,7 @@ rb_path_last_separator(path)
return last; return last;
} }
char * static char *
chompdirsep(path) chompdirsep(path)
const char *path; const char *path;
{ {

2
io.c
View file

@ -1052,7 +1052,7 @@ read_buffered_data(ptr, len, f)
#endif #endif
} }
long static long
io_fread(ptr, len, fptr) io_fread(ptr, len, fptr)
char *ptr; char *ptr;
long len; long len;

20
node.h
View file

@ -390,17 +390,17 @@ typedef struct {
typedef jmp_buf rb_jmpbuf_t; typedef jmp_buf rb_jmpbuf_t;
#endif #endif
enum thread_status { enum rb_thread_status {
THREAD_TO_KILL, THREAD_TO_KILL,
THREAD_RUNNABLE, THREAD_RUNNABLE,
THREAD_STOPPED, THREAD_STOPPED,
THREAD_KILLED, THREAD_KILLED,
}; };
typedef struct thread * rb_thread_t; typedef struct rb_thread *rb_thread_t;
struct thread { struct rb_thread {
struct thread *next, *prev; rb_thread_t next, prev;
rb_jmpbuf_t context; rb_jmpbuf_t context;
#if (defined _WIN32 && !defined _WIN32_WCE) || defined __CYGWIN__ #if (defined _WIN32 && !defined _WIN32_WCE) || defined __CYGWIN__
unsigned long win32_exception_list; unsigned long win32_exception_list;
@ -441,7 +441,7 @@ struct thread {
int safe; int safe;
enum thread_status status; enum rb_thread_status status;
int wait_for; int wait_for;
int fd; int fd;
fd_set readfds; fd_set readfds;
@ -455,17 +455,17 @@ struct thread {
int priority; int priority;
VALUE thgroup; VALUE thgroup;
st_table *locals; struct st_table *locals;
VALUE thread; VALUE thread;
VALUE sandbox; VALUE sandbox;
}; };
extern VALUE (*ruby_sandbox_save)(struct thread *); extern VALUE (*ruby_sandbox_save)_((rb_thread_t));
extern VALUE (*ruby_sandbox_restore)(struct thread *); extern VALUE (*ruby_sandbox_restore)_((rb_thread_t));
extern rb_thread_t curr_thread; extern rb_thread_t rb_curr_thread;
extern rb_thread_t main_thread; extern rb_thread_t rb_main_thread;
#if defined(__cplusplus) #if defined(__cplusplus)
} /* extern "C" { */ } /* extern "C" { */