From 85198c5e3cf702a333cf1acfbbbe8e925419e148 Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 19 Aug 2010 10:54:56 +0000 Subject: [PATCH] * ext/socket/ancdata.c (ancillary_timestamp): fix a constant type. * ext/socket/raddrinfo.c (get_afamily): suppress a warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ ext/socket/ancdata.c | 2 +- ext/socket/raddrinfo.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26ffef94a2..5cca7bfb67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Aug 19 19:53:26 2010 Tanaka Akira + + * ext/socket/ancdata.c (ancillary_timestamp): fix a constant type. + + * ext/socket/raddrinfo.c (get_afamily): suppress a warning. + Thu Aug 19 19:28:47 2010 Tanaka Akira * thread_pthread.c (native_sleep): suppress a warning for platforms diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c index b58e03c712..045b68e9bc 100644 --- a/ext/socket/ancdata.c +++ b/ext/socket/ancdata.c @@ -333,7 +333,7 @@ ancillary_timestamp(VALUE self) struct bintime bt; VALUE d, timev; memcpy((char*)&bt, RSTRING_PTR(data), sizeof(bt)); - d = ULL2NUM(0x100000000UL); + d = ULL2NUM(0x100000000ULL); d = mul(d,d); timev = add(TIMET2NUM(bt.sec), quo(ULL2NUM(bt.frac), d)); result = rb_time_num_new(timev, Qnil); diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c index c386bb9003..5638c9ec2b 100644 --- a/ext/socket/raddrinfo.c +++ b/ext/socket/raddrinfo.c @@ -908,7 +908,7 @@ addrinfo_initialize(int argc, VALUE *argv, VALUE self) static int get_afamily(struct sockaddr *addr, socklen_t len) { - if ((char*)&addr->sa_family + sizeof(addr->sa_family) - (char*)addr <= len) + if ((socklen_t)((char*)&addr->sa_family + sizeof(addr->sa_family) - (char*)addr) <= len) return addr->sa_family; else return AF_UNSPEC;