diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-18 13:59:09 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-18 13:59:09 -0200 |
| commit | f2c451d7455aad3496f32dfa2bfca7f7e8b5376d (patch) | |
| tree | 38e30f839516ff5b6178351750b5e3256f4dd98e /liolib.c | |
| parent | 619edfd9e4c210bdfcfbf1e911d1760c53c4293f (diff) | |
| download | lua-f2c451d7455aad3496f32dfa2bfca7f7e8b5376d.tar.gz lua-f2c451d7455aad3496f32dfa2bfca7f7e8b5376d.tar.bz2 lua-f2c451d7455aad3496f32dfa2bfca7f7e8b5376d.zip | |
all accesses to TObjects done through macros
Diffstat (limited to 'liolib.c')
| -rw-r--r-- | liolib.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -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 | ||
| 89 | static FILE *gethandle (lua_State *L, IOCtrl *ctrl, int f) { | 89 | static 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); |
