mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
3 changed files with 8 additions and 2 deletions
|
@ -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>
|
||||
|
||||
* thread_pthread.c (native_sleep): suppress a warning for platforms
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue