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

ruby-changes:1709

From: ko1@a...
Date: 22 Aug 2007 11:39:13 +0900
Subject: [ruby-changes:1709] shyouhei - Ruby:r13200 (ruby_1_8_6): * file.c (rb_file_s_rename): deleted code to get rid of a bug of

shyouhei	2007-08-22 11:39:03 +0900 (Wed, 22 Aug 2007)

  New Revision: 13200

  Modified files:
    branches/ruby_1_8_6/ext/Win32API/Win32API.c
    branches/ruby_1_8_6/ext/dl/ptr.c
    branches/ruby_1_8_6/ext/dl/sym.c
    branches/ruby_1_8_6/ext/socket/getnameinfo.c
    branches/ruby_1_8_6/ext/tk/tcltklib.c
    branches/ruby_1_8_6/ext/win32ole/win32ole.c
    branches/ruby_1_8_6/file.c
    branches/ruby_1_8_6/intern.h
    branches/ruby_1_8_6/missing/strftime.c
    branches/ruby_1_8_6/version.h

  Log:
    * file.c (rb_file_s_rename): deleted code to get rid of a bug of
      old Cygwin.
    * file.c (rb_file_truncate): added prototype of GetLastError()
      on cygwin.  [ruby-dev:31239]
    * intern.h (is_ruby_native_thread): prototype.
    * missing/strftime.c (strftime): fix printf format and actual
      arguments.
    * ext/Win32API/Win32API.c (Win32API_initialize): ditto.
    * ext/tk/tcltklib.c (ip_finalize): ditto.
    * ext/dl/ptr.c (rb_dlptr_inspect): ditto.  [ruby-dev:31268]
    * ext/dl/sym.c (rb_dlsym_inspect): ditto.
    * ext/socket/getnameinfo.c: include stdio.h always.
    * ext/win32ole/win32ole.c (ole_hresult2msg, folevariable_name,
      folevariable_ole_type, folevariable_ole_type_detail,
      folevariable_value, folemethod_visible): missing return value.
    


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/intern.h?r1=13200&r2=13199
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/version.h?r1=13200&r2=13199
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/ext/dl/ptr.c?r1=13200&r2=13199
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/missing/strftime.c?r1=13200&r2=13199
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/ext/socket/getnameinfo.c?r1=13200&r2=13199
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/file.c?r1=13200&r2=13199
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/ext/dl/sym.c?r1=13200&r2=13199
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/ext/win32ole/win32ole.c?r1=13200&r2=13199
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/ext/tk/tcltklib.c?r1=13200&r2=13199
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/ext/Win32API/Win32API.c?r1=13200&r2=13199

Index: ruby_1_8_6/intern.h
===================================================================
--- ruby_1_8_6/intern.h	(revision 13199)
+++ ruby_1_8_6/intern.h	(revision 13200)
@@ -224,6 +224,7 @@
 VALUE rb_thread_local_aset _((VALUE, ID, VALUE));
 void rb_thread_atfork _((void));
 VALUE rb_funcall_rescue __((VALUE, ID, int, ...));
+VALUE is_ruby_native_thread _((void));
 /* file.c */
 VALUE rb_file_s_expand_path _((int, VALUE *));
 VALUE rb_file_expand_path _((VALUE, VALUE));
Index: ruby_1_8_6/ext/Win32API/Win32API.c
===================================================================
--- ruby_1_8_6/ext/Win32API/Win32API.c	(revision 13199)
+++ ruby_1_8_6/ext/Win32API/Win32API.c	(revision 13200)
@@ -108,7 +108,7 @@
     }
 
     if (16 < RARRAY(a_import)->len) {
-	rb_raise(rb_eRuntimeError, "too many parameters: %d\n", RARRAY(a_import)->len);
+	rb_raise(rb_eRuntimeError, "too many parameters: %ld\n", RARRAY(a_import)->len);
     }
 
     rb_iv_set(self, "__import__", a_import);
