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

ruby-changes:25231

From: naruse <ko1@a...>
Date: Mon, 22 Oct 2012 09:48:58 +0900 (JST)
Subject: [ruby-changes:25231] naruse:r37283 (trunk): Supress warnings: unused variables

naruse	2012-10-22 09:47:50 +0900 (Mon, 22 Oct 2012)

  New Revision: 37283

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

  Log:
    Supress warnings: unused variables

  Modified files:
    trunk/ext/pty/pty.c
    trunk/ext/socket/ancdata.c

Index: ext/pty/pty.c
===================================================================
--- ext/pty/pty.c	(revision 37282)
+++ ext/pty/pty.c	(revision 37283)
@@ -223,7 +223,6 @@
     int masterfd = -1, slavefd = -1;
     char *slavedevice;
     struct sigaction dfl, old;
-    int flags;
 
     dfl.sa_handler = SIG_DFL;
     dfl.sa_flags = 0;
@@ -238,14 +237,16 @@
     if (grantpt(masterfd) == -1) goto grantpt_error;
     rb_fd_fix_cloexec(masterfd);
 #else
-    flags = O_RDWR|O_NOCTTY;
+    {
+	int flags = O_RDWR|O_NOCTTY;
 # if defined(O_CLOEXEC)
-    /* glibc posix_openpt() in GNU/Linux calls open("/dev/ptmx", flags) internally.
-     * So version dependency on GNU/Linux is same as O_CLOEXEC with open().
-     * O_CLOEXEC is available since Linux 2.6.23.  Linux 2.6.18 silently ignore it. */
-    flags |= O_CLOEXEC;
+	/* glibc posix_openpt() in GNU/Linux calls open("/dev/ptmx", flags) internally.
+	 * So version dependency on GNU/Linux is same as O_CLOEXEC with open().
+	 * O_CLOEXEC is available since Linux 2.6.23.  Linux 2.6.18 silently ignore it. */
+	flags |= O_CLOEXEC;
 # endif
-    if ((masterfd = posix_openpt(flags)) == -1) goto error;
+	if ((masterfd = posix_openpt(flags)) == -1) goto error;
+    }
     rb_fd_fix_cloexec(masterfd);
     if (sigaction(SIGCHLD, &dfl, &old) == -1) goto error;
     if (grantpt(masterfd) == -1) goto grantpt_error;
Index: ext/socket/ancdata.c
===================================================================
--- ext/socket/ancdata.c	(revision 37282)
+++ ext/socket/ancdata.c	(revision 37283)
@@ -1163,8 +1163,10 @@
 #if defined(HAVE_ST_MSG_CONTROL)
 	int i;
 	size_t last_pad = 0;
+#if defined(__NetBSD__)
         int last_level = 0;
         int last_type = 0;
+#endif
         controls_str = rb_str_tmp_new(0);
         for (i = 0; i < controls_num; i++) {
             VALUE elt = controls_ptr[i], v;
@@ -1203,8 +1205,10 @@
             cmh.cmsg_len = (socklen_t)CMSG_LEN(RSTRING_LEN(cdata));
             MEMCPY(cmsg, &cmh, char, sizeof(cmh));
             MEMCPY(cmsg+((char*)CMSG_DATA(&cmh)-(char*)&cmh), RSTRING_PTR(cdata), char, RSTRING_LEN(cdata));
+#if defined(__NetBSD__)
             last_level = cmh.cmsg_level;
             last_type = cmh.cmsg_type;
+#endif
 	    last_pad = cspace - cmh.cmsg_len;
         }
 	if (last_pad) {

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

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