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

ruby-changes:36646

From: normal <ko1@a...>
Date: Sat, 6 Dec 2014 10:10:14 +0900 (JST)
Subject: [ruby-changes:36646] normal:r48727 (trunk): thread.c (do_select): rename parameters to avoid shadowing

normal	2014-12-06 10:10:06 +0900 (Sat, 06 Dec 2014)

  New Revision: 48727

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

  Log:
    thread.c (do_select): rename parameters to avoid shadowing
    
    Sometimes we may use write(2) syscalls for debugging inside
    this function.

  Modified files:
    trunk/ChangeLog
    trunk/thread.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48726)
+++ ChangeLog	(revision 48727)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Dec  6 10:09:44 2014  Eric Wong  <e@8...>
+
+	* thread.c (do_select): rename parameters to avoid shadowing
+
 Sat Dec  6 09:22:45 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
 
 	* lib/rake:  Update to rake 10.4.2
Index: thread.c
===================================================================
--- thread.c	(revision 48726)
+++ thread.c	(revision 48727)
@@ -3412,8 +3412,8 @@ rb_fd_set(int fd, rb_fdset_t *set) https://github.com/ruby/ruby/blob/trunk/thread.c#L3412
 #endif
 
 static int
-do_select(int n, rb_fdset_t *read, rb_fdset_t *write, rb_fdset_t *except,
-	  struct timeval *timeout)
+do_select(int n, rb_fdset_t *readfds, rb_fdset_t *writefds,
+	  rb_fdset_t *exceptfds, struct timeval *timeout)
 {
     int UNINITIALIZED_VAR(result);
     int lerrno;
@@ -3431,18 +3431,19 @@ do_select(int n, rb_fdset_t *read, rb_fd https://github.com/ruby/ruby/blob/trunk/thread.c#L3431
 	timeout = &wait_rest;
     }
 
-    if (read)
-	rb_fd_init_copy(&orig_read, read);
-    if (write)
-	rb_fd_init_copy(&orig_write, write);
-    if (except)
-	rb_fd_init_copy(&orig_except, except);
+    if (readfds)
+	rb_fd_init_copy(&orig_read, readfds);
+    if (writefds)
+	rb_fd_init_copy(&orig_write, writefds);
+    if (exceptfds)
+	rb_fd_init_copy(&orig_except, exceptfds);
 
   retry:
     lerrno = 0;
 
     BLOCKING_REGION({
-	    result = native_fd_select(n, read, write, except, timeout, th);
+	    result = native_fd_select(n, readfds, writefds, exceptfds,
+				      timeout, th);
 	    if (result < 0) lerrno = errno;
 	}, ubf_select, th, FALSE);
 
@@ -3456,12 +3457,12 @@ do_select(int n, rb_fdset_t *read, rb_fd https://github.com/ruby/ruby/blob/trunk/thread.c#L3457
 #ifdef ERESTART
 	  case ERESTART:
 #endif
-	    if (read)
-		rb_fd_dup(read, &orig_read);
-	    if (write)
-		rb_fd_dup(write, &orig_write);
-	    if (except)
-		rb_fd_dup(except, &orig_except);
+	    if (readfds)
+		rb_fd_dup(readfds, &orig_read);
+	    if (writefds)
+		rb_fd_dup(writefds, &orig_write);
+	    if (exceptfds)
+		rb_fd_dup(exceptfds, &orig_except);
 
 	    if (timeout) {
 		double d = limit - timeofday();
@@ -3478,11 +3479,11 @@ do_select(int n, rb_fdset_t *read, rb_fd https://github.com/ruby/ruby/blob/trunk/thread.c#L3479
 	}
     }
 
-    if (read)
+    if (readfds)
 	rb_fd_term(&orig_read);
-    if (write)
+    if (writefds)
 	rb_fd_term(&orig_write);
-    if (except)
+    if (exceptfds)
 	rb_fd_term(&orig_except);
 
     return result;

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

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