Index: ruby_1_8_6/ext/dl/ptr.c
===================================================================
--- ruby_1_8_6/ext/dl/ptr.c	(revision 13199)
+++ ruby_1_8_6/ext/dl/ptr.c	(revision 13200)
@@ -466,8 +466,9 @@
   char str[1024];
 
   Data_Get_Struct(self, struct ptr_data, data);
-  snprintf(str, 1023, "#<%s:0x%x ptr=0x%x size=%ld free=0x%x>",
-	   rb_class2name(CLASS_OF(self)), data, data->ptr, data->size, data->free);
+  snprintf(str, 1023, "#<%s:0x%lx ptr=0x%lx size=%ld free=0x%lx>",
+	   rb_class2name(CLASS_OF(self)), data, data->ptr, data->size,
+	   (long)data->free);
   return rb_str_new2(str);
 }
 
Index: ruby_1_8_6/ext/dl/sym.c
===================================================================
--- ruby_1_8_6/ext/dl/sym.c	(revision 13199)
+++ ruby_1_8_6/ext/dl/sym.c	(revision 13200)
@@ -268,7 +268,7 @@
   str_size = RSTRING(proto)->len + 100;
   str = dlmalloc(str_size);
   snprintf(str, str_size - 1,
-          "#<DL::Symbol:0x%x func=0x%x '%s'>",
+          "#<DL::Symbol:0x%lx func=0x%lx '%s'>",
 	   sym, sym->func, RSTRING(proto)->ptr);
   val = rb_tainted_str_new2(str);
   dlfree(str);
Index: ruby_1_8_6/ext/win32ole/win32ole.c
===================================================================
--- ruby_1_8_6/ext/win32ole/win32ole.c	(revision 13199)
+++ ruby_1_8_6/ext/win32ole/win32ole.c	(revision 13200)
@@ -497,7 +497,7 @@
     DWORD dwCount;
 
     char strhr[100];
-    sprintf(strhr, "    HRESULT error code:0x%08x\n      ", hr);
+    sprintf(strhr, "    HRESULT error code:0x%08lx\n      ", hr);
     msg = rb_str_new2(strhr);
 
     dwCount = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
@@ -4033,7 +4033,8 @@
     return rb_ivar_get(self, rb_intern("name"));
 }
 
-static ole_variable_ole_type(pTypeInfo, var_index)
+static VALUE
+ole_variable_ole_type(pTypeInfo, var_index)
     ITypeInfo *pTypeInfo;
     UINT var_index;
 {
@@ -4077,7 +4078,8 @@
     return ole_variable_ole_type(pvar->pTypeInfo, pvar->index);
 }
 
-static ole_variable_ole_type_detail(pTypeInfo, var_index)
+static VALUE
+ole_variable_ole_type_detail(pTypeInfo, var_index)
     ITypeInfo *pTypeInfo;
     UINT var_index;
 {
@@ -4113,7 +4115,8 @@
     return ole_variable_ole_type_detail(pvar->pTypeInfo, pvar->index);
 }
 
-static ole_variable_value(pTypeInfo, var_index)
+static VALUE
+ole_variable_value(pTypeInfo, var_index)
     ITypeInfo *pTypeInfo;
     UINT var_index;
 {
@@ -4159,7 +4162,8 @@
     return ole_variable_value(pvar->pTypeInfo, pvar->index);
 }
 
-static ole_variable_visible(pTypeInfo, var_index)
+static VALUE
+ole_variable_visible(pTypeInfo, var_index)
     ITypeInfo *pTypeInfo;
     UINT var_index;
 {
@@ -4631,7 +4635,8 @@
     return ole_method_visible(pmethod->pTypeInfo, pmethod->index);
 }
 
-static ole_method_event(pTypeInfo, method_index, method_name)
+static VALUE
+ole_method_event(pTypeInfo, method_index, method_name)
     ITypeInfo *pTypeInfo;
     WORD method_index;
     VALUE method_name;
