diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_strfmt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lj_strfmt.c b/src/lj_strfmt.c index b44350e7..0003de70 100644 --- a/src/lj_strfmt.c +++ b/src/lj_strfmt.c | |||
@@ -338,7 +338,7 @@ SBuf *lj_strfmt_putfnum_int(SBuf *sb, SFormat sf, lua_Number n) | |||
338 | { | 338 | { |
339 | int64_t k = (int64_t)n; | 339 | int64_t k = (int64_t)n; |
340 | if (checki32(k) && sf == STRFMT_INT) | 340 | if (checki32(k) && sf == STRFMT_INT) |
341 | return lj_strfmt_putint(sb, k); /* Shortcut for plain %d. */ | 341 | return lj_strfmt_putint(sb, (int32_t)k); /* Shortcut for plain %d. */ |
342 | else | 342 | else |
343 | return lj_strfmt_putfxint(sb, sf, (uint64_t)k); | 343 | return lj_strfmt_putfxint(sb, sf, (uint64_t)k); |
344 | } | 344 | } |
@@ -446,7 +446,7 @@ GCstr * LJ_FASTCALL lj_strfmt_char(lua_State *L, int c) | |||
446 | #endif | 446 | #endif |
447 | 447 | ||
448 | /* Raw conversion of object to string. */ | 448 | /* Raw conversion of object to string. */ |
449 | GCstr *lj_strfmt_obj(lua_State *L, cTValue *o) | 449 | GCstr * LJ_FASTCALL lj_strfmt_obj(lua_State *L, cTValue *o) |
450 | { | 450 | { |
451 | if (tvisstr(o)) { | 451 | if (tvisstr(o)) { |
452 | return strV(o); | 452 | return strV(o); |
@@ -460,7 +460,7 @@ GCstr *lj_strfmt_obj(lua_State *L, cTValue *o) | |||
460 | return lj_str_newlit(L, "true"); | 460 | return lj_str_newlit(L, "true"); |
461 | } else { | 461 | } else { |
462 | char buf[8+2+2+16], *p = buf; | 462 | char buf[8+2+2+16], *p = buf; |
463 | p = lj_buf_wmem(p, lj_typename(o), strlen(lj_typename(o))); | 463 | p = lj_buf_wmem(p, lj_typename(o), (MSize)strlen(lj_typename(o))); |
464 | *p++ = ':'; *p++ = ' '; | 464 | *p++ = ':'; *p++ = ' '; |
465 | if (tvisfunc(o) && isffunc(funcV(o))) { | 465 | if (tvisfunc(o) && isffunc(funcV(o))) { |
466 | p = lj_buf_wmem(p, "builtin#", 8); | 466 | p = lj_buf_wmem(p, "builtin#", 8); |
@@ -492,7 +492,7 @@ const char *lj_strfmt_pushvf(lua_State *L, const char *fmt, va_list argp) | |||
492 | FormatState fs; | 492 | FormatState fs; |
493 | SFormat sf; | 493 | SFormat sf; |
494 | GCstr *str; | 494 | GCstr *str; |
495 | lj_strfmt_init(&fs, fmt, strlen(fmt)); | 495 | lj_strfmt_init(&fs, fmt, (MSize)strlen(fmt)); |
496 | while ((sf = lj_strfmt_parse(&fs)) != STRFMT_EOF) { | 496 | while ((sf = lj_strfmt_parse(&fs)) != STRFMT_EOF) { |
497 | switch (STRFMT_TYPE(sf)) { | 497 | switch (STRFMT_TYPE(sf)) { |
498 | case STRFMT_LIT: | 498 | case STRFMT_LIT: |