* 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
This commit is contained in:
muraken 2010-03-25 03:08:28 +00:00
Родитель 31bc607cf1
Коммит e4d8dc5c46
5 изменённых файлов: 20 добавлений и 14 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Thu Mar 25 11:34:00 2010 Kenta Murata <mrkn@mrkn.jp>
* 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@mrkn.jp>
* test/ruby/test_dir_m17n.rb: HFS+ escapes invalid byte sequences of

Просмотреть файл

@ -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++;
}

Просмотреть файл

@ -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:

2
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)<<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)

Просмотреть файл

@ -197,7 +197,8 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct vtm *vtm,
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 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct vtm *vtm,
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 @@ 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