diff options
Diffstat (limited to 'lib/LuaHandle.cc')
-rw-r--r-- | lib/LuaHandle.cc | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/lib/LuaHandle.cc b/lib/LuaHandle.cc index 29af5d7..472f3d6 100644 --- a/lib/LuaHandle.cc +++ b/lib/LuaHandle.cc @@ -172,7 +172,7 @@ int sLuaHandle::read(lua_State * __L) { t = L->tonumber(); b = (Byte *) malloc(t); - h = (Handle *) LuaObject::getme(L); + h = L->recast<Handle>(); L->newtable(); @@ -201,7 +201,7 @@ int sLuaHandle::readstring(lua_State * __L) { L->error("Incorrect arguments to method `Headle::readstring'"); } - h = (Handle *) LuaObject::getme(L); + h = L->recast<Handle>(); (*h) >> r; @@ -248,7 +248,7 @@ int sLuaHandle::write(lua_State * __L) { t = L->tonumber(); b = (Byte *) malloc(t); - h = (Handle *) LuaObject::getme(L); + h = L->recast<Handle>(); for (i = 0; i < t; i++) { L->push((lua_Number) i); @@ -276,7 +276,7 @@ int sLuaHandle::writestring(lua_State * __L) { L->error("Incorrect arguments to method `Headle::writestring'"); } - h = (Handle *) LuaObject::getme(L); + h = L->recast<Handle>(); r = L->tostring(); (*h) << r; @@ -314,7 +314,7 @@ int sLuaHandle::read(lua_State * __L, int t) { L->error("Incorrect arguments to method `Headle::readUx'"); } - h = (Handle *) LuaObject::getme(L); + h = L->recast<Handle>(); switch (t) { case U8: r = h->readU8(); break; @@ -339,7 +339,7 @@ int sLuaHandle::write(lua_State * __L, int t) { L->error("Incorrect arguments to method `Headle::writeUx'"); } - h = (Handle *) LuaObject::getme(L); + h = L->recast<Handle>(); r = L->tonumber(); switch (t) { @@ -371,8 +371,8 @@ int sLuaHandle::copy(lua_State * __L, int dir) { L->error("Incorrect arguments to function `handlecopy'"); } - s = (Handle *) LuaObject::getme(L, 1); - d = (Handle *) LuaObject::getme(L, 2); + s = L->recast<Handle>(1); + d = L->recast<Handle>(2); if (n == 3) { r = L->tonumber(); @@ -423,7 +423,7 @@ int sLuaHandle::getcaps(lua_State * __L, int cap) { L->error("Incorrect arguments to method `Handle::getcaps'"); } - h = (Handle *) LuaObject::getme(L); + h = L->recast<Handle>(); switch (cap) { case capisclosed: r = h->IsClosed(); break; @@ -477,7 +477,7 @@ int sLuaHandle::action(lua_State * __L, int act) { L->error("Incorrect arguments to method `Handle::action'"); } - h = (Handle *) LuaObject::getme(L); + h = L->recast<Handle>(); switch (act) { case Asetnonblock: r = 0; h->SetNonBlock(); break; @@ -502,7 +502,7 @@ int sLuaHandle::setz(lua_State * __L) { L->error("Incorrect arguments to method `Handle::setz'"); } - h = (Handle *) LuaObject::getme(L); + h = L->recast<Handle>(); if (n == 2) { z = L->tonumber(2); @@ -555,8 +555,8 @@ int sLuaHandle::zlib_inflate(lua_State * __L) { L->error("Incorrect arguments to method `Handle::zlib_inflate'"); } - s = (Handle *) LuaObject::getme(L, 1); - d = (Handle *) LuaObject::getme(L, 2); + s = L->recast<Handle>(1); + d = L->recast<Handle>(2); r = Handle::zlib_inflate(s, d); @@ -575,8 +575,8 @@ int sLuaHandle::zlib_deflate(lua_State * __L) { L->error("Incorrect arguments to method `Handle::zlib_deflate'"); } - s = (Handle *) LuaObject::getme(L, 1); - d = (Handle *) LuaObject::getme(L, 2); + s = L->recast<Handle>(1); + d = L->recast<Handle>(2); r = Handle::zlib_deflate(s, d); @@ -596,8 +596,8 @@ int sLuaHandle::ucl_compress(lua_State * __L) { L->error("Incorrect arguments to method `Handle::ucl_compress'"); } - s = (Handle *) LuaObject::getme(L, 1); - d = (Handle *) LuaObject::getme(L, 2); + s = L->recast<Handle>(1); + d = L->recast<Handle>(2); r = Handle::ucl_compress(s, d); @@ -616,8 +616,8 @@ int sLuaHandle::ucl_decompress(lua_State * __L) { L->error("Incorrect arguments to method `Handle::ucl_decompress'"); } - s = (Handle *) LuaObject::getme(L, 1); - d = (Handle *) LuaObject::getme(L, 2); + s = L->recast<Handle>(1); + d = L->recast<Handle>(2); r = Handle::ucl_decompress(s, d); @@ -638,7 +638,7 @@ int sLuaHandle::seek(lua_State * __L) { L->error("Incorrect arguments to method `Handle::seek'"); } - h = (Handle *) LuaObject::getme(L); + h = L->recast<Handle>(); off = L->tonumber(2); @@ -667,7 +667,7 @@ int sLuaHandle::bindex(lua_State * __L) { return 1; } - b = (Buffer *) LuaObject::getme(L); + b = L->recast<Buffer>(); L->push((lua_Number) (*b)[L->tonumber()]); @@ -692,7 +692,7 @@ int sLuaHandle::bnewindex(lua_State * __L) { L->error("Can't write a non-number to buffer"); } - b = (Buffer *) LuaObject::getme(L); + b = L->recast<Buffer>(); (*b)[L->tonumber(2)] = L->tonumber(3); @@ -708,7 +708,7 @@ int sLuaHandle::btell(lua_State * __L) { L->error("Incorrect arguments to method `Buffer::wtell'"); } - h = (Buffer *) LuaObject::getme(L); + h = L->recast<Buffer>(); L->push((lua_Number) h->wtell()); return 1; } @@ -724,7 +724,7 @@ int sLuaHandle::bseek(lua_State * __L) { L->error("Incorrect arguments to method `Buffer::wseek'"); } - h = (Buffer *) LuaObject::getme(L); + h = L->recast<Buffer>(); off = L->tonumber(2); @@ -748,7 +748,7 @@ int sLuaHandle::breset(lua_State * __L) { L->error("Incorrect arguments to method `Buffer::reset'"); } - h = (Buffer *) LuaObject::getme(L); + h = L->recast<Buffer>(); h->reset(); return 0; } |