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

ruby-changes:11290

From: nobu <ko1@a...>
Date: Thu, 12 Mar 2009 05:23:03 +0900 (JST)
Subject: [ruby-changes:11290] Ruby:r22902 (trunk): * io.c (copy_stream_fallback_body): off_t may be larger than long.

nobu	2009-03-12 05:22:52 +0900 (Thu, 12 Mar 2009)

  New Revision: 22902

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

  Log:
    * io.c (copy_stream_fallback_body): off_t may be larger than long.

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 22901)
+++ ChangeLog	(revision 22902)
@@ -1,5 +1,7 @@
-Thu Mar 12 05:19:22 2009  Nobuyoshi Nakada  <nobu@r...>
+Thu Mar 12 05:22:50 2009  Nobuyoshi Nakada  <nobu@r...>
 
+	* io.c (copy_stream_fallback_body): off_t may be larger than long.
+
 	* iseq.c (rb_iseq_disasm): RSTRING_LEN() returns long.
 
 	* process.c (rb_f_sleep): time() needs time_t.
Index: io.c
===================================================================
--- io.c	(revision 22901)
+++ io.c	(revision 22902)
@@ -5448,7 +5448,7 @@
         if (close(fptr->fd) < 0)
             rb_sys_fail_path(fptr->pathv);
         fptr->fd = -1;
-       fptr->fd = rb_sysopen(fptr->pathv, oflags, 0666);
+        fptr->fd = rb_sysopen(fptr->pathv, oflags, 0666);
     }
 
     return file;
@@ -7726,7 +7726,7 @@
     const int buflen = 16*1024;
     VALUE n;
     VALUE buf = rb_str_buf_new(buflen);
-    long rest = stp->copy_length;
+    off_t rest = stp->copy_length;
     off_t off = stp->src_offset;
     ID read_method = id_readpartial;
 
@@ -7745,7 +7745,7 @@
         else {
             if (rest == 0)
                 break;
-            l = buflen < rest ? buflen : rest;
+            l = buflen < rest ? buflen : (long)rest;
         }
         if (stp->src_fd == -1) {
             rb_funcall(stp->src, read_method, 2, INT2FIX(l), buf);

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

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