From a7e7cf82276d96ebc7827ec09d06eaae4c5610d0 Mon Sep 17 00:00:00 2001 From: Pixel Date: Thu, 28 May 2009 19:57:04 -0700 Subject: Uniformizing the usage of luarecast. --- lib/LuaHandle.cc | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'lib/LuaHandle.cc') 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(); 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(); (*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(); 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(); 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(); 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(); 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(1); + d = L->recast(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(); 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(); 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(); 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(1); + d = L->recast(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(1); + d = L->recast(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(1); + d = L->recast(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(1); + d = L->recast(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(); off = L->tonumber(2); @@ -667,7 +667,7 @@ int sLuaHandle::bindex(lua_State * __L) { return 1; } - b = (Buffer *) LuaObject::getme(L); + b = L->recast(); 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(); (*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(); 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(); 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(); h->reset(); return 0; } -- cgit v1.2.3