[前][次][番号順一覧][スレッド一覧]

ruby-changes:18020

From: yugui <ko1@a...>
Date: Thu, 2 Dec 2010 17:07:50 +0900 (JST)
Subject: [ruby-changes:18020] Ruby:r30043 (ruby_1_9_2): merges r29467 from trunk into ruby_1_9_2.

yugui	2010-12-02 17:07:13 +0900 (Thu, 02 Dec 2010)

  New Revision: 30043

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30043

  Log:
    merges r29467 from trunk into ruby_1_9_2.
    --
    * win32/win32.c (rb_w32_open_osfhandle, rb_w32_wopen, rb_w32_pipe):
      use uintptr_t instead of long for win64.
    
    * win32/win32.c (socketpair_internal): suppress warnings.
    
    * win32/win32.c (ftruncate): use HANDLE instead of long for win64.

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/version.h
    branches/ruby_1_9_2/win32/win32.c

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 30042)
+++ ruby_1_9_2/ChangeLog	(revision 30043)
@@ -1,3 +1,8 @@
+Tue Oct 12 23:58:19 2010  Nobuyoshi Nakada  <nobu@r...>
+
+	* win32/win32.c (rb_w32_open_osfhandle, rb_w32_wopen, rb_w32_pipe):
+	  use uintptr_t instead of long for win64.
+
 Tue Oct 12 23:55:11 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* vsnprintf.c (BSD_vfprintf): fix cast.
Index: ruby_1_9_2/win32/win32.c
===================================================================
--- ruby_1_9_2/win32/win32.c	(revision 30042)
+++ ruby_1_9_2/win32/win32.c	(revision 30043)
@@ -2054,7 +2054,7 @@
 
     /* attempt to allocate a C Runtime file handle */
     hF = CreateFile("NUL", 0, 0, NULL, OPEN_ALWAYS, 0, NULL);
-    fh = _open_osfhandle((long)hF, 0);
+    fh = _open_osfhandle((intptr_t)hF, 0);
     CloseHandle(hF);
     if (fh == -1) {
 	errno = EMFILE;		/* too many open files */
@@ -3406,6 +3406,8 @@
 	return -1;
     }
 
+    sv[0] = (SOCKET)INVALID_HANDLE_VALUE;
+    sv[1] = (SOCKET)INVALID_HANDLE_VALUE;
     RUBY_CRITICAL({
 	do {
 	    svr = open_ifs_socket(af, type, protocol);
@@ -4353,16 +4355,16 @@
 int
 ftruncate(int fd, off_t length)
 {
-    long h;
+    HANDLE h;
 
 #ifdef WIN95
     if (IsWin95()) {
 	return chsize(fd, (unsigned long)length);
     }
 #endif
-    h = _get_osfhandle(fd);
-    if (h == -1) return -1;
-    return rb_chsize((HANDLE)h, length);
+    h = (HANDLE)_get_osfhandle(fd);
+    if (h == (HANDLE)-1) return -1;
+    return rb_chsize(h, length);
 }
 
 #ifdef __BORLANDC__
@@ -4856,7 +4858,7 @@
     /* allocate a C Runtime file handle */
     RUBY_CRITICAL({
 	h = CreateFile("NUL", 0, 0, NULL, OPEN_ALWAYS, 0, NULL);
-	fd = _open_osfhandle((long)h, 0);
+	fd = _open_osfhandle((intptr_t)h, 0);
 	CloseHandle(h);
     });
     if (fd == -1) {
@@ -4865,7 +4867,7 @@
     }
     RUBY_CRITICAL({
 	MTHREAD_ONLY(EnterCriticalSection(&(_pioinfo(fd)->lock)));
-	_set_osfhnd(fd, (long)INVALID_HANDLE_VALUE);
+	_set_osfhnd(fd, (intptr_t)INVALID_HANDLE_VALUE);
 	_set_osflags(fd, 0);
 
 	h = CreateFileW(file, access, FILE_SHARE_READ | FILE_SHARE_WRITE, &sec,
@@ -4894,7 +4896,7 @@
 	if (!(flags & (FDEV | FPIPE)) && (oflag & O_APPEND))
 	    flags |= FAPPEND;
 
-	_set_osfhnd(fd, (long)h);
+	_set_osfhnd(fd, (intptr_t)h);
 	_osfile(fd) = flags | FOPEN;
 
 	MTHREAD_ONLY(LeaveCriticalSection(&_pioinfo(fd)->lock));
@@ -4975,7 +4977,7 @@
     RUBY_CRITICAL(do {
 	ret = 0;
 	h = CreateFile("NUL", 0, 0, NULL, OPEN_ALWAYS, 0, NULL);
-	fdRead = _open_osfhandle((long)h, 0);
+	fdRead = _open_osfhandle((intptr_t)h, 0);
 	CloseHandle(h);
 	if (fdRead == -1) {
 	    errno = EMFILE;
@@ -4986,7 +4988,7 @@
 	}
 
 	MTHREAD_ONLY(EnterCriticalSection(&(_pioinfo(fdRead)->lock)));
-	_set_osfhnd(fdRead, (long)hRead);
+	_set_osfhnd(fdRead, (intptr_t)hRead);
 	_set_osflags(fdRead, FOPEN | FPIPE | FNOINHERIT);
 	MTHREAD_ONLY(LeaveCriticalSection(&(_pioinfo(fdRead)->lock)));
     } while (0));
@@ -4995,7 +4997,7 @@
 
     RUBY_CRITICAL(do {
 	h = CreateFile("NUL", 0, 0, NULL, OPEN_ALWAYS, 0, NULL);
-	fdWrite = _open_osfhandle((long)h, 0);
+	fdWrite = _open_osfhandle((intptr_t)h, 0);
 	CloseHandle(h);
 	if (fdWrite == -1) {
 	    errno = EMFILE;
@@ -5004,7 +5006,7 @@
 	    break;
 	}
 	MTHREAD_ONLY(EnterCriticalSection(&(_pioinfo(fdWrite)->lock)));
-	_set_osfhnd(fdWrite, (long)hWrite);
+	_set_osfhnd(fdWrite, (intptr_t)hWrite);
 	_set_osflags(fdWrite, FOPEN | FPIPE | FNOINHERIT);
 	MTHREAD_ONLY(LeaveCriticalSection(&(_pioinfo(fdWrite)->lock)));
     } while (0));
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 30042)
+++ ruby_1_9_2/version.h	(revision 30043)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 73
+#define RUBY_PATCHLEVEL 74
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]