aboutsummaryrefslogtreecommitdiff
path: root/liolib.c
diff options
context:
space:
mode:
Diffstat (limited to 'liolib.c')
-rw-r--r--liolib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/liolib.c b/liolib.c
index a2d96ca0..419cbf83 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 1.97 2001/01/10 16:58:11 roberto Exp roberto $ 2** $Id: liolib.c,v 1.98 2001/01/11 18:59:03 roberto Exp roberto $
3** Standard I/O (and system) library 3** Standard I/O (and system) library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -87,11 +87,11 @@ static int pushresult (lua_State *L, int i) {
87 87
88 88
89static FILE *gethandle (lua_State *L, IOCtrl *ctrl, int f) { 89static FILE *gethandle (lua_State *L, IOCtrl *ctrl, int f) {
90 void *p = lua_touserdata(L, f); 90 FILE *p = (FILE *)lua_touserdata(L, f);
91 if (p != NULL) { /* is `f' a userdata ? */ 91 if (p != NULL) { /* is `f' a userdata ? */
92 int ftag = lua_tag(L, f); 92 int ftag = lua_tag(L, f);
93 if (ftag == ctrl->iotag) /* does it have the correct tag? */ 93 if (ftag == ctrl->iotag) /* does it have the correct tag? */
94 return (FILE *)p; 94 return p;
95 else if (ftag == ctrl->closedtag) 95 else if (ftag == ctrl->closedtag)
96 lua_error(L, "cannot access a closed file"); 96 lua_error(L, "cannot access a closed file");
97 /* else go through */ 97 /* else go through */
@@ -496,7 +496,7 @@ static int getfield (lua_State *L, const char *key, int d) {
496 lua_pushstring(L, key); 496 lua_pushstring(L, key);
497 lua_rawget(L, -2); 497 lua_rawget(L, -2);
498 if (lua_isnumber(L, -1)) 498 if (lua_isnumber(L, -1))
499 res = lua_tonumber(L, -1); 499 res = (int)lua_tonumber(L, -1);
500 else { 500 else {
501 if (d == -2) 501 if (d == -2)
502 luaL_verror(L, "field `%.20s' missing in date table", key); 502 luaL_verror(L, "field `%.20s' missing in date table", key);