Cosmetics.

This commit is contained in:
Birunthan Mohanathas
2012-03-09 10:41:46 +00:00
parent 7767300379
commit ad2a986e88
6 changed files with 15 additions and 24 deletions

View File

@ -29,8 +29,7 @@ inline CMeasure* GetSelf(lua_State* L)
static int GetName(lua_State* L)
{
CMeasure* self = GetSelf(L);
const WCHAR* val = (const WCHAR*)self->GetName();
LuaManager::PushWide(L, val);
LuaManager::PushWide(L, self->GetName());
return 1;
}
@ -93,8 +92,7 @@ static int Enable(lua_State* L)
static int GetValue(lua_State* L)
{
CMeasure* self = GetSelf(L);
double val = (double)self->GetValue();
lua_pushnumber(L, (lua_Number)val);
lua_pushnumber(L, self->GetValue());
return 1;
}
@ -102,8 +100,7 @@ static int GetValue(lua_State* L)
static int GetRelativeValue(lua_State* L)
{
CMeasure* self = GetSelf(L);
double val = (double)self->GetRelativeValue();
lua_pushnumber(L, (lua_Number)val);
lua_pushnumber(L, self->GetRelativeValue());
return 1;
}
@ -111,8 +108,7 @@ static int GetRelativeValue(lua_State* L)
static int GetValueRange(lua_State* L)
{
CMeasure* self = GetSelf(L);
double val = (double)self->GetValueRange();
lua_pushnumber(L, (lua_Number)val);
lua_pushnumber(L, self->GetValueRange());
return 1;
}
@ -120,8 +116,7 @@ static int GetValueRange(lua_State* L)
static int GetMinValue(lua_State* L)
{
CMeasure* self = GetSelf(L);
double val = (double)self->GetMinValue();
lua_pushnumber(L, (lua_Number)val);
lua_pushnumber(L, self->GetMinValue());
return 1;
}
@ -129,8 +124,7 @@ static int GetMinValue(lua_State* L)
static int GetMaxValue(lua_State* L)
{
CMeasure* self = GetSelf(L);
double val = (double)self->GetMaxValue();
lua_pushnumber(L, (lua_Number)val);
lua_pushnumber(L, self->GetMaxValue());
return 1;
}

View File

@ -29,8 +29,7 @@ inline CMeter* GetSelf(lua_State* L)
static int GetName(lua_State* L)
{
CMeter* self = GetSelf(L);
const WCHAR* val = (const WCHAR*)self->GetName();
LuaManager::PushWide(L, val);
LuaManager::PushWide(L, self->GetName());
return 1;
}
@ -138,7 +137,6 @@ static int Show(lua_State* L)
static int SetText(lua_State* L)
{
CMeter* self = GetSelf(L);
if (CMeterString* stringMeter = dynamic_cast<CMeterString*>(self))
{
std::wstring str = LuaManager::ToWide(L, 2);

View File

@ -169,7 +169,7 @@ static int GetY(lua_State* L)
static int MakePathAbsolute(lua_State* L)
{
CMeterWindow* self = *(CMeterWindow**)lua_touserdata(L, 1);
CMeterWindow* self = GetSelf(L);
std::wstring path = LuaManager::ToWide(L, 2);
self->MakePathAbsolute(path);
LuaManager::PushWide(L, path.c_str());