diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 2 | ||||
-rw-r--r-- | ext/digest/bubblebabble/bubblebabble.c | 2 | ||||
-rw-r--r-- | ext/digest/digest.c | 2 | ||||
-rw-r--r-- | ext/iconv/iconv.c | 4 | ||||
-rw-r--r-- | ext/socket/raddrinfo.c | 2 | ||||
-rw-r--r-- | ext/socket/socket.c | 2 | ||||
-rw-r--r-- | ext/syck/emitter.c | 6 | ||||
-rw-r--r-- | ext/zlib/zlib.c | 6 |
8 files changed, 13 insertions, 13 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 4e60bae173..6a7d9f2e7e 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -4497,7 +4497,7 @@ VpMidRound(Real *y, int f, int nf) div = v/10; v = v - div*10; if (fracf == 0) { - for(i=ix+1;i<y->Prec;i++) { + for(i=ix+1;(U_LONG)i<y->Prec;i++) { if (y->frac[i]%BASE) { fracf = 1; break; diff --git a/ext/digest/bubblebabble/bubblebabble.c b/ext/digest/bubblebabble/bubblebabble.c index 3a03ceced0..10bde6ff71 100644 --- a/ext/digest/bubblebabble/bubblebabble.c +++ b/ext/digest/bubblebabble/bubblebabble.c @@ -23,7 +23,7 @@ bubblebabble_str_new(VALUE str_digest) size_t digest_len; VALUE str; char *p; - int i, j, seed = 1; + size_t i, j, seed = 1; static const char vowels[] = { 'a', 'e', 'i', 'o', 'u', 'y' }; diff --git a/ext/digest/digest.c b/ext/digest/digest.c index c3e9546ab4..48297082f0 100644 --- a/ext/digest/digest.c +++ b/ext/digest/digest.c @@ -36,7 +36,7 @@ hexencode_str_new(VALUE str_digest) { char *digest; size_t digest_len; - int i; + size_t i; VALUE str; char *p; static const char hex[] = { diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 81116b9b78..c4c6fd8124 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -467,8 +467,8 @@ iconv_convert(iconv_t cd, VALUE str, long start, long length, int toidx, struct if (0 <= outlen && outlen <= sizeof(buffer)) { outlen = sizeof(buffer) - outlen; if (NIL_P(error) || /* something converted */ - outlen > inptr - tmpstart || /* input can't contain output */ - (outlen < inptr - tmpstart && inlen > 0) || /* something skipped */ + outlen > (size_t)(inptr - tmpstart) || /* input can't contain output */ + (outlen < (size_t)(inptr - tmpstart) && inlen > 0) || /* something skipped */ memcmp(buffer, tmpstart, outlen)) /* something differs */ { if (NIL_P(str)) { diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c index 21cc953e1f..0bf0e7e14c 100644 --- a/ext/socket/raddrinfo.c +++ b/ext/socket/raddrinfo.c @@ -887,7 +887,7 @@ inspect_sockaddr(VALUE addrinfo, VALUE ret) if (rai->sockaddr_len == 0) { rb_str_cat2(ret, "empty-sockaddr"); } - else if (rai->sockaddr_len < ((char*)&rai->addr.ss_family + sizeof(rai->addr.ss_family)) - (char*)&rai->addr) + else if ((long)rai->sockaddr_len < ((char*)&rai->addr.ss_family + sizeof(rai->addr.ss_family)) - (char*)&rai->addr) rb_str_cat2(ret, "too-short-sockaddr"); else { switch (rai->addr.ss_family) { diff --git a/ext/socket/socket.c b/ext/socket/socket.c index a2e14b32d2..122ed70561 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -1458,7 +1458,7 @@ sockaddr_obj(struct sockaddr *addr) break; } #ifdef SA_LEN - if (len < SA_LEN(addr)) + if (len < (socklen_t)SA_LEN(addr)) len = SA_LEN(addr); #endif diff --git a/ext/syck/emitter.c b/ext/syck/emitter.c index 73ff5d7a0b..18f2cdefef 100644 --- a/ext/syck/emitter.c +++ b/ext/syck/emitter.c @@ -294,7 +294,7 @@ syck_emitter_write( SyckEmitter *e, const char *str, long len ) * Flush if at end of buffer */ at = e->marker - e->buffer; - if ( len + at >= e->bufsize ) + if ( len + at >= (long)e->bufsize ) { syck_emitter_flush( e, 0 ); for (;;) { @@ -326,7 +326,7 @@ syck_emitter_flush( SyckEmitter *e, long check_room ) */ if ( check_room > 0 ) { - if ( e->bufsize > ( e->marker - e->buffer ) + check_room ) + if ( (long)e->bufsize > ( e->marker - e->buffer ) + check_room ) { return; } @@ -459,7 +459,7 @@ void syck_emit_tag( SyckEmitter *e, const char *tag, const char *ignore ) const char *subd = tag + 4; while ( *subd != ':' && *subd != '\0' ) subd++; if ( *subd == ':' ) { - if ( subd - tag > ( strlen( YAML_DOMAIN ) + 5 ) && + if ( subd - tag > ( (long)( strlen( YAML_DOMAIN ) + 5 )) && strncmp( subd - strlen( YAML_DOMAIN ), YAML_DOMAIN, strlen( YAML_DOMAIN ) ) == 0 ) { syck_emitter_write( e, tag + 4, subd - strlen( YAML_DOMAIN ) - ( tag + 4 ) - 1 ); syck_emitter_write( e, "/", 1 ); diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 8f23bcff21..0471b1f006 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -497,7 +497,7 @@ zstream_append_buffer(struct zstream *z, const Bytef *src, int len) z->stream.avail_out = 0; } else { - if (z->stream.avail_out >= len) { + if (z->stream.avail_out >= (uInt)len) { z->stream.avail_out -= len; } else { @@ -609,7 +609,7 @@ zstream_append_input(struct zstream *z, const Bytef *src, unsigned int len) static void zstream_discard_input(struct zstream *z, unsigned int len) { - if (NIL_P(z->input) || RSTRING_LEN(z->input) <= len) { + if (NIL_P(z->input) || (unsigned int)RSTRING_LEN(z->input) <= len) { z->input = Qnil; } else { @@ -1921,7 +1921,7 @@ gzfile_make_header(struct gzfile *gz) buf[1] = GZ_MAGIC2; buf[2] = GZ_METHOD_DEFLATE; buf[3] = flags; - gzfile_set32(gz->mtime, &buf[4]); + gzfile_set32((unsigned long)gz->mtime, &buf[4]); buf[8] = extraflags; buf[9] = gz->os_code; zstream_append_buffer(&gz->z, buf, sizeof(buf)); |