From e181ae53918c09139e7f60bf5ad32741d91339cd Mon Sep 17 00:00:00 2001 From: mame Date: Mon, 17 May 2010 13:21:17 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 11 +++++++++++ ext/psych/parser.c | 2 +- ext/sdbm/_sdbm.c | 2 +- ext/syck/rubyext.c | 2 +- process.c | 12 ++++++------ 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 329f973d16..d92ba09d67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Mon May 17 22:19:16 2010 Yusuke Endoh + + * 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 * .gitignore: updated. diff --git a/ext/psych/parser.c b/ext/psych/parser.c index 0fa02b981f..eefb8e67bc 100644 --- a/ext/psych/parser.c +++ b/ext/psych/parser.c @@ -55,7 +55,7 @@ static VALUE parse(VALUE self, VALUE yaml) 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"); diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c index b1ffdc04f0..0df95ece8f 100644 --- a/ext/sdbm/_sdbm.c +++ b/ext/sdbm/_sdbm.c @@ -861,7 +861,7 @@ chkpage(char *pag) 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) { diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c index af52976ff1..cd5b4f2049 100644 --- a/ext/syck/rubyext.c +++ b/ext/syck/rubyext.c @@ -275,7 +275,7 @@ mktime_do(struct mktime_arg *arg) 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; } diff --git a/process.c b/process.c index 073b380f74..3145f617fc 100644 --- a/process.c +++ b/process.c @@ -4093,9 +4093,9 @@ p_uid_change_privilege(VALUE obj, VALUE id) #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 @@ p_gid_change_privilege(VALUE obj, VALUE id) #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) {