ruby-changes:4710
From: ko1@a...
Date: Sat, 26 Apr 2008 18:36:57 +0900 (JST)
Subject: [ruby-changes:4710] nobu - Ruby:r16204 (trunk): * io.c, signal.c, thread.c, thread_win32.c, include/ruby/intern.h:
nobu 2008-04-26 18:36:35 +0900 (Sat, 26 Apr 2008)
New Revision: 16204
Modified files:
trunk/ChangeLog
trunk/include/ruby/intern.h
trunk/io.c
trunk/signal.c
trunk/thread.c
trunk/thread_win32.c
Log:
* io.c, signal.c, thread.c, thread_win32.c, include/ruby/intern.h:
suppress warnings.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16204&r2=16203&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/thread_win32.c?r1=16204&r2=16203&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/thread.c?r1=16204&r2=16203&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/io.c?r1=16204&r2=16203&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/signal.c?r1=16204&r2=16203&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/intern.h?r1=16204&r2=16203&diff_format=u
Index: thread_win32.c
===================================================================
--- thread_win32.c (revision 16203)
+++ thread_win32.c (revision 16204)
@@ -73,7 +73,7 @@
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) & lpMsgBuf, 0, NULL);
- rb_bug("%s", lpMsgBuf);
+ rb_bug("%s", (char*)lpMsgBuf);
}
static void
@@ -116,7 +116,7 @@
thread_debug(" WaitForMultipleObjects start (count: %d)\n", count);
ret = WaitForMultipleObjects(count, targets, FALSE, timeout);
- thread_debug(" WaitForMultipleObjects end (ret: %d)\n", ret);
+ thread_debug(" WaitForMultipleObjects end (ret: %lu)\n", ret);
if (ret == WAIT_OBJECT_0 + count - 1 && th) {
errno = EINTR;
@@ -227,9 +227,9 @@
/* interrupted. return immediate */
}
else {
- thread_debug("native_sleep start (%d)\n", (int)msec);
+ thread_debug("native_sleep start (%lu)\n", msec);
ret = w32_wait_events(0, 0, msec, th);
- thread_debug("native_sleep done (%d)\n", ret);
+ thread_debug("native_sleep done (%lu)\n", ret);
}
th->unblock_function = 0;
@@ -393,7 +393,7 @@
{
r = WaitForSingleObject(entry.event, INFINITE);
if (r != WAIT_OBJECT_0) {
- rb_bug("native_cond_wait: WaitForSingleObject returns %d", r);
+ rb_bug("native_cond_wait: WaitForSingleObject returns %lu", r);
}
}
native_mutex_lock(mutex);
Index: include/ruby/intern.h
===================================================================
--- include/ruby/intern.h (revision 16203)
+++ include/ruby/intern.h (revision 16204)
@@ -226,7 +226,7 @@
#define rb_fd_copy(d, s, n) (*(d) = *(s))
#define rb_fd_ptr(f) (f)
#define rb_fd_init(f) FD_ZERO(f)
-#define rb_fd_term(f) (f)
+#define rb_fd_term(f) (void)(f)
#define rb_fd_max(f) FD_SETSIZE
#define rb_fd_select(n, rfds, wfds, efds, timeout) select(n, rfds, wfds, efds, timeout)
Index: ChangeLog
===================================================================
--- ChangeLog (revision 16203)
+++ ChangeLog (revision 16204)
@@ -1,3 +1,8 @@
+Sat Apr 26 18:36:31 2008 Nobuyoshi Nakada <nobu@r...>
+
+ * io.c, signal.c, thread.c, thread_win32.c, include/ruby/intern.h:
+ suppress warnings.
+
Sat Apr 26 17:42:30 2008 Nobuyoshi Nakada <nobu@r...>
* error.c (builtin_types), gc.c (count_objects): added Complex and
Index: io.c
===================================================================
--- io.c (revision 16203)
+++ io.c (revision 16204)
@@ -488,7 +488,10 @@
static int
wsplit_p(rb_io_t *fptr)
{
+#if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(O_NONBLOCK)
int r;
+#endif
+
if (!(fptr->mode & FMODE_WSPLIT_INITIALIZED)) {
struct stat buf;
if (fstat(fptr->fd, &buf) == 0 &&
Index: thread.c
===================================================================
--- thread.c (revision 16203)
+++ thread.c (revision 16204)
@@ -1811,7 +1811,7 @@
fd_set orig_read, orig_write, orig_except;
#ifndef linux
- double limit;
+ double limit = 0;
struct timeval wait_rest;
if (timeout) {
@@ -1862,11 +1862,11 @@
errno = lerrno;
if (result < 0) {
- if (errno == EINTR
+ switch (errno) {
+ case EINTR:
#ifdef ERESTART
- || errno == ERESTART
+ case ERESTART:
#endif
- ) {
if (read) *read = orig_read;
if (write) *write = orig_write;
if (except) *except = orig_except;
@@ -1881,6 +1881,8 @@
}
#endif
goto retry;
+ default:
+ break;
}
}
return result;
@@ -1985,8 +1987,8 @@
/* check signal */
if (vm->buffered_signal_size && vm->main_thread->exec_signal == 0) {
vm->main_thread->exec_signal = rb_get_next_signal(vm);
- thread_debug("buffered_signal_size: %d, sig: %d\n",
- vm->buffered_signal_size, vm->main_thread->exec_signal);
+ thread_debug("buffered_signal_size: %ld, sig: %d\n",
+ (long)vm->buffered_signal_size, vm->main_thread->exec_signal);
rb_thread_interrupt(vm->main_thread);
}
Index: signal.c
===================================================================
--- signal.c (revision 16203)
+++ signal.c (revision 16204)
@@ -473,13 +473,14 @@
#endif
}
+#if USE_TRAP_MASK
# ifdef HAVE_SIGPROCMASK
static sigset_t trap_last_mask;
# else
static int trap_last_mask;
# endif
+#endif
-
#if HAVE_PTHREAD_H
#include <pthread.h>
#endif
@@ -961,6 +962,7 @@
}
}
+#if defined(SIGCLD) || defined(SIGCHLD)
static void
init_sigchld(int sig)
{
@@ -1001,6 +1003,7 @@
trap_last_mask = mask;
#endif
}
+#endif
void
ruby_sig_finalize()
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/