Commit 4c839e7f authored by 神楽坂玲奈's avatar 神楽坂玲奈

clean abuse of ptr/int32, support 64-bit environment.

parent fa1036f1
......@@ -8,13 +8,13 @@
#ifndef COMMON_H_
#define COMMON_H_
typedef unsigned long uptr;
typedef void* uptr;
typedef unsigned long long uint64;
typedef unsigned int uint32;
typedef unsigned short uint16;
typedef unsigned char uint8;
typedef unsigned char byte;
typedef long ptr;
typedef void* ptr;
typedef long long int64;
typedef int int32;
typedef short int16;
......
......@@ -156,10 +156,10 @@ struct processor_unit {
uint16 step;
effect* peffect;
group* ptarget;
ptr arg1;
ptr arg2;
ptr arg3;
ptr arg4;
int32 arg1;
int32 arg2;
int32 arg3;
int32 arg4;
void* ptr1;
void* ptr2;
......@@ -266,7 +266,7 @@ struct processor {
std::unordered_map<uint32, uint32> spsummon_once_map[2];
std::multimap<int32, card*, std::greater<int32>> xmaterial_lst;
ptr temp_var[4];
int32 temp_var[4];
uint32 global_flag;
uint16 pre_field[2];
std::set<uint16> opp_mzone;
......@@ -522,7 +522,7 @@ public:
int32 check_spself_from_hand_trigger(const chain& ch) const;
int32 is_able_to_enter_bp();
void add_process(uint16 type, uint16 step, effect* peffect, group* target, ptr arg1, ptr arg2, ptr arg3 = 0, ptr arg4 = 0, void* ptr1 = NULL, void* ptr2 = NULL);
void add_process(uint16 type, uint16 step, effect* peffect, group* target, int32 arg1, int32 arg2, int32 arg3 = 0, int32 arg4 = 0, void* ptr1 = NULL, void* ptr2 = NULL);
int32 process();
int32 execute_cost(uint16 step, effect* peffect, uint8 triggering_player);
int32 execute_operation(uint16 step, effect* peffect, uint8 triggering_player);
......
......@@ -171,7 +171,7 @@ void interpreter::add_param(void *param, int32 type, bool front) {
else
params.emplace_back(param, type);
}
void interpreter::add_param(ptr param, int32 type, bool front) {
void interpreter::add_param(int32 param, int32 type, bool front) {
if(front)
params.emplace_front((void*)param, type);
else
......@@ -184,7 +184,7 @@ void interpreter::push_param(lua_State* L, bool is_coroutine) {
uint32 type = it.second;
switch(type) {
case PARAM_TYPE_INT:
lua_pushinteger(L, (ptr) it.first);
lua_pushinteger(L, (int32) it.first);
break;
case PARAM_TYPE_STRING:
lua_pushstring(L, (const char *) it.first);
......
......@@ -50,7 +50,7 @@ public:
int32 load_script(const char* script_name);
int32 load_card_script(uint32 code);
void add_param(void* param, int32 type, bool front = false);
void add_param(ptr param, int32 type, bool front = false);
void add_param(int32 param, int32 type, bool front = false);
void push_param(lua_State* L, bool is_coroutine = false);
int32 call_function(int32 f, uint32 param_count, int32 ret_count);
int32 call_card_function(card* pcard, const char* f, uint32 param_count, int32 ret_count);
......
......@@ -14,7 +14,7 @@
#include "ocgapi.h"
#include <iterator>
void field::add_process(uint16 type, uint16 step, effect* peffect, group* target, ptr arg1, ptr arg2, ptr arg3, ptr arg4, void* ptr1, void* ptr2) {
void field::add_process(uint16 type, uint16 step, effect* peffect, group* target, int32 arg1, int32 arg2, int32 arg3, int32 arg4, void* ptr1, void* ptr2) {
processor_unit new_unit;
new_unit.type = type;
new_unit.step = step;
......
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