Commit 6d38a9a1 authored by salix5's avatar salix5

cast int to void*

parent 2c6c0589
...@@ -173,9 +173,9 @@ void interpreter::add_param(void *param, int32 type, bool front) { ...@@ -173,9 +173,9 @@ void interpreter::add_param(void *param, int32 type, bool front) {
} }
void interpreter::add_param(int32 param, int32 type, bool front) { void interpreter::add_param(int32 param, int32 type, bool front) {
if(front) if(front)
params.emplace_front((void*)param, type); params.emplace_front((void*)(intptr_t)param, type);
else else
params.emplace_back((void*)param, type); params.emplace_back((void*)(intptr_t)param, type);
} }
void interpreter::push_param(lua_State* L, bool is_coroutine) { void interpreter::push_param(lua_State* L, bool is_coroutine) {
int32 pushed = 0; int32 pushed = 0;
...@@ -190,7 +190,7 @@ void interpreter::push_param(lua_State* L, bool is_coroutine) { ...@@ -190,7 +190,7 @@ void interpreter::push_param(lua_State* L, bool is_coroutine) {
lua_pushstring(L, (const char *)it.first); lua_pushstring(L, (const char *)it.first);
break; break;
case PARAM_TYPE_BOOLEAN: case PARAM_TYPE_BOOLEAN:
lua_pushboolean(L, (int32)it.first); lua_pushboolean(L, (int32)(intptr_t)it.first);
break; break;
case PARAM_TYPE_CARD: { case PARAM_TYPE_CARD: {
if (it.first) if (it.first)
...@@ -214,11 +214,11 @@ void interpreter::push_param(lua_State* L, bool is_coroutine) { ...@@ -214,11 +214,11 @@ void interpreter::push_param(lua_State* L, bool is_coroutine) {
break; break;
} }
case PARAM_TYPE_FUNCTION: { case PARAM_TYPE_FUNCTION: {
function2value(L, (int32)it.first); function2value(L, (int32)(intptr_t)it.first);
break; break;
} }
case PARAM_TYPE_INDEX: { case PARAM_TYPE_INDEX: {
int32 index = (int32)it.first; int32 index = (int32)(intptr_t)it.first;
if(index > 0) if(index > 0)
lua_pushvalue(L, index); lua_pushvalue(L, index);
else if(is_coroutine) { else if(is_coroutine) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment