aboutsummaryrefslogtreecommitdiff
path: root/src/lua/thread/luaopen_thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/thread/luaopen_thread.cpp')
-rw-r--r--src/lua/thread/luaopen_thread.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lua/thread/luaopen_thread.cpp b/src/lua/thread/luaopen_thread.cpp
index 2b4d01d..0d87907 100644
--- a/src/lua/thread/luaopen_thread.cpp
+++ b/src/lua/thread/luaopen_thread.cpp
@@ -30,7 +30,7 @@ namespace lua
ref.retain();
proxy->bind(&ref, JIN_THREAD_THREAD);
luax_setfield(L, -2, "_curThread");
- luax_dostring(L, (*ref).code.c_str());
+ luax_dostring(L, ref->code.c_str());
luax_close(L);
return 0;
}
@@ -45,7 +45,7 @@ namespace lua
static int l_start(lua_State* L)
{
Ref<Thread>& ref = checkThread(L);
- bool result = (*ref).start(&ref);
+ bool result = ref->start(&ref);
luax_pushboolean(L, result);
return 1;
}
@@ -53,7 +53,7 @@ namespace lua
static int l_wait(lua_State* L)
{
Ref<Thread>& ref = checkThread(L);
- (*ref).wait();
+ ref->wait();
return 0;
}
@@ -65,27 +65,27 @@ namespace lua
if (luax_isnumberstrict(L, vp))
{
float real = luax_checknumber(L, vp);
- (*ref).send(slot, real);
+ ref->send(slot, real);
}
else if (luax_isbooleanstrict(L, vp))
{
bool bol = luax_checkbool(L, vp);
- (*ref).send(slot, bol);
+ ref->send(slot, bol);
}
else if (luax_isstringstrict(L, vp))
{
const char* str = luax_checkstring(L, vp);
- (*ref).send(slot, str);
+ ref->send(slot, str);
}
else if (luax_isuserdata(L, vp))
{
void* p = luax_touserdata(L, vp);
- (*ref).send(slot, p);
+ ref->send(slot, p);
}
else if (luax_islightuserdata(L, vp))
{
void* p = luax_tolightuserdata(L, vp);
- (*ref).send(slot, p);
+ ref->send(slot, p);
}
return 0;
}
@@ -94,7 +94,7 @@ namespace lua
{
Ref<Thread>& ref = checkThread(L);
int slot = luax_checkinteger(L, 2);
- bool result = (*ref).receive(slot);
+ bool result = ref->receive(slot);
luax_pushboolean(L, result);
return 1;
}
@@ -103,7 +103,7 @@ namespace lua
{
Ref<Thread>& ref = checkThread(L);
int slot = luax_checkinteger(L, 2);
- Thread::Variant v = (*ref).fetch(slot);
+ Thread::Variant v = ref->fetch(slot);
switch (v.type)
{
case thread::Thread::Variant::INTERGER:
@@ -137,7 +137,7 @@ namespace lua
{
Ref<Thread>& ref = checkThread(L);
int slot = luax_checkinteger(L, 2);
- Thread::Variant v = (*ref).demand(slot);
+ Thread::Variant v = ref->demand(slot);
switch (v.type)
{
case thread::Thread::Variant::INTERGER:
@@ -171,14 +171,14 @@ namespace lua
{
Ref<Thread>& ref = checkThread(L);
int slot = luax_checkinteger(L, 2);
- (*ref).remove(slot);
+ ref->remove(slot);
return 0;
}
static int l_getName(lua_State* L)
{
Ref<Thread>& ref = checkThread(L);
- const char* name = (*ref).getName();
+ const char* name = ref->getName();
luax_pushstring(L, name);
return 1;
}
@@ -186,7 +186,7 @@ namespace lua
static int l_isRunning(lua_State* L)
{
Ref<Thread>& ref = checkThread(L);
- bool running = (*ref).isRunning();
+ bool running = ref->isRunning();
luax_pushboolean(L, running);
return 1;
}