From f517fb54c76e2510b9bc0167ad64a5726bd3926c Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 4 Oct 2009 06:00:33 +0000 Subject: [PATCH] * pack.c (NATINT_LEN, pack_pack): suppressed warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ pack.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3fa2a82767..911fb6e801 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Oct 4 15:00:32 2009 Nobuyoshi Nakada + + * pack.c (NATINT_LEN, pack_pack): suppressed warnings. + Sun Oct 4 14:01:10 2009 Nobuyoshi Nakada * lib/rubygems.rb (Gem::binary_mode): binary mode uses binary diff --git a/pack.c b/pack.c index 172534404d..f1841ab89a 100644 --- a/pack.c +++ b/pack.c @@ -25,7 +25,7 @@ #ifdef NATINT_PACK # define OFF16B(p) ((char*)(p) + (natint?0:(sizeof(short) - SIZE16))) # define OFF32B(p) ((char*)(p) + (natint?0:(sizeof(long) - SIZE32))) -# define NATINT_LEN(type,len) (natint?sizeof(type):(len)) +# define NATINT_LEN(type,len) (natint?(int)sizeof(type):(int)(len)) # ifdef WORDS_BIGENDIAN # define OFF16(p) OFF16B(p) # define OFF32(p) OFF32B(p) @@ -35,7 +35,7 @@ # define NATINT_HTONS(x) (natint?htons(x):hton16(x)) # define NATINT_HTONL(x) (natint?htonl(x):hton32(x)) #else -# define NATINT_LEN(type,len) sizeof(type) +# define NATINT_LEN(type,len) ((int)sizeof(type)) # define NATINT_HTOVS(x) htovs(x) # define NATINT_HTOVL(x) htovl(x) # define NATINT_HTONS(x) htons(x) @@ -712,7 +712,7 @@ pack_pack(VALUE ary, VALUE fmt) int i; from = NEXTFROM; - i = num2i32(from); + i = (int)num2i32(from); rb_str_buf_cat(res, (char*)&i, sizeof(int)); } break;