ruby-changes:15161
From: muraken <ko1@a...>
Date: Thu, 25 Mar 2010 12:08:49 +0900 (JST)
Subject: [ruby-changes:15161] Ruby:r27040 (trunk): * bignum.c, node.h, strftime.c, enc/trans/utf8_mac.trans: added explicit casts for supplessing warnings.
muraken 2010-03-25 12:08:28 +0900 (Thu, 25 Mar 2010) New Revision: 27040 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27040 Log: * bignum.c, node.h, strftime.c, enc/trans/utf8_mac.trans: added explicit casts for supplessing warnings. Modified files: trunk/ChangeLog trunk/bignum.c trunk/enc/trans/utf8_mac.trans trunk/node.h trunk/strftime.c Index: ChangeLog =================================================================== --- ChangeLog (revision 27039) +++ ChangeLog (revision 27040) @@ -1,5 +1,10 @@ Thu Mar 25 11:34:00 2010 Kenta Murata <mrkn@m...> + * 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 <mrkn@m...> + * test/ruby/test_dir_m17n.rb: HFS+ escapes invalid byte sequences of filenames. Index: enc/trans/utf8_mac.trans =================================================================== --- enc/trans/utf8_mac.trans (revision 27039) +++ enc/trans/utf8_mac.trans (revision 27040) @@ -193,7 +193,7 @@ unsigned char *o, size_t osize) { struct from_utf8_mac_status *sp = statep; - int n = 0; + ssize_t n = 0; switch (l) { case 1: Index: strftime.c =================================================================== --- strftime.c (revision 27039) +++ strftime.c (revision 27040) @@ -197,7 +197,8 @@ const char *sp, *tp; auto char tbuf[100]; long off; - int i, w; + ptrdiff_t i; + int w; long y; static short first = 1; #ifdef POSIX_SEMANTICS @@ -411,12 +412,12 @@ case 'd': /* day of the month, 01 - 31 */ i = range(1, vtm->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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ #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 @@ i = 12; else if (i > 12) i -= 12; - FMT(' ', 2, "d", i); + FMT(' ', 2, "d", (int)i); continue; #endif Index: bignum.c =================================================================== --- bignum.c (revision 27039) +++ bignum.c (revision 27040) @@ -2397,7 +2397,7 @@ dd = 0; q = yds[ny-1]; - while ((q & (1UL<<(BITSPERDIG-1))) == 0) { + while ((q & (BDIGIT)(1UL<<(BITSPERDIG-1))) == 0) { q <<= 1UL; dd++; } Index: node.h =================================================================== --- node.h (revision 27039) +++ node.h (revision 27040) @@ -269,7 +269,7 @@ #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)<<NODE_TYPESHIFT)&NODE_TYPEMASK)) + RNODE(n)->flags=((RNODE(n)->flags&~NODE_TYPEMASK)|((((unsigned long)t)<<NODE_TYPESHIFT)&NODE_TYPEMASK)) #define NODE_LSHIFT (NODE_TYPESHIFT+7) #define NODE_LMASK (((SIGNED_VALUE)1<<(sizeof(VALUE)*CHAR_BIT-NODE_LSHIFT))-1) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/