* 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
This commit is contained in:
parent
b73ea4b64a
commit
85198c5e3c
@ -1,3 +1,9 @@
|
|||||||
|
Thu Aug 19 19:53:26 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* 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 <akr@fsij.org>
|
Thu Aug 19 19:28:47 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* thread_pthread.c (native_sleep): suppress a warning for platforms
|
* thread_pthread.c (native_sleep): suppress a warning for platforms
|
||||||
|
@ -333,7 +333,7 @@ ancillary_timestamp(VALUE self)
|
|||||||
struct bintime bt;
|
struct bintime bt;
|
||||||
VALUE d, timev;
|
VALUE d, timev;
|
||||||
memcpy((char*)&bt, RSTRING_PTR(data), sizeof(bt));
|
memcpy((char*)&bt, RSTRING_PTR(data), sizeof(bt));
|
||||||
d = ULL2NUM(0x100000000UL);
|
d = ULL2NUM(0x100000000ULL);
|
||||||
d = mul(d,d);
|
d = mul(d,d);
|
||||||
timev = add(TIMET2NUM(bt.sec), quo(ULL2NUM(bt.frac), d));
|
timev = add(TIMET2NUM(bt.sec), quo(ULL2NUM(bt.frac), d));
|
||||||
result = rb_time_num_new(timev, Qnil);
|
result = rb_time_num_new(timev, Qnil);
|
||||||
|
@ -908,7 +908,7 @@ addrinfo_initialize(int argc, VALUE *argv, VALUE self)
|
|||||||
static int
|
static int
|
||||||
get_afamily(struct sockaddr *addr, socklen_t len)
|
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;
|
return addr->sa_family;
|
||||||
else
|
else
|
||||||
return AF_UNSPEC;
|
return AF_UNSPEC;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user