diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-21 10:48:44 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-21 10:48:44 -0300 |
commit | c67603fafba7f982e92eb870ff4da6c6433c2a85 (patch) | |
tree | 4f462d90c766a989e4a41d8bf62199554c7792ab /liolib.c | |
parent | 06865aa01d1a8bfcf9f2f4b5a71e37a2561eeea6 (diff) | |
download | lua-c67603fafba7f982e92eb870ff4da6c6433c2a85.tar.gz lua-c67603fafba7f982e92eb870ff4da6c6433c2a85.tar.bz2 lua-c67603fafba7f982e92eb870ff4da6c6433c2a85.zip |
using new 'lua_newuserdatauv' instead of 'lua_newuserdata'
Diffstat (limited to 'liolib.c')
-rw-r--r-- | liolib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 2.153 2017/11/16 13:19:06 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.154 2017/11/16 16:28:36 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 | */ |
@@ -186,7 +186,7 @@ static FILE *tofile (lua_State *L) { | |||
186 | ** handle is in a consistent state. | 186 | ** handle is in a consistent state. |
187 | */ | 187 | */ |
188 | static LStream *newprefile (lua_State *L) { | 188 | static LStream *newprefile (lua_State *L) { |
189 | LStream *p = (LStream *)lua_newuserdata(L, sizeof(LStream)); | 189 | LStream *p = (LStream *)lua_newuserdatauv(L, sizeof(LStream), 0); |
190 | p->closef = NULL; /* mark file handle as 'closed' */ | 190 | p->closef = NULL; /* mark file handle as 'closed' */ |
191 | luaL_setmetatable(L, LUA_FILEHANDLE); | 191 | luaL_setmetatable(L, LUA_FILEHANDLE); |
192 | return p; | 192 | return p; |