Skip to content

Commit 02e2990

Browse files
committed
backport runtime fixes from dead-end no-global-values branch
1 parent 92530ce commit 02e2990

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

titan-runtime/titan.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ const TValue *getgeneric (Table *t, const TValue *key) {
206206
}
207207

208208
/* Builtin foreign functions */
209-
int titan_print(lua_State *L, int nargs, ...) {
209+
int titan_print(lua_State *L, CClosure *_mod, int nargs, ...) {
210210
if(nargs > 0) {
211211
lua_checkstack(L, 3);
212212
TValue *top = L->top;
@@ -228,14 +228,14 @@ int titan_print(lua_State *L, int nargs, ...) {
228228
return 0;
229229
}
230230

231-
TValue titan_assert(lua_State *L, TValue cond, TString *msg) {
231+
TValue titan_assert(lua_State *L, CClosure *_mod, TValue cond, TString *msg) {
232232
if(l_isfalse(&cond)) {
233233
luaL_error(L, getstr(msg));
234234
}
235235
return cond;
236236
}
237237

238-
Table *titan_dofile(lua_State *L, TString *fname, int nargs, ...) {
238+
Table *titan_dofile(lua_State *L, CClosure *_mod, TString *fname, int nargs, ...) {
239239
TValue *top = L->top;
240240
lua_checkstack(L, 2 + nargs);
241241
lua_createtable(L, 0, 0);
@@ -262,11 +262,11 @@ Table *titan_dofile(lua_State *L, TString *fname, int nargs, ...) {
262262
return tres;
263263
}
264264

265-
int titan_error(lua_State *L, TString *msg) {
265+
int titan_error(lua_State *L, CClosure *_mod, TString *msg) {
266266
return luaL_error(L, getstr(msg));
267267
}
268268

269-
Table *titan_dostring(lua_State *L, TString *code, int nargs, ...) {
269+
Table *titan_dostring(lua_State *L, CClosure *_mod, TString *code, int nargs, ...) {
270270
TValue *top = L->top;
271271
lua_checkstack(L, 2 + nargs);
272272
lua_createtable(L, 0, 0);
@@ -293,7 +293,7 @@ Table *titan_dostring(lua_State *L, TString *code, int nargs, ...) {
293293
return tres;
294294
}
295295

296-
TString *titan_tostring(lua_State *L, TValue val) {
296+
TString *titan_tostring(lua_State *L, CClosure *_mod, TValue val) {
297297
TValue *top = L->top;
298298
lua_checkstack(L, 3);
299299
L->top++;
@@ -305,7 +305,7 @@ TString *titan_tostring(lua_State *L, TValue val) {
305305
return s;
306306
}
307307

308-
lua_Number titan_tofloat(lua_State *L, TString *s) {
308+
lua_Number titan_tofloat(lua_State *L, CClosure *_mod, TString *s) {
309309
TValue val;
310310
if(luaO_str2num(getstr(s), &val)) {
311311
return nvalue(&val);
@@ -314,7 +314,7 @@ lua_Number titan_tofloat(lua_State *L, TString *s) {
314314
}
315315
}
316316

317-
lua_Integer titan_tointeger(lua_State *L, TString *s) {
317+
lua_Integer titan_tointeger(lua_State *L, CClosure *_mod, TString *s) {
318318
TValue val;
319319
if(luaO_str2num(getstr(s), &val)) {
320320
lua_Integer res;
@@ -328,7 +328,7 @@ lua_Integer titan_tointeger(lua_State *L, TString *s) {
328328
}
329329
}
330330

331-
lua_Integer titan_string_byte(lua_State *L, TString *s, lua_Integer index) {
331+
lua_Integer titan_string_byte(lua_State *L, CClosure *_mod, TString *s, lua_Integer index) {
332332
size_t len = tsslen(s);
333333
if(index == 0)
334334
return 0;

0 commit comments

Comments
 (0)