summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog21
-rw-r--r--ext/bigdecimal/bigdecimal.c2
-rw-r--r--ext/digest/bubblebabble/bubblebabble.c2
-rw-r--r--ext/digest/digest.c2
-rw-r--r--ext/iconv/iconv.c4
-rw-r--r--ext/socket/raddrinfo.c2
-rw-r--r--ext/socket/socket.c2
-rw-r--r--ext/syck/emitter.c6
-rw-r--r--ext/zlib/zlib.c6
9 files changed, 34 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c569b6..f084bbd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+Fri Oct 16 13:20:39 2009 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c (VpMidRound): remove warnings.
+ patch from Charlie Savage. [ruby-core:22869]
+
+ * ext/digest/bubblebabble/bubblebabble.c (bubblebabble_str_new): ditto.
+
+ * ext/digest/digest.c (hexencode_str_new): ditto.
+
+ * ext/iconv/iconv.c (iconv_convert): ditto.
+
+ * ext/socket/socket.c (inspect_sockaddr): ditto.
+
+ * ext/socket/raddrinfo.c (sockaddr_obj): ditto.
+
+ * ext/syck/emitter.c (syck_emitter_write): ditto.
+
+ * ext/syck/emitter.c (syck_emitter_flush): ditto.
+
+ * ext/syck/emitter.c (syck_emit_tag): ditto.
+
Fri Oct 16 12:03:31 2009 NARUSE, Yui <naruse@ruby-lang.org>
* lib/csv.rb (CSV#raw_encoding): returns ASCII-8BIT when the io
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 4e60bae..6a7d9f2 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 3a03cec..10bde6f 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 c3e9546..4829708 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 81116b9..c4c6fd8 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 21cc953..0bf0e7e 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 a2e14b3..122ed70 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 73ff5d7..18f2cde 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 8f23bcf..0471b1f 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));