summaryrefslogtreecommitdiff
path: root/src/lib_string.c
diff options
context:
space:
mode:
authorMike Pall <mike>2011-02-17 00:44:14 +0100
committerMike Pall <mike>2011-02-17 00:44:14 +0100
commit03946ac978d9a1a3230619e3da048002e5fda2d1 (patch)
treec0a7b8edaccf789f128468320d451d9a1fee1495 /src/lib_string.c
parent963f05c7e153714921484e0de71a7cb6bab338d9 (diff)
downloadluajit2-03946ac978d9a1a3230619e3da048002e5fda2d1.tar.gz
DUALNUM: Add integer type to core VM.
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)
LJLIB_ASM(string_char)
{
- int i, nargs = cast_int(L->top - L->base);
+ int i, nargs = (int)(L->top - L->base);
char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, (size_t)nargs);
for (i = 1; i <= nargs; i++) {
int32_t k = lj_lib_checkint(L, i);
@@ -737,7 +737,7 @@ LJLIB_CF(string_format)
tv.n = lj_lib_checknum(L, arg);
if (LJ_UNLIKELY((tv.u32.hi << 1) >= 0xffe00000)) {
/* Canonicalize output of non-finite values. */
- char *p, nbuf[LUAI_MAXNUMBER2STR];
+ char *p, nbuf[LJ_STR_NUMBUF];
size_t len = lj_str_bufnum(nbuf, &tv);
if (strfrmt[-1] == 'E' || strfrmt[-1] == 'G') {
nbuf[len-3] = nbuf[len-3] - 0x20;
@@ -801,7 +801,7 @@ LUALIB_API int luaopen_string(lua_State *L)
g = G(L);
setgcref(basemt_it(g, LJ_TSTR), obj2gco(mt));
settabV(L, lj_tab_setstr(L, mt, mmname_str(g, MM_index)), tabV(L->top-1));
- mt->nomm = cast_byte(~(1u<<MM_index));
+ mt->nomm = (uint8_t)(~(1u<<MM_index));
return 1;
}