summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--eval.c25
-rw-r--r--file.c2
-rw-r--r--io.c2
-rw-r--r--node.h24
5 files changed, 39 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index fe17bb6..d3b2366 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* eval.c (ruby_cleanup): exit by SystemExit and SignalException in END
diff --git a/eval.c b/eval.c
index abec958..36af45b 100644
--- a/eval.c
+++ b/eval.c
@@ -243,8 +243,8 @@ static int scope_vmode;
#define SCOPE_SET(f) (scope_vmode=(f))
#define SCOPE_TEST(f) (scope_vmode&(f))
-VALUE (*ruby_sandbox_save)(struct thread *) = NULL;
-VALUE (*ruby_sandbox_restore)(struct thread *) = NULL;
+VALUE (*ruby_sandbox_save)_((rb_thread_t));
+VALUE (*ruby_sandbox_restore)_((rb_thread_t));
NODE* ruby_current_node;
int ruby_safe_level = 0;
/* safe-level:
@@ -1073,8 +1073,11 @@ NODE *ruby_top_cref;
ruby_scope = _scope; \
scope_vmode = SCOPE_PUBLIC
-rb_thread_t curr_thread = 0;
-rb_thread_t main_thread;
+rb_thread_t rb_curr_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 *));
#define POP_SCOPE() \
@@ -9832,8 +9835,6 @@ extern VALUE rb_last_status;
# endif
#endif
-/* typedef struct thread * rb_thread_t; */
-
#define THREAD_RAISED 0x200 /* temporary flag */
#define THREAD_TERMINATING 0x400 /* persistent flag */
#define THREAD_NO_ENSURE 0x800 /* persistent flag */
@@ -9856,7 +9857,7 @@ struct thread_status_t {
int safe;
- enum thread_status status;
+ enum rb_thread_status status;
int wait_for;
int fd;
fd_set readfds;
@@ -9958,7 +9959,7 @@ rb_trap_eval(cmd, sig, safe)
static const char *
thread_status_name(status)
- enum thread_status status;
+ enum rb_thread_status status;
{
switch (status) {
case THREAD_RUNNABLE:
@@ -11016,7 +11017,7 @@ rb_thread_join(th, limit)
rb_thread_t th;
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_dead(th)) {
@@ -11399,7 +11400,7 @@ rb_thread_pass()
VALUE
rb_thread_stop()
{
- enum thread_status last_status = THREAD_RUNNABLE;
+ enum rb_thread_status last_status = THREAD_RUNNABLE;
rb_thread_critical = 0;
if (curr_thread == curr_thread->next) {
@@ -11663,7 +11664,7 @@ rb_thread_group(thread)
#endif
#define THREAD_ALLOC(th) do {\
- th = ALLOC(struct thread);\
+ th = ALLOC(struct rb_thread);\
\
th->next = 0;\
th->prev = 0;\
@@ -11828,7 +11829,7 @@ rb_thread_start_0(fn, arg, th)
volatile rb_thread_t th_save = th;
volatile VALUE thread = th->thread;
struct BLOCK *volatile saved_block = 0;
- enum thread_status status;
+ enum rb_thread_status status;
int state;
if (OBJ_FROZEN(curr_thread->thgroup)) {
diff --git a/file.c b/file.c
index e392cd7..226046a 100644
--- a/file.c
+++ b/file.c
@@ -2433,7 +2433,7 @@ rb_path_last_separator(path)
return last;
}
-char *
+static char *
chompdirsep(path)
const char *path;
{
diff --git a/io.c b/io.c
index e98520d..fe24def 100644
--- a/io.c
+++ b/io.c
@@ -1052,7 +1052,7 @@ read_buffered_data(ptr, len, f)
#endif
}
-long
+static long
io_fread(ptr, len, fptr)
char *ptr;
long len;
diff --git a/node.h b/node.h
index ec0a6f4..382d266 100644
--- a/node.h
+++ b/node.h
@@ -338,8 +338,8 @@ extern NODE *ruby_top_cref;
#define NOEX_PUBLIC 0
#define NOEX_NOSUPER 1
#define NOEX_PRIVATE 2
-#define NOEX_PROTECTED 4
-#define NOEX_MASK 6
+#define NOEX_PROTECTED 4
+#define NOEX_MASK 6
#define NOEX_UNDEF NOEX_NOSUPER
@@ -390,17 +390,17 @@ typedef struct {
typedef jmp_buf rb_jmpbuf_t;
#endif
-enum thread_status {
+enum rb_thread_status {
THREAD_TO_KILL,
THREAD_RUNNABLE,
THREAD_STOPPED,
THREAD_KILLED,
};
-typedef struct thread * rb_thread_t;
+typedef struct rb_thread *rb_thread_t;
-struct thread {
- struct thread *next, *prev;
+struct rb_thread {
+ rb_thread_t next, prev;
rb_jmpbuf_t context;
#if (defined _WIN32 && !defined _WIN32_WCE) || defined __CYGWIN__
unsigned long win32_exception_list;
@@ -441,7 +441,7 @@ struct thread {
int safe;
- enum thread_status status;
+ enum rb_thread_status status;
int wait_for;
int fd;
fd_set readfds;
@@ -455,17 +455,17 @@ struct thread {
int priority;
VALUE thgroup;
- st_table *locals;
+ struct st_table *locals;
VALUE thread;
VALUE sandbox;
};
-extern VALUE (*ruby_sandbox_save)(struct thread *);
-extern VALUE (*ruby_sandbox_restore)(struct thread *);
-extern rb_thread_t curr_thread;
-extern rb_thread_t main_thread;
+extern VALUE (*ruby_sandbox_save)_((rb_thread_t));
+extern VALUE (*ruby_sandbox_restore)_((rb_thread_t));
+extern rb_thread_t rb_curr_thread;
+extern rb_thread_t rb_main_thread;
#if defined(__cplusplus)
} /* extern "C" { */