diff options
author | Paul Gilbert | 2010-08-01 09:31:36 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-12 22:18:35 +0000 |
commit | 2006e564a1287ff31c2c6acedecf90034e784fd2 (patch) | |
tree | 4e1ebb10fedbd39f053691c3cd59b6157c545d37 /engines/sword25/script/luabindhelper.cpp | |
parent | 53a9d2d0a1dab1119dc1cc12886321fa72743061 (diff) | |
download | scummvm-rg350-2006e564a1287ff31c2c6acedecf90034e784fd2.tar.gz scummvm-rg350-2006e564a1287ff31c2c6acedecf90034e784fd2.tar.bz2 scummvm-rg350-2006e564a1287ff31c2c6acedecf90034e784fd2.zip |
SWORD25: Moved the Lua library into it's own namespace
Previously with some of the files I was leaving the #include references to the library inside the global namespace. However, since the engine itself is now inside a namespace, I had to do a lot of changes, such as lua_State to ::lua_State. This way is cleaner, and I just need to add a 'using namespace Lua' where needed.
svn-id: r53198
Diffstat (limited to 'engines/sword25/script/luabindhelper.cpp')
-rw-r--r-- | engines/sword25/script/luabindhelper.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/engines/sword25/script/luabindhelper.cpp b/engines/sword25/script/luabindhelper.cpp index 06e97ad2e2..f2182a6b11 100644 --- a/engines/sword25/script/luabindhelper.cpp +++ b/engines/sword25/script/luabindhelper.cpp @@ -48,7 +48,7 @@ namespace { const char * METATABLES_TABLE_NAME = "__METATABLES"; const char * PERMANENTS_TABLE_NAME = "Permanents"; - bool RegisterPermanent(::lua_State *L, const Common::String &Name) { + bool RegisterPermanent(lua_State *L, const Common::String &Name) { // A C function has to be on the stack if (!lua_iscfunction(L, -1)) return false; @@ -93,7 +93,7 @@ namespace Sword25 { * The array must be terminated with the enry (0, 0) * @return Returns true if successful, otherwise false. */ -bool BS_LuaBindhelper::AddFunctionsToLib(::lua_State *L, const Common::String &LibName, const luaL_reg *Functions) { +bool BS_LuaBindhelper::AddFunctionsToLib(lua_State *L, const Common::String &LibName, const luaL_reg *Functions) { #ifdef DEBUG int __startStackDepth = lua_gettop(L); #endif @@ -151,7 +151,7 @@ bool BS_LuaBindhelper::AddFunctionsToLib(::lua_State *L, const Common::String &L * The array must be terminated with the enry (0, 0) * @return Returns true if successful, otherwise false. */ -bool BS_LuaBindhelper::AddConstantsToLib(::lua_State *L, const Common::String &LibName, const lua_constant_reg *Constants) { +bool BS_LuaBindhelper::AddConstantsToLib(lua_State *L, const Common::String &LibName, const lua_constant_reg *Constants) { #ifdef DEBUG int __startStackDepth = lua_gettop(L); #endif @@ -198,7 +198,7 @@ bool BS_LuaBindhelper::AddConstantsToLib(::lua_State *L, const Common::String &L * The array must be terminated with the enry (0, 0) * @return Returns true if successful, otherwise false. */ -bool BS_LuaBindhelper::AddMethodsToClass(::lua_State *L, const Common::String &ClassName, const luaL_reg *Methods) { +bool BS_LuaBindhelper::AddMethodsToClass(lua_State *L, const Common::String &ClassName, const luaL_reg *Methods) { #ifdef DEBUG int __startStackDepth = lua_gettop(L); #endif @@ -238,7 +238,7 @@ bool BS_LuaBindhelper::AddMethodsToClass(::lua_State *L, const Common::String &C * @param GCHandler A function pointer * @return Returns true if successful, otherwise false. */ -bool BS_LuaBindhelper::SetClassGCHandler(::lua_State *L, const Common::String &ClassName, lua_CFunction GCHandler) { +bool BS_LuaBindhelper::SetClassGCHandler(lua_State *L, const Common::String &ClassName, lua_CFunction GCHandler) { #ifdef DEBUG int __startStackDepth = lua_gettop(L); #endif @@ -271,7 +271,7 @@ bool BS_LuaBindhelper::SetClassGCHandler(::lua_State *L, const Common::String &C // ----------------------------------------------------------------------------- namespace { - void PushMetatableTable(::lua_State *L) { + void PushMetatableTable(lua_State *L) { // Push the Metatable table onto the stack lua_getglobal(L, METATABLES_TABLE_NAME); @@ -290,7 +290,7 @@ namespace { namespace Sword25 { -bool BS_LuaBindhelper::GetMetatable(::lua_State *L, const Common::String &TableName) { +bool BS_LuaBindhelper::GetMetatable(lua_State *L, const Common::String &TableName) { // Push the Metatable table onto the stack PushMetatableTable(L); @@ -324,7 +324,7 @@ bool BS_LuaBindhelper::GetMetatable(::lua_State *L, const Common::String &TableN // ----------------------------------------------------------------------------- -bool BS_LuaBindhelper::_CreateTable(::lua_State *L, const Common::String &TableName) { +bool BS_LuaBindhelper::_CreateTable(lua_State *L, const Common::String &TableName) { const char *PartBegin = TableName.c_str(); while (PartBegin) { @@ -373,7 +373,7 @@ bool BS_LuaBindhelper::_CreateTable(::lua_State *L, const Common::String &TableN } // End of namespace Sword25 namespace { - Common::String GetLuaValueInfo(::lua_State *L, int StackIndex) { + Common::String GetLuaValueInfo(lua_State *L, int StackIndex) { switch (lua_type(L, StackIndex)) { case LUA_TNUMBER: lua_pushstring(L, lua_tostring(L, StackIndex)); @@ -405,7 +405,7 @@ namespace { namespace Sword25 { -Common::String BS_LuaBindhelper::StackDump(::lua_State *L) { +Common::String BS_LuaBindhelper::StackDump(lua_State *L) { Common::String oss; int i = lua_gettop(L); @@ -421,7 +421,7 @@ Common::String BS_LuaBindhelper::StackDump(::lua_State *L) { return oss; } -Common::String BS_LuaBindhelper::TableDump(::lua_State *L) { +Common::String BS_LuaBindhelper::TableDump(lua_State *L) { Common::String oss; oss += "------------------- Table Dump -------------------\n"; |