summaryrefslogtreecommitdiff
path: root/strftime.c
diff options
context:
space:
mode:
authormuraken <muraken@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-25 03:08:28 +0000
committermuraken <muraken@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-25 03:08:28 +0000
commite4d8dc5c46679eeba87fff52504e290385300aed (patch)
tree4a89d22d3fe5344aa77f48a16005047d5acc3629 /strftime.c
parent31bc607cf183193a151584afea3a6ca8d40506e2 (diff)
* 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
Diffstat (limited to 'strftime.c')
-rw-r--r--strftime.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/strftime.c b/strftime.c
index db6591b77d..f03d546669 100644
--- a/strftime.c
+++ b/strftime.c
@@ -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