From 7b5330896ff3eb26d9871654a9a2c2f04eb723b4 Mon Sep 17 00:00:00 2001 From: spx Date: Sun, 30 Jan 2011 15:44:48 +0000 Subject: [PATCH] Code cleanup. --- Library/lua/LuaManager.cpp | 38 +++++++++++++++++++------------------- Library/lua/LuaManager.h | 6 +++--- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Library/lua/LuaManager.cpp b/Library/lua/LuaManager.cpp index 727c68d6..20382e56 100644 --- a/Library/lua/LuaManager.cpp +++ b/Library/lua/LuaManager.cpp @@ -12,44 +12,44 @@ #include "lua_rainmeter_ext.h" -int LuaManager::m_RefCount = 0; -lua_State* LuaManager::m_pState = 0; +int LuaManager::c_RefCount = 0; +lua_State* LuaManager::c_pState = 0; void LuaManager::Init() { - if (m_pState == 0) + if (c_pState == 0) { // initialize Lua - m_pState = lua_open(); + c_pState = lua_open(); //load Lua base libraries - luaL_openlibs(m_pState); + luaL_openlibs(c_pState); - tolua_measure_open(m_pState); - tolua_group_open(m_pState); - tolua_meter_open(m_pState); - tolua_meterwindow_open(m_pState); - tolua_rainmeter_open(m_pState); - tolua_meter_string_open(m_pState); - //tolua_meter_image_open(m_pState); + tolua_measure_open(c_pState); + tolua_group_open(c_pState); + tolua_meter_open(c_pState); + tolua_meterwindow_open(c_pState); + tolua_rainmeter_open(c_pState); + tolua_meter_string_open(c_pState); + //tolua_meter_image_open(c_pState); - luaopen_rainmeter_ext(m_pState); + luaopen_rainmeter_ext(c_pState); } - ++m_RefCount; + ++c_RefCount; } void LuaManager::CleanUp() { - if (m_RefCount > 0) + if (c_RefCount > 0) { - --m_RefCount; + --c_RefCount; } - if (m_RefCount == 0 && m_pState != 0) + if (c_RefCount == 0 && c_pState != 0) { - lua_close(m_pState); - m_pState = 0; + lua_close(c_pState); + c_pState = 0; } } diff --git a/Library/lua/LuaManager.h b/Library/lua/LuaManager.h index b7282d98..cd6cf97f 100644 --- a/Library/lua/LuaManager.h +++ b/Library/lua/LuaManager.h @@ -12,7 +12,7 @@ public: static void CleanUp(); - static lua_State* GetState() { return m_pState; } + static lua_State* GetState() { return c_pState; } static void ReportErrors(lua_State * L); @@ -20,9 +20,9 @@ public: protected: - static int m_RefCount; + static int c_RefCount; - static lua_State* m_pState; + static lua_State* c_pState; }; #endif