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

ruby-changes:30169

From: nobu <ko1@a...>
Date: Mon, 29 Jul 2013 06:54:46 +0900 (JST)
Subject: [ruby-changes:30169] nobu:r42221 (trunk): win32.c: use enum

nobu	2013-07-29 06:54:34 +0900 (Mon, 29 Jul 2013)

  New Revision: 42221

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

  Log:
    win32.c: use enum
    
    * win32/win32.c (rb_w32_pipe): use enum for compile time constants,
      instead of const int for debugging.

  Modified files:
    trunk/ChangeLog
    trunk/win32/win32.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42220)
+++ ChangeLog	(revision 42221)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Jul 29 06:54:30 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* win32/win32.c (rb_w32_pipe): use enum for compile time constants,
+	  instead of const int for debugging.
+
 Mon Jul 29 00:11:49 2013  Tanaka Akira  <akr@f...>
 
 	* bignum.c (bigdivrem): Specialized implementation added for
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 42220)
+++ win32/win32.c	(revision 42221)
@@ -5655,10 +5655,12 @@ rb_w32_pipe(int fds[2]) https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L5655
 {
     static DWORD serial = 0;
     static const char prefix[] = "\\\\.\\pipe\\ruby";
-    const int width_of_prefix = (int)sizeof(prefix) - 1;
-    const int width_of_pid = (int)sizeof(rb_pid_t) * 2;
-    const int width_of_serial = (int)sizeof(serial) * 2;
-    const int width_of_ids = width_of_pid + 1 + width_of_serial + 1;
+    enum {
+	width_of_prefix = (int)sizeof(prefix) - 1,
+	width_of_pid = (int)sizeof(rb_pid_t) * 2,
+	width_of_serial = (int)sizeof(serial) * 2,
+	width_of_ids = width_of_pid + 1 + width_of_serial + 1
+    };
     char name[sizeof(prefix) + width_of_ids];
     SECURITY_ATTRIBUTES sec;
     HANDLE hRead, hWrite, h;

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

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