From e4d8dc5c46679eeba87fff52504e290385300aed Mon Sep 17 00:00:00 2001 From: muraken Date: Thu, 25 Mar 2010 03:08:28 +0000 Subject: * bignum.c, node.h, strftime.c, enc/trans/utf8_mac.trans: added explicit casts for supplessing warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ bignum.c | 2 +- enc/trans/utf8_mac.trans | 2 +- node.h | 2 +- strftime.c | 23 ++++++++++++----------- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82307b0eaf..2815220821 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Mar 25 11:34:00 2010 Kenta Murata + + * bignum.c, node.h, strftime.c, enc/trans/utf8_mac.trans: + added explicit casts for supplessing warnings. + Thu Mar 25 11:34:00 2010 Kenta Murata * test/ruby/test_dir_m17n.rb: HFS+ escapes invalid byte sequences of diff --git a/bignum.c b/bignum.c index e79e5f4888..63635a62e5 100644 --- a/bignum.c +++ b/bignum.c @@ -2397,7 +2397,7 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp) dd = 0; q = yds[ny-1]; - while ((q & (1UL<<(BITSPERDIG-1))) == 0) { + while ((q & (BDIGIT)(1UL<<(BITSPERDIG-1))) == 0) { q <<= 1UL; dd++; } diff --git a/enc/trans/utf8_mac.trans b/enc/trans/utf8_mac.trans index ecda465355..3ceb07eeb4 100644 --- a/enc/trans/utf8_mac.trans +++ b/enc/trans/utf8_mac.trans @@ -193,7 +193,7 @@ fun_so_from_utf8_mac(void *statep, unsigned char *o, size_t osize) { struct from_utf8_mac_status *sp = statep; - int n = 0; + ssize_t n = 0; switch (l) { case 1: diff --git a/node.h b/node.h index 4eb3ded7a2..f8cf7de7b2 100644 --- a/node.h +++ b/node.h @@ -269,7 +269,7 @@ typedef struct RNode { #define nd_type(n) ((int) (((RNODE(n))->flags & NODE_TYPEMASK)>>NODE_TYPESHIFT)) #define nd_set_type(n,t) \ - RNODE(n)->flags=((RNODE(n)->flags&~NODE_TYPEMASK)|(((t)<flags=((RNODE(n)->flags&~NODE_TYPEMASK)|((((unsigned long)t)<mday, 31); - FMT('0', 2, "d", i); + FMT('0', 2, "d", (int)i); continue; case 'H': /* hour, 24-hour clock, 00 - 23 */ i = range(0, vtm->hour, 23); - FMT('0', 2, "d", i); + FMT('0', 2, "d", (int)i); continue; case 'I': /* hour, 12-hour clock, 01 - 12 */ @@ -425,7 +426,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct vtm *vtm, i = 12; else if (i > 12) i -= 12; - FMT('0', 2, "d", i); + FMT('0', 2, "d", (int)i); continue; case 'j': /* day of the year, 001 - 366 */ @@ -434,12 +435,12 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct vtm *vtm, case 'm': /* month, 01 - 12 */ i = range(1, vtm->mon, 12); - FMT('0', 2, "d", i); + FMT('0', 2, "d", (int)i); continue; case 'M': /* minute, 00 - 59 */ i = range(0, vtm->min, 59); - FMT('0', 2, "d", i); + FMT('0', 2, "d", (int)i); continue; case 'p': /* AM or PM based on 12-hour clock */ @@ -466,7 +467,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct vtm *vtm, case 'S': /* second, 00 - 60 */ i = range(0, vtm->sec, 60); - FMT('0', 2, "d", i); + FMT('0', 2, "d", (int)i); continue; case 'U': /* week of year, Sunday is first day of week */ @@ -475,7 +476,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct vtm *vtm, case 'w': /* weekday, Sunday == 0, 0 - 6 */ i = range(0, vtm->wday, 6); - FMT('0', 1, "d", i); + FMT('0', 1, "d", (int)i); continue; case 'W': /* week of year, Monday is first day of week */ @@ -492,7 +493,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct vtm *vtm, case 'y': /* year without a century, 00 - 99 */ i = NUM2INT(mod(vtm->year, INT2FIX(100))); - FMT('0', 2, "d", i); + FMT('0', 2, "d", (int)i); continue; case 'Y': /* year with century */ @@ -658,7 +659,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct vtm *vtm, #ifdef SUNOS_EXT case 'k': /* hour, 24-hour clock, blank pad */ i = range(0, vtm->hour, 23); - FMT(' ', 2, "d", i); + FMT(' ', 2, "d", (int)i); continue; case 'l': /* hour, 12-hour clock, 1 - 12, blank pad */ @@ -667,7 +668,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct vtm *vtm, i = 12; else if (i > 12) i -= 12; - FMT(' ', 2, "d", i); + FMT(' ', 2, "d", (int)i); continue; #endif -- cgit v1.2.3