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

ruby-changes:4595

From: ko1@a...
Date: Sun, 20 Apr 2008 13:12:46 +0900 (JST)
Subject: [ruby-changes:4595] akr - Ruby:r16089 (trunk): avoid warnings in copy_stream_body.

akr	2008-04-20 13:12:32 +0900 (Sun, 20 Apr 2008)

  New Revision: 16089

  Modified files:
    trunk/io.c

  Log:
    avoid warnings in copy_stream_body.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/io.c?r1=16089&r2=16088&diff_format=u

Index: io.c
===================================================================
--- io.c	(revision 16088)
+++ io.c	(revision 16089)
@@ -6630,7 +6630,7 @@
 {
     struct copy_stream_struct *stp = (struct copy_stream_struct *)arg;
     VALUE src_io, dst_io;
-    rb_io_t *src_fptr, *dst_fptr;
+    rb_io_t *src_fptr = 0, *dst_fptr = 0;
     int src_fd, dst_fd;
     char *src_path = 0, *dst_path = 0;
 
@@ -6652,7 +6652,6 @@
             src_fd = src_fptr->fd;
         }
         else {
-            src_fptr = 0;
             FilePathValue(stp->src);
             src_path = StringValueCStr(stp->src);
 #ifdef O_NOCTTY
@@ -6681,7 +6680,6 @@
             dst_fd = dst_fptr->fd;
         }
         else {
-            dst_fptr = 0;
             FilePathValue(stp->dst);
             dst_path = StringValueCStr(stp->dst);
 #ifdef O_NOCTTY
@@ -6695,7 +6693,7 @@
     }
     stp->dst_fd = dst_fd;
 
-    if (stp->src_fd == -1 || stp->dst_fd == -1) {
+    if (src_fd == -1 || dst_fd == -1) {
         return copy_stream_fallback(stp);
     }
 

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

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