summaryrefslogtreecommitdiff
path: root/src/lib_string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib_string.c')
-rw-r--r--src/lib_string.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib_string.c b/src/lib_string.c
index 0b1c98a9..61f73060 100644
--- a/src/lib_string.c
+++ b/src/lib_string.c
@@ -61,7 +61,7 @@ LJLIB_ASM(string_byte) LJLIB_REC(string_range 0)
61 61
62LJLIB_ASM(string_char) 62LJLIB_ASM(string_char)
63{ 63{
64 int i, nargs = cast_int(L->top - L->base); 64 int i, nargs = (int)(L->top - L->base);
65 char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, (size_t)nargs); 65 char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, (size_t)nargs);
66 for (i = 1; i <= nargs; i++) { 66 for (i = 1; i <= nargs; i++) {
67 int32_t k = lj_lib_checkint(L, i); 67 int32_t k = lj_lib_checkint(L, i);
@@ -737,7 +737,7 @@ LJLIB_CF(string_format)
737 tv.n = lj_lib_checknum(L, arg); 737 tv.n = lj_lib_checknum(L, arg);
738 if (LJ_UNLIKELY((tv.u32.hi << 1) >= 0xffe00000)) { 738 if (LJ_UNLIKELY((tv.u32.hi << 1) >= 0xffe00000)) {
739 /* Canonicalize output of non-finite values. */ 739 /* Canonicalize output of non-finite values. */
740 char *p, nbuf[LUAI_MAXNUMBER2STR]; 740 char *p, nbuf[LJ_STR_NUMBUF];
741 size_t len = lj_str_bufnum(nbuf, &tv); 741 size_t len = lj_str_bufnum(nbuf, &tv);
742 if (strfrmt[-1] == 'E' || strfrmt[-1] == 'G') { 742 if (strfrmt[-1] == 'E' || strfrmt[-1] == 'G') {
743 nbuf[len-3] = nbuf[len-3] - 0x20; 743 nbuf[len-3] = nbuf[len-3] - 0x20;
@@ -801,7 +801,7 @@ LUALIB_API int luaopen_string(lua_State *L)
801 g = G(L); 801 g = G(L);
802 setgcref(basemt_it(g, LJ_TSTR), obj2gco(mt)); 802 setgcref(basemt_it(g, LJ_TSTR), obj2gco(mt));
803 settabV(L, lj_tab_setstr(L, mt, mmname_str(g, MM_index)), tabV(L->top-1)); 803 settabV(L, lj_tab_setstr(L, mt, mmname_str(g, MM_index)), tabV(L->top-1));
804 mt->nomm = cast_byte(~(1u<<MM_index)); 804 mt->nomm = (uint8_t)(~(1u<<MM_index));
805 return 1; 805 return 1;
806} 806}
807 807