aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/ltests.c b/ltests.c
index 1517aa88..e7bc66dd 100644
--- a/ltests.c
+++ b/ltests.c
@@ -910,9 +910,9 @@ static int get_limits (lua_State *L) {
910 910
911static int mem_query (lua_State *L) { 911static int mem_query (lua_State *L) {
912 if (lua_isnone(L, 1)) { 912 if (lua_isnone(L, 1)) {
913 lua_pushinteger(L, cast(lua_Integer, l_memcontrol.total)); 913 lua_pushinteger(L, cast_Integer(l_memcontrol.total));
914 lua_pushinteger(L, cast(lua_Integer, l_memcontrol.numblocks)); 914 lua_pushinteger(L, cast_Integer(l_memcontrol.numblocks));
915 lua_pushinteger(L, cast(lua_Integer, l_memcontrol.maxmem)); 915 lua_pushinteger(L, cast_Integer(l_memcontrol.maxmem));
916 return 3; 916 return 3;
917 } 917 }
918 else if (lua_isnumber(L, 1)) { 918 else if (lua_isnumber(L, 1)) {
@@ -926,7 +926,7 @@ static int mem_query (lua_State *L) {
926 int i; 926 int i;
927 for (i = LUA_NUMTYPES - 1; i >= 0; i--) { 927 for (i = LUA_NUMTYPES - 1; i >= 0; i--) {
928 if (strcmp(t, ttypename(i)) == 0) { 928 if (strcmp(t, ttypename(i)) == 0) {
929 lua_pushinteger(L, cast(lua_Integer, l_memcontrol.objcount[i])); 929 lua_pushinteger(L, cast_Integer(l_memcontrol.objcount[i]));
930 return 1; 930 return 1;
931 } 931 }
932 } 932 }
@@ -1074,7 +1074,7 @@ static int hash_query (lua_State *L) {
1074 Table *t; 1074 Table *t;
1075 luaL_checktype(L, 2, LUA_TTABLE); 1075 luaL_checktype(L, 2, LUA_TTABLE);
1076 t = hvalue(obj_at(L, 2)); 1076 t = hvalue(obj_at(L, 2));
1077 lua_pushinteger(L, cast(lua_Integer, luaH_mainposition(t, o) - t->node)); 1077 lua_pushinteger(L, cast_Integer(luaH_mainposition(t, o) - t->node));
1078 } 1078 }
1079 return 1; 1079 return 1;
1080} 1080}
@@ -1082,9 +1082,9 @@ static int hash_query (lua_State *L) {
1082 1082
1083static int stacklevel (lua_State *L) { 1083static int stacklevel (lua_State *L) {
1084 int a = 0; 1084 int a = 0;
1085 lua_pushinteger(L, cast(lua_Integer, L->top.p - L->stack.p)); 1085 lua_pushinteger(L, cast_Integer(L->top.p - L->stack.p));
1086 lua_pushinteger(L, stacksize(L)); 1086 lua_pushinteger(L, stacksize(L));
1087 lua_pushinteger(L, cast(lua_Integer, L->nCcalls)); 1087 lua_pushinteger(L, cast_Integer(L->nCcalls));
1088 lua_pushinteger(L, L->nci); 1088 lua_pushinteger(L, L->nci);
1089 lua_pushinteger(L, (lua_Integer)(size_t)&a); 1089 lua_pushinteger(L, (lua_Integer)(size_t)&a);
1090 return 5; 1090 return 5;
@@ -1099,9 +1099,9 @@ static int table_query (lua_State *L) {
1099 t = hvalue(obj_at(L, 1)); 1099 t = hvalue(obj_at(L, 1));
1100 asize = t->asize; 1100 asize = t->asize;
1101 if (i == -1) { 1101 if (i == -1) {
1102 lua_pushinteger(L, cast(lua_Integer, asize)); 1102 lua_pushinteger(L, cast_Integer(asize));
1103 lua_pushinteger(L, cast(lua_Integer, allocsizenode(t))); 1103 lua_pushinteger(L, cast_Integer(allocsizenode(t)));
1104 lua_pushinteger(L, cast(lua_Integer, asize > 0 ? *lenhint(t) : 0)); 1104 lua_pushinteger(L, cast_Integer(asize > 0 ? *lenhint(t) : 0));
1105 return 3; 1105 return 3;
1106 } 1106 }
1107 else if (cast_uint(i) < asize) { 1107 else if (cast_uint(i) < asize) {
@@ -1157,7 +1157,7 @@ static int test_codeparam (lua_State *L) {
1157static int test_applyparam (lua_State *L) { 1157static int test_applyparam (lua_State *L) {
1158 lua_Integer p = luaL_checkinteger(L, 1); 1158 lua_Integer p = luaL_checkinteger(L, 1);
1159 lua_Integer x = luaL_checkinteger(L, 2); 1159 lua_Integer x = luaL_checkinteger(L, 2);
1160 lua_pushinteger(L, cast(lua_Integer, luaO_applyparam(cast_byte(p), x))); 1160 lua_pushinteger(L, cast_Integer(luaO_applyparam(cast_byte(p), x)));
1161 return 1; 1161 return 1;
1162} 1162}
1163 1163
@@ -1257,7 +1257,7 @@ static int pushuserdata (lua_State *L) {
1257 1257
1258 1258
1259static int udataval (lua_State *L) { 1259static int udataval (lua_State *L) {
1260 lua_pushinteger(L, cast(lua_Integer, cast(size_t, lua_touserdata(L, 1)))); 1260 lua_pushinteger(L, cast_st2S(cast_sizet(lua_touserdata(L, 1))));
1261 return 1; 1261 return 1;
1262} 1262}
1263 1263
@@ -1294,7 +1294,7 @@ static int num2int (lua_State *L) {
1294 1294
1295 1295
1296static int makeseed (lua_State *L) { 1296static int makeseed (lua_State *L) {
1297 lua_pushinteger(L, cast(lua_Integer, luaL_makeseed(L))); 1297 lua_pushinteger(L, cast_Integer(luaL_makeseed(L)));
1298 return 1; 1298 return 1;
1299} 1299}
1300 1300
@@ -1638,7 +1638,7 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) {
1638 } 1638 }
1639 else if EQ("func2num") { 1639 else if EQ("func2num") {
1640 lua_CFunction func = lua_tocfunction(L1, getindex); 1640 lua_CFunction func = lua_tocfunction(L1, getindex);
1641 lua_pushinteger(L1, cast(lua_Integer, cast(size_t, func))); 1641 lua_pushinteger(L1, cast_st2S(cast_sizet(func)));
1642 } 1642 }
1643 else if EQ("getfield") { 1643 else if EQ("getfield") {
1644 int t = getindex; 1644 int t = getindex;
@@ -2011,7 +2011,7 @@ static int Cfunc (lua_State *L) {
2011static int Cfunck (lua_State *L, int status, lua_KContext ctx) { 2011static int Cfunck (lua_State *L, int status, lua_KContext ctx) {
2012 lua_pushstring(L, statcodes[status]); 2012 lua_pushstring(L, statcodes[status]);
2013 lua_setglobal(L, "status"); 2013 lua_setglobal(L, "status");
2014 lua_pushinteger(L, cast(lua_Integer, ctx)); 2014 lua_pushinteger(L, cast_Integer(ctx));
2015 lua_setglobal(L, "ctx"); 2015 lua_setglobal(L, "ctx");
2016 return runC(L, L, lua_tostring(L, cast_int(ctx))); 2016 return runC(L, L, lua_tostring(L, cast_int(ctx)));
2017} 2017}