Commit 2c6c0589 authored by salix5's avatar salix5

minor fix

parent b1cc5c18
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#ifndef COMMON_H_ #ifndef COMMON_H_
#define COMMON_H_ #define COMMON_H_
#include <cstdint>
typedef unsigned long long uint64; typedef unsigned long long uint64;
typedef unsigned int uint32; typedef unsigned int uint32;
typedef unsigned short uint16; typedef unsigned short uint16;
......
...@@ -184,13 +184,13 @@ void interpreter::push_param(lua_State* L, bool is_coroutine) { ...@@ -184,13 +184,13 @@ void interpreter::push_param(lua_State* L, bool is_coroutine) {
uint32 type = it.second; uint32 type = it.second;
switch(type) { switch(type) {
case PARAM_TYPE_INT: case PARAM_TYPE_INT:
lua_pushinteger(L, (size_t) it.first); lua_pushinteger(L, (lua_Integer)it.first);
break; break;
case PARAM_TYPE_STRING: case PARAM_TYPE_STRING:
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, (size_t)it.first); lua_pushboolean(L, (int32)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, (size_t)it.first); function2value(L, (int32)it.first);
break; break;
} }
case PARAM_TYPE_INDEX: { case PARAM_TYPE_INDEX: {
int32 index = (size_t)it.first; int32 index = (int32)it.first;
if(index > 0) if(index > 0)
lua_pushvalue(L, index); lua_pushvalue(L, index);
else if(is_coroutine) { else if(is_coroutine) {
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#define OCGAPI_H_ #define OCGAPI_H_
#include "common.h" #include "common.h"
#include <cstdint>
#ifdef WIN32 #ifdef WIN32
#define DECL_DLLEXPORT __declspec(dllexport) #define DECL_DLLEXPORT __declspec(dllexport)
...@@ -36,22 +35,22 @@ byte* read_script(const char* script_name, int* len); ...@@ -36,22 +35,22 @@ byte* read_script(const char* script_name, int* len);
uint32 read_card(uint32 code, card_data* data); uint32 read_card(uint32 code, card_data* data);
uint32 handle_message(void* pduel, uint32 message_type); uint32 handle_message(void* pduel, uint32 message_type);
extern "C" DECL_DLLEXPORT std::intptr_t create_duel(uint32 seed); extern "C" DECL_DLLEXPORT intptr_t create_duel(uint32 seed);
extern "C" DECL_DLLEXPORT void start_duel(std::intptr_t pduel, int32 options); extern "C" DECL_DLLEXPORT void start_duel(intptr_t pduel, int32 options);
extern "C" DECL_DLLEXPORT void end_duel(std::intptr_t pduel); extern "C" DECL_DLLEXPORT void end_duel(intptr_t pduel);
extern "C" DECL_DLLEXPORT void set_player_info(std::intptr_t pduel, int32 playerid, int32 lp, int32 startcount, int32 drawcount); extern "C" DECL_DLLEXPORT void set_player_info(intptr_t pduel, int32 playerid, int32 lp, int32 startcount, int32 drawcount);
extern "C" DECL_DLLEXPORT void get_log_message(std::intptr_t pduel, byte* buf); extern "C" DECL_DLLEXPORT void get_log_message(intptr_t pduel, byte* buf);
extern "C" DECL_DLLEXPORT int32 get_message(std::intptr_t pduel, byte* buf); extern "C" DECL_DLLEXPORT int32 get_message(intptr_t pduel, byte* buf);
extern "C" DECL_DLLEXPORT int32 process(std::intptr_t pduel); extern "C" DECL_DLLEXPORT int32 process(intptr_t pduel);
extern "C" DECL_DLLEXPORT void new_card(std::intptr_t pduel, uint32 code, uint8 owner, uint8 playerid, uint8 location, uint8 sequence, uint8 position); extern "C" DECL_DLLEXPORT void new_card(intptr_t pduel, uint32 code, uint8 owner, uint8 playerid, uint8 location, uint8 sequence, uint8 position);
extern "C" DECL_DLLEXPORT void new_tag_card(std::intptr_t pduel, uint32 code, uint8 owner, uint8 location); extern "C" DECL_DLLEXPORT void new_tag_card(intptr_t pduel, uint32 code, uint8 owner, uint8 location);
extern "C" DECL_DLLEXPORT int32 query_card(std::intptr_t pduel, uint8 playerid, uint8 location, uint8 sequence, int32 query_flag, byte* buf, int32 use_cache); extern "C" DECL_DLLEXPORT int32 query_card(intptr_t pduel, uint8 playerid, uint8 location, uint8 sequence, int32 query_flag, byte* buf, int32 use_cache);
extern "C" DECL_DLLEXPORT int32 query_field_count(std::intptr_t pduel, uint8 playerid, uint8 location); extern "C" DECL_DLLEXPORT int32 query_field_count(intptr_t pduel, uint8 playerid, uint8 location);
extern "C" DECL_DLLEXPORT int32 query_field_card(std::intptr_t pduel, uint8 playerid, uint8 location, int32 query_flag, byte* buf, int32 use_cache); extern "C" DECL_DLLEXPORT int32 query_field_card(intptr_t pduel, uint8 playerid, uint8 location, int32 query_flag, byte* buf, int32 use_cache);
extern "C" DECL_DLLEXPORT int32 query_field_info(std::intptr_t pduel, byte* buf); extern "C" DECL_DLLEXPORT int32 query_field_info(intptr_t pduel, byte* buf);
extern "C" DECL_DLLEXPORT void set_responsei(std::intptr_t pduel, int32 value); extern "C" DECL_DLLEXPORT void set_responsei(intptr_t pduel, int32 value);
extern "C" DECL_DLLEXPORT void set_responseb(std::intptr_t pduel, byte* buf); extern "C" DECL_DLLEXPORT void set_responseb(intptr_t pduel, byte* buf);
extern "C" DECL_DLLEXPORT int32 preload_script(std::intptr_t pduel, const char* script, int32 len); extern "C" DECL_DLLEXPORT int32 preload_script(intptr_t pduel, const char* script, int32 len);
byte* default_script_reader(const char* script_name, int* len); byte* default_script_reader(const char* script_name, int* len);
uint32 default_card_reader(uint32 code, card_data* data); uint32 default_card_reader(uint32 code, card_data* data);
uint32 default_message_handler(void* pduel, uint32 msg_type); uint32 default_message_handler(void* pduel, uint32 msg_type);
......
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