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

ruby-changes:15923

From: mame <ko1@a...>
Date: Mon, 17 May 2010 22:21:31 +0900 (JST)
Subject: [ruby-changes:15923] Ruby:r27864 (trunk): * process.c: suppress warning for signed and unsigned type

mame	2010-05-17 22:21:17 +0900 (Mon, 17 May 2010)

  New Revision: 27864

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

  Log:
    * process.c: suppress warning for signed and unsigned type
      inconsistency.
    
    * ext/psych/parser.c: ditto.
    
    * ext/sdbm/_sdbm.c: ditto.
    
    * ext/syck/rubyext.c: ditto.

  Modified files:
    trunk/ChangeLog
    trunk/ext/psych/parser.c
    trunk/ext/sdbm/_sdbm.c
    trunk/ext/syck/rubyext.c
    trunk/process.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 27863)
+++ ChangeLog	(revision 27864)
@@ -1,3 +1,14 @@
+Mon May 17 22:19:16 2010  Yusuke Endoh  <mame@t...>
+
+	* process.c: suppress warning for signed and unsigned type
+	  inconsistency.
+
+	* ext/psych/parser.c: ditto.
+
+	* ext/sdbm/_sdbm.c: ditto.
+
+	* ext/syck/rubyext.c: ditto.
+
 Mon May 17 21:30:50 2010  Yusuke Endoh  <mame@t...>
 
 	* .gitignore: updated.
Index: process.c
===================================================================
--- process.c	(revision 27863)
+++ process.c	(revision 27864)
@@ -4093,9 +4093,9 @@
 #endif
     } else { /* unprivileged user */
 #if defined(HAVE_SETRESUID)
-	if (setresuid((getuid() == uid)? -1: uid,
-		      (geteuid() == uid)? -1: uid,
-		      (SAVED_USER_ID == uid)? -1: uid) < 0) rb_sys_fail(0);
+	if (setresuid((getuid() == uid)? (rb_uid_t)-1: uid,
+		      (geteuid() == uid)? (rb_uid_t)-1: uid,
+		      (SAVED_USER_ID == uid)? (rb_uid_t)-1: uid) < 0) rb_sys_fail(0);
 	SAVED_USER_ID = uid;
 #elif defined(HAVE_SETREUID) && !defined(OBSOLETE_SETREUID)
 	if (SAVED_USER_ID == uid) {
@@ -4712,9 +4712,9 @@
 #endif
     } else { /* unprivileged user */
 #if defined(HAVE_SETRESGID)
-	if (setresgid((getgid() == gid)? -1: gid,
-		      (getegid() == gid)? -1: gid,
-		      (SAVED_GROUP_ID == gid)? -1: gid) < 0) rb_sys_fail(0);
+	if (setresgid((getgid() == gid)? (rb_gid_t)-1: gid,
+		      (getegid() == gid)? (rb_gid_t)-1: gid,
+		      (SAVED_GROUP_ID == gid)? (rb_gid_t)-1: gid) < 0) rb_sys_fail(0);
 	SAVED_GROUP_ID = gid;
 #elif defined(HAVE_SETREGID) && !defined(OBSOLETE_SETREGID)
 	if (SAVED_GROUP_ID == gid) {
Index: ext/sdbm/_sdbm.c
===================================================================
--- ext/sdbm/_sdbm.c	(revision 27863)
+++ ext/sdbm/_sdbm.c	(revision 27864)
@@ -861,7 +861,7 @@
 	register int off;
 	register short *ino = (short *) pag;
 
-	if ((n = GET_SHORT(ino,0)) < 0 || n > PBLKSIZ / sizeof(short))
+	if ((n = GET_SHORT(ino,0)) < 0 || n > PBLKSIZ / (int)sizeof(short))
 		return 0;
 
 	if (n > 0) {
Index: ext/psych/parser.c
===================================================================
--- ext/psych/parser.c	(revision 27863)
+++ ext/psych/parser.c	(revision 27864)
@@ -55,7 +55,7 @@
     int done = 0;
 #ifdef HAVE_RUBY_ENCODING_H
     int encoding = rb_enc_find_index("ASCII-8BIT");
-    rb_encoding * internal_enc;
+    rb_encoding * internal_enc = 0;
 #endif
     VALUE handler = rb_iv_get(self, "@handler");
 
Index: ext/syck/rubyext.c
===================================================================
--- ext/syck/rubyext.c	(revision 27863)
+++ ext/syck/rubyext.c	(revision 27864)
@@ -275,7 +275,7 @@
         char *end = ptr + 1;
         char *p = end;
         while ( isdigit( *end ) ) end++;
-        if (end - p < sizeof(padded)) {
+        if (end - p < (int)sizeof(padded)) {
             MEMCPY(padded, ptr + 1, char, end - (ptr + 1));
             p = padded;
         }

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

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