mirror of
https://github.com/lua/lua.git
synced 2025-01-14 05:43:00 +08:00
C++ warning
This commit is contained in:
parent
0267168675
commit
4905fdd135
13
liolib.c
13
liolib.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: liolib.c,v 1.113 2001/06/06 18:00:19 roberto Exp roberto $
|
** $Id: liolib.c,v 1.114 2001/06/07 13:46:29 roberto Exp roberto $
|
||||||
** Standard I/O (and system) library
|
** Standard I/O (and system) library
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -135,13 +135,10 @@ static void resetfile (lua_State *L, int inout) {
|
|||||||
|
|
||||||
|
|
||||||
static int io_close (lua_State *L) {
|
static int io_close (lua_State *L) {
|
||||||
FILE *f;
|
FILE *f = (FILE *)luaL_check_userdata(L, 1, FILEHANDLE);
|
||||||
int status;
|
int status = 1;
|
||||||
lua_settop(L, 1);
|
if (f != stdin && f != stdout && f != stderr) {
|
||||||
f = luaL_check_userdata(L, 1, FILEHANDLE);
|
lua_settop(L, 1); /* make sure file is on top */
|
||||||
if (f == stdin || f == stdout || f == stderr)
|
|
||||||
status = 1;
|
|
||||||
else {
|
|
||||||
lua_settag(L, lua_name2tag(L, CLOSEDFILEHANDLE));
|
lua_settag(L, lua_name2tag(L, CLOSEDFILEHANDLE));
|
||||||
status = (CLOSEFILE(L, f) == 0);
|
status = (CLOSEFILE(L, f) == 0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user