Index: ruby_1_8_6/ext/tk/tcltklib.c
===================================================================
--- ruby_1_8_6/ext/tk/tcltklib.c	(revision 13199)
+++ ruby_1_8_6/ext/tk/tcltklib.c	(revision 13200)
@@ -4414,13 +4414,13 @@
     }
 
     if (Tcl_InterpDeleted(ip)) {
-        DUMP2("ip(%lx) is already deleted", ip);
+        DUMP2("ip(%p) is already deleted", ip);
         return;
     }
 
 #if TCL_NAMESPACE_DEBUG
     if (ip_null_namespace(ip)) {
-        DUMP2("ip(%lx) has null namespace", ip);
+        DUMP2("ip(%p) has null namespace", ip);
         return;
     }
 #endif
Index: ruby_1_8_6/ext/socket/getnameinfo.c
===================================================================
--- ruby_1_8_6/ext/socket/getnameinfo.c	(revision 13199)
+++ ruby_1_8_6/ext/socket/getnameinfo.c	(revision 13200)
@@ -35,6 +35,7 @@
  */
 
 #include "config.h"
+#include <stdio.h>
 #include <sys/types.h>
 #ifndef _WIN32
 #if defined(__BEOS__)
@@ -51,15 +52,11 @@
 #endif
 #include <netdb.h>
 #if defined(HAVE_RESOLV_H)
-#ifdef _SX
-#include <stdio.h>
-#endif
 #include <resolv.h>
 #endif
 #endif
 #ifdef _WIN32
 #include <winsock2.h>
-#include <stdio.h>
 #define snprintf _snprintf
 #endif
 
Index: ruby_1_8_6/version.h
===================================================================
--- ruby_1_8_6/version.h	(revision 13199)
+++ ruby_1_8_6/version.h	(revision 13200)
@@ -2,7 +2,7 @@
 #define RUBY_RELEASE_DATE "2007-08-22"
 #define RUBY_VERSION_CODE 186
 #define RUBY_RELEASE_CODE 20070822
-#define RUBY_PATCHLEVEL 76
+#define RUBY_PATCHLEVEL 77
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8
Index: ruby_1_8_6/file.c
===================================================================
--- ruby_1_8_6/file.c	(revision 13199)
+++ ruby_1_8_6/file.c	(revision 13200)
@@ -2242,18 +2242,12 @@
     errno = 0;
 #endif
     if (rename(src, dst) < 0) {
-#if defined __CYGWIN__
-	extern unsigned long __attribute__((stdcall)) GetLastError(void);
-	if (errno == 0) {	/* This is a bug of old Cygwin */
-	    /* incorrect as cygwin errno, but the last resort */
-	    errno = GetLastError();
-	}
-#elif defined DOSISH && !defined _WIN32
-	if (errno == EEXIST
+#if defined DOSISH && !defined _WIN32
+	switch (errno) {
+	  case EEXIST:
 #if defined (__EMX__)
-	    || errno == EACCES
+	  case EACCES:
 #endif
-	    ) {
 	    if (chmod(dst, 0666) == 0 &&
 		unlink(dst) == 0 &&
 		rename(src, dst) == 0)
@@ -3132,8 +3126,10 @@
 # endif
 
 #ifdef __CYGWIN__
-static int
 #include <winerror.h>
+extern unsigned long __attribute__((stdcall)) GetLastError(void);
+
+static int
 cygwin_flock(int fd, int op)
 {
     int old_errno = errno;
Index: ruby_1_8_6/missing/strftime.c
===================================================================
--- ruby_1_8_6/missing/strftime.c	(revision 13199)
+++ ruby_1_8_6/missing/strftime.c	(revision 13200)
@@ -445,7 +445,7 @@
 			} else {
 				tbuf[0] = '+';
 			}
-			sprintf(tbuf+1, "%02d%02d", off/60, off%60);
+			sprintf(tbuf+1, "%02u%02u", (unsigned)off/60, (unsigned)off%60);
 			break;
 #endif /* MAILHEADER_EXT */
 

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

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