summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-21 21:34:31 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-21 21:34:31 +0000
commitbc9e0854a2c7336c6f7b4a388b5ff00b9f4865e8 (patch)
tree3aa7da07fc43116707de469034c7cf8186e8b2d5 /src
parentb21c980c03ea476e324c714a9ad2d5eff5cb981d (diff)
downloadhercules-bc9e0854a2c7336c6f7b4a388b5ff00b9f4865e8.tar.gz
hercules-bc9e0854a2c7336c6f7b4a388b5ff00b9f4865e8.tar.bz2
hercules-bc9e0854a2c7336c6f7b4a388b5ff00b9f4865e8.tar.xz
hercules-bc9e0854a2c7336c6f7b4a388b5ff00b9f4865e8.zip
* Changed the data field of timers from int to intptr.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12633 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/char/char.c18
-rw-r--r--src/char_sql/char.c16
-rw-r--r--src/char_sql/int_auction.c4
-rw-r--r--src/char_sql/int_guild.c2
-rw-r--r--src/char_sql/inter.c2
-rw-r--r--src/common/socket.c2
-rw-r--r--src/common/timer.c4
-rw-r--r--src/common/timer.h8
-rw-r--r--src/ladmin/ladmin.c2
-rw-r--r--src/login/login.c12
-rw-r--r--src/login_sql/login.c12
-rw-r--r--src/map/atcommand.c4
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/chrif.c8
-rw-r--r--src/map/chrif.h2
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/guild.c12
-rw-r--r--src/map/irc.c4
-rw-r--r--src/map/map.c8
-rw-r--r--src/map/map.h4
-rw-r--r--src/map/mercenary.c4
-rw-r--r--src/map/mob.c24
-rw-r--r--src/map/mob.h2
-rw-r--r--src/map/npc.c4
-rw-r--r--src/map/party.c4
-rw-r--r--src/map/pc.c18
-rw-r--r--src/map/pc.h6
-rw-r--r--src/map/pet.c14
-rw-r--r--src/map/pet.h8
-rw-r--r--src/map/script.c4
-rw-r--r--src/map/script.h2
-rw-r--r--src/map/skill.c12
-rw-r--r--src/map/skill.h4
-rw-r--r--src/map/status.c6
-rw-r--r--src/map/status.h4
-rw-r--r--src/map/unit.c18
-rw-r--r--src/plugins/console.c8
-rw-r--r--src/plugins/gui.c9
38 files changed, 141 insertions, 140 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 5d3975816..c57ba86fa 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -179,7 +179,7 @@ struct online_char_data {
};
static DBMap* online_char_db; // int account_id -> struct online_char_data*
-static int chardb_waiting_disconnect(int tid, unsigned int tick, int id, int data);
+static int chardb_waiting_disconnect(int tid, unsigned int tick, int id, intptr data);
static void* create_online_char_data(DBKey key, va_list args)
{
@@ -1131,7 +1131,7 @@ void mmo_char_sync(void)
//----------------------------------------------------
// Function to save (in a periodic way) datas in files
//----------------------------------------------------
-int mmo_char_sync_timer(int tid, unsigned int tick, int id, int data)
+int mmo_char_sync_timer(int tid, unsigned int tick, int id, intptr data)
{
if (save_log)
ShowInfo("Saving all files...\n");
@@ -1940,7 +1940,7 @@ static void char_auth_ok(int fd, struct char_session_data *sd)
mmo_char_send006b(fd, sd);
}
-int send_accounts_tologin(int tid, unsigned int tick, int id, int data);
+int send_accounts_tologin(int tid, unsigned int tick, int id, intptr data);
int parse_fromlogin(int fd)
{
@@ -3828,7 +3828,7 @@ int mapif_send(int fd, unsigned char *buf, unsigned int len)
return 0;
}
-int broadcast_user_count(int tid, unsigned int tick, int id, int data)
+int broadcast_user_count(int tid, unsigned int tick, int id, intptr data)
{
uint8 buf[6];
int users = count_users();
@@ -3874,7 +3874,7 @@ static int send_accounts_tologin_sub(DBKey key, void* data, va_list ap)
return 0;
}
-int send_accounts_tologin(int tid, unsigned int tick, int id, int data)
+int send_accounts_tologin(int tid, unsigned int tick, int id, intptr data)
{
if (login_fd > 0 && session[login_fd])
{
@@ -3892,7 +3892,7 @@ int send_accounts_tologin(int tid, unsigned int tick, int id, int data)
return 0;
}
-int check_connect_login_server(int tid, unsigned int tick, int id, int data)
+int check_connect_login_server(int tid, unsigned int tick, int id, intptr data)
{
if (login_fd > 0 && session[login_fd] != NULL)
return 0;
@@ -3925,7 +3925,7 @@ int check_connect_login_server(int tid, unsigned int tick, int id, int data)
}
// sends a ping packet to login server (will receive pong 0x2718)
-int ping_login_server(int tid, unsigned int tick, int id, int data)
+int ping_login_server(int tid, unsigned int tick, int id, intptr data)
{
if (login_fd > 0 && session[login_fd] != NULL)
{
@@ -3940,7 +3940,7 @@ int ping_login_server(int tid, unsigned int tick, int id, int data)
//Invoked 15 seconds after mapif_disconnectplayer in case the map server doesn't
//replies/disconnect the player we tried to kick. [Skotlex]
//------------------------------------------------
-static int chardb_waiting_disconnect(int tid, unsigned int tick, int id, int data)
+static int chardb_waiting_disconnect(int tid, unsigned int tick, int id, intptr data)
{
struct online_char_data* character;
if ((character = (struct online_char_data*)idb_get(online_char_db, id)) != NULL && character->waiting_disconnect == tid)
@@ -3964,7 +3964,7 @@ static int online_data_cleanup_sub(DBKey key, void *data, va_list ap)
return 0;
}
-static int online_data_cleanup(int tid, unsigned int tick, int id, int data)
+static int online_data_cleanup(int tid, unsigned int tick, int id, intptr data)
{
online_char_db->foreach(online_char_db, online_data_cleanup_sub);
return 0;
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 8066dc629..eef4fa2a0 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -199,7 +199,7 @@ struct online_char_data {
};
static DBMap* online_char_db; // int account_id -> struct online_char_data*
-static int chardb_waiting_disconnect(int tid, unsigned int tick, int id, int data);
+static int chardb_waiting_disconnect(int tid, unsigned int tick, int id, intptr data);
static void* create_online_char_data(DBKey key, va_list args)
{
@@ -1647,7 +1647,7 @@ static void char_auth_ok(int fd, struct char_session_data *sd)
mmo_char_send006b(fd, sd);
}
-int send_accounts_tologin(int tid, unsigned int tick, int id, int data);
+int send_accounts_tologin(int tid, unsigned int tick, int id, intptr data);
int parse_fromlogin(int fd)
{
@@ -3423,7 +3423,7 @@ int mapif_send(int fd, unsigned char *buf, unsigned int len)
return 0;
}
-int broadcast_user_count(int tid, unsigned int tick, int id, int data)
+int broadcast_user_count(int tid, unsigned int tick, int id, intptr data)
{
uint8 buf[6];
int users = count_users();
@@ -3466,7 +3466,7 @@ static int send_accounts_tologin_sub(DBKey key, void* data, va_list ap)
return 0;
}
-int send_accounts_tologin(int tid, unsigned int tick, int id, int data)
+int send_accounts_tologin(int tid, unsigned int tick, int id, intptr data)
{
if (login_fd > 0 && session[login_fd])
{
@@ -3484,7 +3484,7 @@ int send_accounts_tologin(int tid, unsigned int tick, int id, int data)
return 0;
}
-int check_connect_login_server(int tid, unsigned int tick, int id, int data)
+int check_connect_login_server(int tid, unsigned int tick, int id, intptr data)
{
if (login_fd > 0 && session[login_fd] != NULL)
return 0;
@@ -3517,7 +3517,7 @@ int check_connect_login_server(int tid, unsigned int tick, int id, int data)
}
// sends a ping packet to login server (will receive pong 0x2718)
-int ping_login_server(int tid, unsigned int tick, int id, int data)
+int ping_login_server(int tid, unsigned int tick, int id, intptr data)
{
if (login_fd > 0 && session[login_fd] != NULL)
{
@@ -3532,7 +3532,7 @@ int ping_login_server(int tid, unsigned int tick, int id, int data)
//Invoked 15 seconds after mapif_disconnectplayer in case the map server doesn't
//replies/disconnect the player we tried to kick. [Skotlex]
//------------------------------------------------
-static int chardb_waiting_disconnect(int tid, unsigned int tick, int id, int data)
+static int chardb_waiting_disconnect(int tid, unsigned int tick, int id, intptr data)
{
struct online_char_data* character;
if ((character = (struct online_char_data*)idb_get(online_char_db, id)) != NULL && character->waiting_disconnect == tid)
@@ -3556,7 +3556,7 @@ static int online_data_cleanup_sub(DBKey key, void *data, va_list ap)
return 0;
}
-static int online_data_cleanup(int tid, unsigned int tick, int id, int data)
+static int online_data_cleanup(int tid, unsigned int tick, int id, intptr data)
{
online_char_db->foreach(online_char_db, online_data_cleanup_sub);
return 0;
diff --git a/src/char_sql/int_auction.c b/src/char_sql/int_auction.c
index 84f0ff424..ca99086c7 100644
--- a/src/char_sql/int_auction.c
+++ b/src/char_sql/int_auction.c
@@ -20,7 +20,7 @@
static DBMap* auction_db_ = NULL; // int auction_id -> struct auction_data*
void auction_delete(struct auction_data *auction);
-static int auction_end_timer(int tid, unsigned int tick, int id, int data);
+static int auction_end_timer(int tid, unsigned int tick, int id, intptr data);
static int auction_count(int char_id, bool buy)
{
@@ -134,7 +134,7 @@ static void mapif_Auction_message(int char_id, unsigned char result)
mapif_sendall(buf,7);
}
-static int auction_end_timer(int tid, unsigned int tick, int id, int data)
+static int auction_end_timer(int tid, unsigned int tick, int id, intptr data)
{
struct auction_data *auction;
if( (auction = (struct auction_data *)idb_get(auction_db_, id)) != NULL )
diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c
index 3ff05ddf1..a63bc951b 100644
--- a/src/char_sql/int_guild.c
+++ b/src/char_sql/int_guild.c
@@ -47,7 +47,7 @@ int mapif_guild_info(int fd,struct guild *g);
int guild_break_sub(int key,void *data,va_list ap);
int inter_guild_tosql(struct guild *g,int flag);
-static int guild_save_timer(int tid, unsigned int tick, int id, int data)
+static int guild_save_timer(int tid, unsigned int tick, int id, intptr data)
{
static int last_id = 0; //To know in which guild we were.
int state = 0; //0: Have not reached last guild. 1: Reached last guild, ready for save. 2: Some guild saved, don't do further saving.
diff --git a/src/char_sql/inter.c b/src/char_sql/inter.c
index d11d7ee95..261ed9b0d 100644
--- a/src/char_sql/inter.c
+++ b/src/char_sql/inter.c
@@ -300,7 +300,7 @@ int inter_log(char* fmt, ...)
/*=============================================
* Does a mysql_ping to all connection handles
*---------------------------------------------*/
-int inter_sql_ping(int tid, unsigned int tick, int id, int data)
+int inter_sql_ping(int tid, unsigned int tick, int id, intptr data)
{
ShowInfo("Pinging SQL server to keep connection alive...\n");
Sql_Ping(sql_handle);
diff --git a/src/common/socket.c b/src/common/socket.c
index ac6846cb9..9b48f0401 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -907,7 +907,7 @@ static int connect_check_(uint32 ip)
/// Timer function.
/// Deletes old connection history records.
-static int connect_check_clear(int tid, unsigned int tick, int id, int data)
+static int connect_check_clear(int tid, unsigned int tick, int id, intptr data)
{
int i;
int clear = 0;
diff --git a/src/common/timer.c b/src/common/timer.c
index 0eb16c45f..183daad30 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -239,7 +239,7 @@ static int acquire_timer(void)
/// Starts a new timer that is deleted once it expires (single-use).
/// Returns the timer's id.
-int add_timer(unsigned int tick, TimerFunc func, int id, int data)
+int add_timer(unsigned int tick, TimerFunc func, int id, intptr data)
{
int tid;
@@ -257,7 +257,7 @@ int add_timer(unsigned int tick, TimerFunc func, int id, int data)
/// Starts a new timer that automatically restarts itself (infinite loop until manually removed).
/// Returns the timer's id, or -1 if it fails.
-int add_timer_interval(unsigned int tick, TimerFunc func, int id, int data, int interval)
+int add_timer_interval(unsigned int tick, TimerFunc func, int id, intptr data, int interval)
{
int tid;
diff --git a/src/common/timer.h b/src/common/timer.h
index 9c9d5c2b1..7a3dba4a8 100644
--- a/src/common/timer.h
+++ b/src/common/timer.h
@@ -19,7 +19,7 @@
// Struct declaration
-typedef int (*TimerFunc)(int tid, unsigned int tick, int id, int data);
+typedef int (*TimerFunc)(int tid, unsigned int tick, int id, intptr data);
struct TimerData {
unsigned int tick;
@@ -30,7 +30,7 @@ struct TimerData {
// general-purpose storage
int id;
- int data;
+ intptr data;
};
// Function prototype declaration
@@ -38,8 +38,8 @@ struct TimerData {
unsigned int gettick(void);
unsigned int gettick_nocache(void);
-int add_timer(unsigned int tick, TimerFunc func, int id, int data);
-int add_timer_interval(unsigned int tick, TimerFunc func, int id, int data, int interval);
+int add_timer(unsigned int tick, TimerFunc func, int id, intptr data);
+int add_timer_interval(unsigned int tick, TimerFunc func, int id, intptr data, int interval);
struct TimerData* get_timer(int tid);
int delete_timer(int tid, TimerFunc func);
diff --git a/src/ladmin/ladmin.c b/src/ladmin/ladmin.c
index c39d03c1c..b798ef385 100644
--- a/src/ladmin/ladmin.c
+++ b/src/ladmin/ladmin.c
@@ -4234,7 +4234,7 @@ int Connect_login_server(void)
}
// sends a ping packet to login server (will receive pong 0x2718)
-int ping_login_server(int tid, unsigned int tick, int id, int data)
+int ping_login_server(int tid, unsigned int tick, int id, intptr data)
{
if (login_fd > 0 && session[login_fd] != NULL)
{
diff --git a/src/login/login.c b/src/login/login.c
index 9bb77e093..2f987a735 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -104,7 +104,7 @@ struct online_login_data {
};
static DBMap* online_db; // int account_id -> struct online_login_data*
-static int waiting_disconnect_timer(int tid, unsigned int tick, int id, int data);
+static int waiting_disconnect_timer(int tid, unsigned int tick, int id, intptr data);
static void* create_online_user(DBKey key, va_list args)
{
@@ -145,7 +145,7 @@ void remove_online_user(int account_id)
idb_remove(online_db, account_id);
}
-static int waiting_disconnect_timer(int tid, unsigned int tick, int id, int data)
+static int waiting_disconnect_timer(int tid, unsigned int tick, int id, intptr data)
{
struct online_login_data* p = (struct online_login_data*)idb_get(online_db, id);
if( p != NULL && p->waiting_disconnect == tid && p->account_id == id )
@@ -723,7 +723,7 @@ void mmo_auth_sync(void)
// immediatly and set the minimum of
// authentications to its initialization value.
//-----------------------------------------------------
-int check_auth_sync(int tid, unsigned int tick, int id, int data)
+int check_auth_sync(int tid, unsigned int tick, int id, intptr data)
{
// we only save if necessary:
// we have do some authentications without do saving
@@ -737,7 +737,7 @@ int check_auth_sync(int tid, unsigned int tick, int id, int data)
//-----------------------------------------------------
// periodic ip address synchronization
//-----------------------------------------------------
-static int sync_ip_addresses(int tid, unsigned int tick, int id, int data)
+static int sync_ip_addresses(int tid, unsigned int tick, int id, intptr data)
{
uint8 buf[2];
ShowInfo("IP Sync in progress...\n");
@@ -784,7 +784,7 @@ void send_GM_accounts(int fd)
//-----------------------------------------------------
// Check if GM file account have been changed
//-----------------------------------------------------
-int check_GM_file(int tid, unsigned int tick, int id, int data)
+int check_GM_file(int tid, unsigned int tick, int id, intptr data)
{
struct stat file_stat;
long new_time;
@@ -2032,7 +2032,7 @@ static int online_data_cleanup_sub(DBKey key, void *data, va_list ap)
return 0;
}
-static int online_data_cleanup(int tid, unsigned int tick, int id, int data)
+static int online_data_cleanup(int tid, unsigned int tick, int id, intptr data)
{
online_db->foreach(online_db, online_data_cleanup_sub);
return 0;
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index aa001cd16..a5b387a02 100644
--- a/src/login_sql/login.c
+++ b/src/login_sql/login.c
@@ -97,7 +97,7 @@ struct online_login_data {
};
static DBMap* online_db; // int account_id -> struct online_login_data*
-static int waiting_disconnect_timer(int tid, unsigned int tick, int id, int data);
+static int waiting_disconnect_timer(int tid, unsigned int tick, int id, intptr data);
static void* create_online_user(DBKey key, va_list args)
{
@@ -138,7 +138,7 @@ void remove_online_user(int account_id)
idb_remove(online_db, account_id);
}
-static int waiting_disconnect_timer(int tid, unsigned int tick, int id, int data)
+static int waiting_disconnect_timer(int tid, unsigned int tick, int id, intptr data)
{
struct online_login_data* p = (struct online_login_data*)idb_get(online_db, id);
if( p != NULL && p->waiting_disconnect == tid && p->account_id == id )
@@ -249,7 +249,7 @@ void send_GM_accounts(int fd)
/*=============================================
* Does a mysql_ping to all connection handles
*---------------------------------------------*/
-int login_sql_ping(int tid, unsigned int tick, int id, int data)
+int login_sql_ping(int tid, unsigned int tick, int id, intptr data)
{
ShowInfo("Pinging SQL server to keep connection alive...\n");
Sql_Ping(sql_handle);
@@ -340,7 +340,7 @@ void mmo_db_close(void)
//-----------------------------------------------------
// periodic ip address synchronization
//-----------------------------------------------------
-static int sync_ip_addresses(int tid, unsigned int tick, int id, int data)
+static int sync_ip_addresses(int tid, unsigned int tick, int id, intptr data)
{
uint8 buf[2];
ShowInfo("IP Sync in progress...\n");
@@ -1645,7 +1645,7 @@ static int online_data_cleanup_sub(DBKey key, void *data, va_list ap)
return 0;
}
-static int online_data_cleanup(int tid, unsigned int tick, int id, int data)
+static int online_data_cleanup(int tid, unsigned int tick, int id, intptr data)
{
online_db->foreach(online_db, online_data_cleanup_sub);
return 0;
@@ -1704,7 +1704,7 @@ int login_lan_config_read(const char *lancfgName)
//-----------------------------------------------------
// clear expired ip bans
//-----------------------------------------------------
-int ip_ban_flush(int tid, unsigned int tick, int id, int data)
+int ip_ban_flush(int tid, unsigned int tick, int id, intptr data)
{
if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `ipbanlist` WHERE `rtime` <= NOW()") )
Sql_ShowDebug(sql_handle);
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index abb9c61d3..691035c61 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -6970,13 +6970,13 @@ int atcommand_mobinfo(const int fd, struct map_session_data* sd, const char* com
* @showmobs by KarLaeda
* => For 5 sec displays the mobs on minimap
*------------------------------------------*/
-int atshowmobs_timer(int tid, unsigned int tick, int id, int data)
+int atshowmobs_timer(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data* sd = map_id2sd(id);
if( sd == NULL )
return 0;
- clif_viewpoint(sd, 1, 2, 0, 0, data, 0xFFFFFF);
+ clif_viewpoint(sd, 1, 2, 0, 0, (int)data, 0xFFFFFF);
return 1;
}
static int atshowmobs_sub(struct block_list *bl,va_list ap)
diff --git a/src/map/battle.c b/src/map/battle.c
index ae8f13c17..51c8ca1d8 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -150,7 +150,7 @@ struct delay_damage {
unsigned short attack_type;
};
-int battle_delay_damage_sub (int tid, unsigned int tick, int id, int data)
+int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr data)
{
struct delay_damage *dat = (struct delay_damage *)data;
struct block_list *target = map_id2bl(dat->target);
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 7ca140159..9a69d9fe7 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -682,7 +682,7 @@ int auth_db_cleanup_sub(DBKey key,void *data,va_list ap)
return 0;
}
-int auth_db_cleanup(int tid, unsigned int tick, int id, int data)
+int auth_db_cleanup(int tid, unsigned int tick, int id, intptr data)
{
if(!chrif_isconnected()) return 0;
auth_db->foreach(auth_db, auth_db_cleanup_sub);
@@ -1506,7 +1506,7 @@ int chrif_parse(int fd)
return 0;
}
-int ping_char_server(int tid, unsigned int tick, int id, int data)
+int ping_char_server(int tid, unsigned int tick, int id, intptr data)
{
chrif_check(-1);
chrif_keepalive(char_fd);
@@ -1514,7 +1514,7 @@ int ping_char_server(int tid, unsigned int tick, int id, int data)
}
// unused
-int send_usercount_tochar(int tid, unsigned int tick, int id, int data)
+int send_usercount_tochar(int tid, unsigned int tick, int id, intptr data)
{
chrif_check(-1);
@@ -1565,7 +1565,7 @@ int send_users_tochar(void)
* timer関数
* char鯖との接続を確認し、もし切れていたら再度接続する
*------------------------------------------*/
-int check_connect_char_server(int tid, unsigned int tick, int id, int data)
+int check_connect_char_server(int tid, unsigned int tick, int id, intptr data)
{
static int displayed = 0;
if (char_fd <= 0 || session[char_fd] == NULL)
diff --git a/src/map/chrif.h b/src/map/chrif.h
index 5d0c6bc9d..a8487533c 100644
--- a/src/map/chrif.h
+++ b/src/map/chrif.h
@@ -56,7 +56,7 @@ int send_users_tochar(void);
int chrif_char_online(struct map_session_data *sd);
int chrif_changesex(struct map_session_data *sd);
int chrif_chardisconnect(struct map_session_data *sd);
-int check_connect_char_server(int tid, unsigned int tick, int id, int data);
+int check_connect_char_server(int tid, unsigned int tick, int id, intptr data);
int chrif_divorce(int partner_id1, int partner_id2);
int do_final_chrif(void);
diff --git a/src/map/clif.c b/src/map/clif.c
index 4c6d0f833..55e9b1776 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -654,7 +654,7 @@ int clif_clearunit_area(struct block_list* bl, uint8 type)
return 0;
}
-static int clif_clearunit_delayed_sub(int tid, unsigned int tick, int id, int data)
+static int clif_clearunit_delayed_sub(int tid, unsigned int tick, int id, intptr data)
{
struct block_list *bl = (struct block_list *)id;
clif_clearunit_area(bl, 0);
@@ -1276,7 +1276,7 @@ void clif_move(struct unit_data *ud)
/*==========================================
* Delays the map_quit of a player after they are disconnected. [Skotlex]
*------------------------------------------*/
-static int clif_delayquit(int tid, unsigned int tick, int id, int data)
+static int clif_delayquit(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data *sd = NULL;
diff --git a/src/map/guild.c b/src/map/guild.c
index f008f7abf..92e721042 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -65,9 +65,9 @@ struct{
#define GUILD_SAVE_INTERVAL 300000
int guild_save_timer = -1;
-int guild_payexp_timer(int tid,unsigned int tick,int id,int data);
-int guild_save_sub(int tid,unsigned int tick,int id,int data);
-static int guild_send_xy_timer(int tid,unsigned int tick,int id,int data);
+int guild_payexp_timer(int tid, unsigned int tick, int id, intptr data);
+int guild_save_sub(int tid, unsigned int tick, int id, intptr data);
+static int guild_send_xy_timer(int tid, unsigned int tick, int id, intptr data);
/*==========================================
* Retrieves and validates the sd pointer for this guild member [Skotlex]
@@ -355,7 +355,7 @@ int guild_payexp_timer_sub(DBKey dataid, void *data, va_list ap)
return 0;
}
-int guild_payexp_timer(int tid, unsigned int tick, int id, int data)
+int guild_payexp_timer(int tid, unsigned int tick, int id, intptr data)
{
guild_expcache_db->clear(guild_expcache_db,guild_payexp_timer_sub);
return 0;
@@ -383,7 +383,7 @@ int guild_send_xy_timer_sub(DBKey key,void *data,va_list ap)
}
//Code from party_send_xy_timer [Skotlex]
-static int guild_send_xy_timer(int tid,unsigned int tick,int id,int data)
+static int guild_send_xy_timer(int tid, unsigned int tick, int id, intptr data)
{
guild_db->foreach(guild_db,guild_send_xy_timer_sub,tick);
return 0;
@@ -1899,7 +1899,7 @@ int guild_agit_end(void)
return 0;
}
-int guild_save_sub(int tid,unsigned int tick,int id,int data)
+int guild_save_sub(int tid, unsigned int tick, int id, intptr data)
{
static int Gid[MAX_GUILDCASTLE]; // previous owning guild
struct guild_castle *gc;
diff --git a/src/map/irc.c b/src/map/irc.c
index 8973dd61f..a93437860 100644
--- a/src/map/irc.c
+++ b/src/map/irc.c
@@ -47,7 +47,7 @@ IRC_SI *irc_si=NULL;
struct channel_data cd;
int last_cd_user=0;
-int irc_connect_timer(int tid, unsigned int tick, int id, int data)
+int irc_connect_timer(int tid, unsigned int tick, int id, intptr data)
{
if(irc_si && session[irc_si->fd])
return 0;
@@ -148,7 +148,7 @@ int irc_parse(int fd)
return 0;
}
-int irc_keepalive_timer(int tid, unsigned int tick, int id, int data)
+int irc_keepalive_timer(int tid, unsigned int tick, int id, intptr data)
{
char send_string[128];
sprintf(send_string,"PRIVMSG %s : ", irc_nick);
diff --git a/src/map/map.c b/src/map/map.c
index c2260feef..c828ab9c7 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -250,7 +250,7 @@ int map_freeblock_unlock (void)
// この関数は、do_timer() のトップレベルから呼ばれるので、
// block_free_lock を直接いじっても支障無いはず。
-int map_freeblock_timer (int tid, unsigned int tick, int id, int data)
+int map_freeblock_timer(int tid, unsigned int tick, int id, intptr data)
{
if (block_free_lock > 0) {
ShowError("map_freeblock_timer: block_free_lock(%d) is invalid.\n", block_free_lock);
@@ -1249,7 +1249,7 @@ void map_foreachobject(int (*func)(struct block_list*,va_list),int type,...)
* 後者は、map_clearflooritem(id)へ
* map.h?で#defineしてある
*------------------------------------------*/
-int map_clearflooritem_timer(int tid,unsigned int tick,int id,int data)
+int map_clearflooritem_timer(int tid, unsigned int tick, int id, intptr data)
{
struct flooritem_data *fitem=NULL;
@@ -1996,7 +1996,7 @@ int map_removemobs_sub(struct block_list *bl, va_list ap)
return 1;
}
-int map_removemobs_timer(int tid, unsigned int tick, int id, int data)
+int map_removemobs_timer(int tid, unsigned int tick, int id, intptr data)
{
int count;
const int m = id;
@@ -2960,7 +2960,7 @@ int log_sql_init(void)
/*=============================================
* Does a mysql_ping to all connection handles
*---------------------------------------------*/
-int map_sql_ping(int tid, unsigned int tick, int id, int data)
+int map_sql_ping(int tid, unsigned int tick, int id, intptr data)
{
ShowInfo("Pinging SQL server to keep connection alive...\n");
Sql_Ping(mmysql_handle);
diff --git a/src/map/map.h b/src/map/map.h
index 2bf12e366..79762fa5b 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -536,8 +536,8 @@ int map_quit(struct map_session_data *);
bool map_addnpc(int,struct npc_data *);
// 床アイテム関連
-int map_clearflooritem_timer(int,unsigned int,int,int);
-int map_removemobs_timer(int,unsigned int,int,int);
+int map_clearflooritem_timer(int tid, unsigned int tick, int id, intptr data);
+int map_removemobs_timer(int tid, unsigned int tick, int id, intptr data);
#define map_clearflooritem(id) map_clearflooritem_timer(0,0,id,1)
int map_addflooritem(struct item *item_data,int amount,int m,int x,int y,int first_charid,int second_charid,int third_charid,int flags);
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index 66658a1d9..2c76ed8d6 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -43,7 +43,7 @@
struct s_homunculus_db homunculus_db[MAX_HOMUNCULUS_CLASS]; //[orn]
struct skill_tree_entry hskill_tree[MAX_HOMUNCULUS_CLASS][MAX_SKILL_TREE];
-static int merc_hom_hungry(int tid,unsigned int tick,int id,int data);
+static int merc_hom_hungry(int tid, unsigned int tick, int id, intptr data);
static unsigned int hexptbl[MAX_LEVEL];
@@ -478,7 +478,7 @@ int merc_hom_food(struct map_session_data *sd, struct homun_data *hd)
return 0;
}
-static int merc_hom_hungry(int tid,unsigned int tick,int id,int data)
+static int merc_hom_hungry(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data *sd;
struct homun_data *hd;
diff --git a/src/map/mob.c b/src/map/mob.c
index bb81a779d..2288227b4 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -76,7 +76,7 @@ static DBMap* barricade_db;
* Local prototype declaration (only required thing)
*------------------------------------------*/
static int mob_makedummymobdb(int);
-static int mob_spawn_guardian_sub(int,unsigned int,int,int);
+static int mob_spawn_guardian_sub(int tid, unsigned int tick, int id, intptr data);
int mobskill_use(struct mob_data *md,unsigned int tick,int event);
int mob_skillid2skillidx(int class_,int skillid);
@@ -672,7 +672,7 @@ void mod_barricade_clearall(void)
/*==========================================
* Set a Guardian's guild data [Skotlex]
*------------------------------------------*/
-static int mob_spawn_guardian_sub(int tid,unsigned int tick,int id,int data)
+static int mob_spawn_guardian_sub(int tid, unsigned int tick, int id, intptr data)
{ //Needed because the guild_data may not be available at guardian spawn time.
struct block_list* bl = map_id2bl(id);
struct mob_data* md;
@@ -690,11 +690,11 @@ static int mob_spawn_guardian_sub(int tid,unsigned int tick,int id,int data)
md = (struct mob_data*)bl;
nullpo_retr(0, md->guardian_data);
- g = guild_search(data);
+ g = guild_search((int)data);
if (g == NULL)
{ //Liberate castle, if the guild is not found this is an error! [Skotlex]
- ShowError("mob_spawn_guardian_sub: Couldn't load guild %d!\n",data);
+ ShowError("mob_spawn_guardian_sub: Couldn't load guild %d!\n", (int)data);
if (md->class_ == MOBID_EMPERIUM)
{ //Not sure this is the best way, but otherwise we'd be invoking this for ALL guardians spawned later on.
md->guardian_data->guild_id = 0;
@@ -887,9 +887,9 @@ int mob_linksearch(struct block_list *bl,va_list ap)
/*==========================================
* mob spawn with delay (timer function)
*------------------------------------------*/
-static int mob_delayspawn(int tid, unsigned int tick, int m, int n)
+static int mob_delayspawn(int tid, unsigned int tick, int id, intptr data)
{
- struct block_list *bl = map_id2bl(m);
+ struct block_list *bl = map_id2bl(id);
if (bl && bl->type == BL_MOB)
mob_spawn((TBL_MOB*)bl);
return 0;
@@ -1751,7 +1751,7 @@ static int mob_ai_sub_lazy(DBKey key,void * data,va_list ap)
/*==========================================
* Negligent processing for mob outside PC field of view (interval timer function)
*------------------------------------------*/
-static int mob_ai_lazy(int tid,unsigned int tick,int id,int data)
+static int mob_ai_lazy(int tid, unsigned int tick, int id, intptr data)
{
map_foreachmob(mob_ai_sub_lazy,tick);
return 0;
@@ -1760,7 +1760,7 @@ static int mob_ai_lazy(int tid,unsigned int tick,int id,int data)
/*==========================================
* Serious processing for mob in PC field of view (interval timer function)
*------------------------------------------*/
-static int mob_ai_hard(int tid,unsigned int tick,int id,int data)
+static int mob_ai_hard(int tid, unsigned int tick, int id, intptr data)
{
if (battle_config.mob_ai&0x20)
@@ -1799,7 +1799,7 @@ static struct item_drop* mob_setlootitem(struct item* item)
/*==========================================
* item drop with delay (timer function)
*------------------------------------------*/
-static int mob_delay_item_drop(int tid, unsigned int tick, int id, int data)
+static int mob_delay_item_drop(int tid, unsigned int tick, int id, intptr data)
{
struct item_drop_list *list;
struct item_drop *ditem, *ditem_prev;
@@ -1858,7 +1858,7 @@ static void mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, str
dlist->item = ditem;
}
-int mob_timer_delete(int tid, unsigned int tick, int id, int data)
+int mob_timer_delete(int tid, unsigned int tick, int id, intptr data)
{
struct block_list *bl=map_id2bl(id);
nullpo_retr(0, bl);
@@ -1927,12 +1927,12 @@ int mob_deleteslave(struct mob_data *md)
return 0;
}
// Mob respawning through KAIZEL or NPC_REBIRTH [Skotlex]
-int mob_respawn(int tid, unsigned int tick, int id,int data )
+int mob_respawn(int tid, unsigned int tick, int id, intptr data)
{
struct block_list *bl = map_id2bl(id);
if(!bl) return 0;
- status_revive(bl, data, 0);
+ status_revive(bl, (uint8)data, 0);
return 1;
}
diff --git a/src/map/mob.h b/src/map/mob.h
index bad4b6088..f01b4fff1 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -251,7 +251,7 @@ void mob_clear_spawninfo();
int do_init_mob(void);
int do_final_mob(void);
-int mob_timer_delete(int tid, unsigned int tick, int id, int data);
+int mob_timer_delete(int tid, unsigned int tick, int id, intptr data);
int mob_deleteslave(struct mob_data *md);
int mob_random_class (int *value, size_t count);
diff --git a/src/map/npc.c b/src/map/npc.c
index eb6a7effd..92f61564c 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -302,7 +302,7 @@ int npc_event_doall_id(const char* name, int rid)
/*==========================================
* 時計イベント実行
*------------------------------------------*/
-int npc_event_do_clock(int tid, unsigned int tick, int id, int data)
+int npc_event_do_clock(int tid, unsigned int tick, int id, intptr data)
{
static struct tm ev_tm_b; // tracks previous execution time
time_t timer;
@@ -397,7 +397,7 @@ struct timer_event_data {
/*==========================================
* タイマーイベント実行
*------------------------------------------*/
-int npc_timerevent(int tid, unsigned int tick, int id, int data)
+int npc_timerevent(int tid, unsigned int tick, int id, intptr data)
{
int next,t,old_rid,old_timer;
unsigned int old_tick;
diff --git a/src/map/party.c b/src/map/party.c
index 22bac7467..d31ca6686 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -29,7 +29,7 @@
static DBMap* party_db; // int party_id -> struct party_data*
int party_share_level = 10;
-int party_send_xy_timer(int tid,unsigned int tick,int id,int data);
+int party_send_xy_timer(int tid, unsigned int tick, int id, intptr data);
/*==========================================
* Fills the given party_member structure according to the sd provided.
@@ -733,7 +733,7 @@ int party_skill_check(struct map_session_data *sd, int party_id, int skillid, in
return 0;
}
-int party_send_xy_timer(int tid,unsigned int tick,int id,int data)
+int party_send_xy_timer(int tid, unsigned int tick, int id, intptr data)
{
struct party_data* p;
diff --git a/src/map/pc.c b/src/map/pc.c
index be9b6bde2..29dfd1b30 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -115,7 +115,7 @@ int pc_set_gm_level(int account_id, int level)
return 0;
}
-static int pc_invincible_timer(int tid,unsigned int tick,int id,int data)
+static int pc_invincible_timer(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data *sd;
@@ -153,7 +153,7 @@ void pc_delinvincibletimer(struct map_session_data* sd)
}
}
-static int pc_spiritball_timer(int tid,unsigned int tick,int id,int data)
+static int pc_spiritball_timer(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data *sd;
@@ -4124,7 +4124,7 @@ char* job_name(int class_)
}
}
-int pc_follow_timer(int tid,unsigned int tick,int id,int data)
+int pc_follow_timer(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data *sd;
struct block_list *tbl;
@@ -4912,7 +4912,7 @@ void pc_respawn(struct map_session_data* sd, uint8 clrtype)
clif_resurrection(&sd->bl, 1); //If warping fails, send a normal stand up packet.
}
-static int pc_respawn_timer(int tid,unsigned int tick,int id,int data)
+static int pc_respawn_timer(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data *sd = map_id2sd(id);
if( sd != NULL )
@@ -6231,7 +6231,7 @@ int pc_setregistry_str(struct map_session_data *sd,char *reg,const char *val,int
/*==========================================
* イベントタイマ??理
*------------------------------------------*/
-static int pc_eventtimer(int tid,unsigned int tick,int id,int data)
+static int pc_eventtimer(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data *sd=map_id2sd(id);
char *p = (char *)data;
@@ -6721,7 +6721,7 @@ int pc_calc_pvprank(struct map_session_data *sd)
/*==========================================
* PVP順位計算(timer)
*------------------------------------------*/
-int pc_calc_pvprank_timer(int tid,unsigned int tick,int id,int data)
+int pc_calc_pvprank_timer(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data *sd=NULL;
@@ -6917,7 +6917,7 @@ int pc_setsavepoint(struct map_session_data *sd, short mapindex,int x,int y)
/*==========================================
* 自動セ?ブ (timer??)
*------------------------------------------*/
-int pc_autosave(int tid,unsigned int tick,int id,int data)
+int pc_autosave(int tid, unsigned int tick, int id, intptr data)
{
int interval;
struct s_mapiterator* iter;
@@ -6985,7 +6985,7 @@ static int pc_daynight_timer_sub(struct map_session_data *sd,va_list ap)
* timer to do the day [Yor]
* data: 0 = called by timer, 1 = gmcommand/script
*------------------------------------------------*/
-int map_day_timer(int tid, unsigned int tick, int id, int data)
+int map_day_timer(int tid, unsigned int tick, int id, intptr data)
{
char tmp_soutput[1024];
@@ -7006,7 +7006,7 @@ int map_day_timer(int tid, unsigned int tick, int id, int data)
* timer to do the night [Yor]
* data: 0 = called by timer, 1 = gmcommand/script
*------------------------------------------------*/
-int map_night_timer(int tid, unsigned int tick, int id, int data)
+int map_night_timer(int tid, unsigned int tick, int id, intptr data)
{
char tmp_soutput[1024];
diff --git a/src/map/pc.h b/src/map/pc.h
index 8ab170161..24a882431 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -639,7 +639,7 @@ int pc_cleareventtimer(struct map_session_data *sd);
int pc_addeventtimercount(struct map_session_data *sd,const char *name,int tick);
int pc_calc_pvprank(struct map_session_data *sd);
-int pc_calc_pvprank_timer(int tid,unsigned int tick,int id,int data);
+int pc_calc_pvprank_timer(int tid, unsigned int tick, int id, intptr data);
int pc_ismarried(struct map_session_data *sd);
int pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd);
@@ -705,8 +705,8 @@ enum {ADDITEM_EXIST,ADDITEM_NEW,ADDITEM_OVERAMOUNT};
// timer for night.day
extern int day_timer_tid;
extern int night_timer_tid;
-int map_day_timer(int,unsigned int,int,int); // by [yor]
-int map_night_timer(int,unsigned int,int,int); // by [yor]
+int map_day_timer(int tid, unsigned int tick, int id, intptr data); // by [yor]
+int map_night_timer(int tid, unsigned int tick, int id, intptr data); // by [yor]
//Duel functions // [LuzZza]
int duel_create(struct map_session_data* sd, const unsigned int maxpl);
diff --git a/src/map/pet.c b/src/map/pet.c
index 0ccae4701..879edef41 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -227,7 +227,7 @@ int pet_sc_check(struct map_session_data *sd, int type)
return 0;
}
-static int pet_hungry(int tid,unsigned int tick,int id,int data)
+static int pet_hungry(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data *sd;
struct pet_data *pd;
@@ -969,7 +969,7 @@ static int pet_ai_sub_foreachclient(struct map_session_data *sd,va_list ap)
return 0;
}
-static int pet_ai_hard(int tid,unsigned int tick,int id,int data)
+static int pet_ai_hard(int tid, unsigned int tick, int id, intptr data)
{
clif_foreachclient(pet_ai_sub_foreachclient,tick);
@@ -1003,7 +1003,7 @@ static int pet_ai_sub_hard_lootsearch(struct block_list *bl,va_list ap)
return 0;
}
-static int pet_delay_item_drop(int tid,unsigned int tick,int id,int data)
+static int pet_delay_item_drop(int tid, unsigned int tick, int id, intptr data)
{
struct item_drop_list *list;
struct item_drop *ditem, *ditem_prev;
@@ -1072,7 +1072,7 @@ int pet_lootitem_drop(struct pet_data *pd,struct map_session_data *sd)
/*==========================================
* pet bonus giving skills [Valaris] / Rewritten by [Skotlex]
*------------------------------------------*/
-int pet_skill_bonus_timer(int tid,unsigned int tick,int id,int data)
+int pet_skill_bonus_timer(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data *sd=map_id2sd(id);
struct pet_data *pd;
@@ -1114,7 +1114,7 @@ int pet_skill_bonus_timer(int tid,unsigned int tick,int id,int data)
/*==========================================
* pet recovery skills [Valaris] / Rewritten by [Skotlex]
*------------------------------------------*/
-int pet_recovery_timer(int tid,unsigned int tick,int id,int data)
+int pet_recovery_timer(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data *sd=map_id2sd(id);
struct pet_data *pd;
@@ -1142,7 +1142,7 @@ int pet_recovery_timer(int tid,unsigned int tick,int id,int data)
return 0;
}
-int pet_heal_timer(int tid,unsigned int tick,int id,int data)
+int pet_heal_timer(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data *sd=map_id2sd(id);
struct status_data *status;
@@ -1180,7 +1180,7 @@ int pet_heal_timer(int tid,unsigned int tick,int id,int data)
/*==========================================
* pet support skills [Skotlex]
*------------------------------------------*/
-int pet_skill_support_timer(int tid,unsigned int tick,int id,int data)
+int pet_skill_support_timer(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data *sd=map_id2sd(id);
struct pet_data *pd;
diff --git a/src/map/pet.h b/src/map/pet.h
index 86b9080eb..20538e240 100644
--- a/src/map/pet.h
+++ b/src/map/pet.h
@@ -119,10 +119,10 @@ int pet_change_name_ack(struct map_session_data *sd, char* name, int flag);
int pet_equipitem(struct map_session_data *sd,int index);
int pet_lootitem_drop(struct pet_data *pd,struct map_session_data *sd);
int pet_attackskill(struct pet_data *pd, int target_id);
-int pet_skill_support_timer(int tid, unsigned int tick, int id, int data); // [Skotlex]
-int pet_skill_bonus_timer(int tid,unsigned int tick,int id,int data); // [Valaris]
-int pet_recovery_timer(int tid,unsigned int tick,int id,int data); // [Valaris]
-int pet_heal_timer(int tid,unsigned int tick,int id,int data); // [Valaris]
+int pet_skill_support_timer(int tid, unsigned int tick, int id, intptr data); // [Skotlex]
+int pet_skill_bonus_timer(int tid, unsigned int tick, int id, intptr data); // [Valaris]
+int pet_recovery_timer(int tid, unsigned int tick, int id, intptr data); // [Valaris]
+int pet_heal_timer(int tid, unsigned int tick, int id, intptr data); // [Valaris]
#define pet_stop_walking(pd, type) unit_stop_walking(&(pd)->bl, type)
#define pet_stop_attack(pd) unit_stop_attack(&(pd)->bl)
diff --git a/src/map/script.c b/src/map/script.c
index 364dbc8b9..0d520ebc3 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3013,7 +3013,7 @@ struct linkdb_node* script_erase_sleepdb(struct linkdb_node *n)
/*==========================================
* sleep用タイマー関数
*------------------------------------------*/
-int run_script_timer(int tid, unsigned int tick, int id, int data)
+int run_script_timer(int tid, unsigned int tick, int id, intptr data)
{
struct script_state *st = (struct script_state *)data;
struct linkdb_node *node = (struct linkdb_node *)sleep_db;
@@ -3453,7 +3453,7 @@ static int script_save_mapreg(void)
mapreg_dirty=0;
return 0;
}
-static int script_autosave_mapreg(int tid,unsigned int tick,int id,int data)
+static int script_autosave_mapreg(int tid, unsigned int tick, int id, intptr data)
{
if(mapreg_dirty)
if (script_save_mapreg() == -1)
diff --git a/src/map/script.h b/src/map/script.h
index 943ce3a4d..7f07185a8 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -129,7 +129,7 @@ int set_var(struct map_session_data *sd, char *name, void *val);
int conv_num(struct script_state *st,struct script_data *data);
const char* conv_str(struct script_state *st,struct script_data *data);
void setd_sub(struct script_state *st, struct map_session_data *sd, char *varname, int elem, void *value, struct linkdb_node **ref);
-int run_script_timer(int tid, unsigned int tick, int id, int data);
+int run_script_timer(int tid, unsigned int tick, int id, intptr data);
void run_script_main(struct script_state *st);
void script_stop_sleeptimers(int id);
diff --git a/src/map/skill.c b/src/map/skill.c
index 6ede18445..ce842e734 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2020,7 +2020,7 @@ int skill_area_sub_count (struct block_list *src, struct block_list *target, int
/*==========================================
*
*------------------------------------------*/
-static int skill_timerskill (int tid, unsigned int tick, int id, int data)
+static int skill_timerskill(int tid, unsigned int tick, int id, intptr data)
{
struct block_list *src = map_id2bl(id),*target;
struct unit_data *ud = unit_bl2ud(src);
@@ -5196,7 +5196,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
/*==========================================
*
*------------------------------------------*/
-int skill_castend_id (int tid, unsigned int tick, int id, int data)
+int skill_castend_id(int tid, unsigned int tick, int id, intptr data)
{
struct block_list *target, *src = map_id2bl(id);
struct map_session_data* sd = NULL;
@@ -5422,7 +5422,7 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
/*==========================================
*
*------------------------------------------*/
-int skill_castend_pos (int tid, unsigned int tick, int id, int data)
+int skill_castend_pos(int tid, unsigned int tick, int id, intptr data)
{
struct block_list* src = map_id2bl(id);
int maxcount;
@@ -9703,7 +9703,7 @@ int skill_unit_timer_sub (struct block_list* bl, va_list ap)
/*==========================================
* Executes on all skill units every SKILLUNITTIMER_INTERVAL miliseconds.
*------------------------------------------*/
-int skill_unit_timer (int tid, unsigned int tick, int id, int data)
+int skill_unit_timer(int tid, unsigned int tick, int id, intptr data)
{
map_freeblock_lock();
@@ -10371,7 +10371,7 @@ int skill_arrow_create (struct map_session_data *sd, int nameid)
/*==========================================
*
*------------------------------------------*/
-int skill_blockpc_end (int tid, unsigned int tick, int id, int data)
+int skill_blockpc_end(int tid, unsigned int tick, int id, intptr data)
{
struct map_session_data *sd = map_id2sd(id);
if (data <= 0 || data >= MAX_SKILL)
@@ -10398,7 +10398,7 @@ int skill_blockpc_start(struct map_session_data *sd, int skillid, int tick)
return add_timer(gettick()+tick,skill_blockpc_end,sd->bl.id,skillid);
}
-int skill_blockmerc_end (int tid, unsigned int tick, int id, int data) //[orn]
+int skill_blockmerc_end(int tid, unsigned int tick, int id, intptr data) //[orn]
{
struct homun_data *hd = (TBL_HOM*) map_id2bl(id);
if (data <= 0 || data >= MAX_SKILL)
diff --git a/src/map/skill.h b/src/map/skill.h
index 864eb4a97..8719e6adf 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -249,8 +249,8 @@ const char* skill_get_name( int id ); // [Skotlex]
const char* skill_get_desc( int id ); // [Skotlex]
int skill_isammotype(struct map_session_data *sd, int skill);
-int skill_castend_id( int tid, unsigned int tick, int id,int data );
-int skill_castend_pos( int tid, unsigned int tick, int id,int data );
+int skill_castend_id(int tid, unsigned int tick, int id, intptr data);
+int skill_castend_pos(int tid, unsigned int tick, int id, intptr data);
int skill_castend_map( struct map_session_data *sd,short skill_num, const char *map);
int skill_cleartimerskill(struct block_list *src);
diff --git a/src/map/status.c b/src/map/status.c
index b362a15cd..70c1074d6 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -6714,7 +6714,7 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid)
return 1;
}
-int kaahi_heal_timer(int tid, unsigned int tick, int id, int data)
+int kaahi_heal_timer(int tid, unsigned int tick, int id, intptr data)
{
struct block_list *bl;
struct status_change *sc;
@@ -6751,7 +6751,7 @@ int kaahi_heal_timer(int tid, unsigned int tick, int id, int data)
/*==========================================
* ステータス異常終了タイマー
*------------------------------------------*/
-int status_change_timer(int tid, unsigned int tick, int id, int data)
+int status_change_timer(int tid, unsigned int tick, int id, intptr data)
{
enum sc_type type = (sc_type)data;
struct block_list *bl;
@@ -7426,7 +7426,7 @@ static int status_natural_heal(DBKey key,void * data,va_list ap)
}
//Natural heal main timer.
-static int status_natural_heal_timer(int tid,unsigned int tick,int id,int data)
+static int status_natural_heal_timer(int tid, unsigned int tick, int id, intptr data)
{
natural_heal_diff_tick = DIFF_TICK(tick,natural_heal_prev_tick);
map_foreachiddb(status_natural_heal);
diff --git a/src/map/status.h b/src/map/status.h
index 0f2e47778..30c52e4d4 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -781,8 +781,8 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti
int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val1,int val2,int val3,int val4,int tick,int flag);
int status_change_end(struct block_list* bl, enum sc_type type, int tid);
-int kaahi_heal_timer(int tid, unsigned int tick, int id, int data);
-int status_change_timer(int tid, unsigned int tick, int id, int data);
+int kaahi_heal_timer(int tid, unsigned int tick, int id, intptr data);
+int status_change_timer(int tid, unsigned int tick, int id, intptr data);
int status_change_timer_sub(struct block_list* bl, va_list ap);
int status_change_clear(struct block_list* bl, int type);
int status_change_clear_buffs(struct block_list* bl, int type);
diff --git a/src/map/unit.c b/src/map/unit.c
index 88bfaab47..a6e3ec914 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -46,8 +46,8 @@ struct unit_data* unit_bl2ud(struct block_list *bl)
return NULL;
}
-static int unit_attack_timer(int tid,unsigned int tick,int id,int data);
-static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data);
+static int unit_attack_timer(int tid, unsigned int tick, int id, intptr data);
+static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr data);
int unit_walktoxy_sub(struct block_list *bl)
{
@@ -101,7 +101,7 @@ int unit_walktoxy_sub(struct block_list *bl)
return 1;
}
-static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data)
+static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr data)
{
int i;
int x,y,dx,dy;
@@ -254,13 +254,13 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data)
return 0;
}
-static int unit_delay_walktoxy_timer(int tid, unsigned int tick, int id, int data)
+static int unit_delay_walktoxy_timer(int tid, unsigned int tick, int id, intptr data)
{
struct block_list *bl = map_id2bl(id);
if (!bl || bl->prev == NULL)
return 0;
- unit_walktoxy(bl, data>>16, data&0xffff, 0);
+ unit_walktoxy(bl, (short)((data>>16)&0xffff), (short)(data&0xffff), 0);
return 1;
}
@@ -318,7 +318,7 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag)
if((bl)->type == BL_MOB && (flag)) \
((TBL_MOB*)(bl))->state.skillstate = ((TBL_MOB*)(bl))->state.aggressive?MSS_FOLLOW:MSS_RUSH;
-static int unit_walktobl_sub(int tid,unsigned int tick,int id,int data)
+static int unit_walktobl_sub(int tid, unsigned int tick, int id, intptr data)
{
struct block_list *bl = map_id2bl(id);
struct unit_data *ud = bl?unit_bl2ud(bl):NULL;
@@ -762,7 +762,7 @@ int unit_can_move(struct block_list *bl)
* Resume running after a walk delay
*------------------------------------------*/
-int unit_resume_running(int tid,unsigned int tick,int id,int data)
+int unit_resume_running(int tid, unsigned int tick, int id, intptr data)
{
struct unit_data *ud = (struct unit_data *)data;
@@ -1192,7 +1192,7 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, sh
return 1;
}
-static int unit_attack_timer(int tid,unsigned int tick,int id,int data);
+static int unit_attack_timer(int tid, unsigned int tick, int id, intptr data);
int unit_stop_attack(struct block_list *bl)
{
@@ -1476,7 +1476,7 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t
return 1;
}
-static int unit_attack_timer(int tid,unsigned int tick,int id,int data)
+static int unit_attack_timer(int tid, unsigned int tick, int id, intptr data)
{
struct block_list *bl;
bl = map_id2bl(id);
diff --git a/src/plugins/console.c b/src/plugins/console.c
index 5374d784f..5056eafdc 100644
--- a/src/plugins/console.c
+++ b/src/plugins/console.c
@@ -127,10 +127,10 @@ PLUGIN_EVENTS_TABLE = {
// Imported functions
-typedef int TimerFunc(int tid, unsigned int tick, int id, int data);
+typedef int (*TimerFunc)(int tid, unsigned int tick, int id, intptr data);
int (*add_timer_func_list)(TimerFunc func, char* name);
-int (*add_timer_interval)(unsigned int tick, TimerFunc* func, int id, int data, int interval);
-int (*delete_timer)(int tid, TimerFunc* func);
+int (*add_timer_interval)(unsigned int tick, TimerFunc func, int id, intptr data, int interval);
+int (*delete_timer)(int tid, TimerFunc func);
unsigned int (*gettick)(void);
int (*parse_console)(char* buf);
@@ -424,7 +424,7 @@ WORKER_FUNC_END(getinput)
/// Timer function that checks if there's assynchronous input data and feeds parse_console()
/// The input reads one line at a time and line terminators are removed.
-int console_getinputtimer(int tid, unsigned int tick, int id, int data)
+int console_getinputtimer(int tid, unsigned int tick, int id, intptr data)
{
char* cmd;
size_t len;
diff --git a/src/plugins/gui.c b/src/plugins/gui.c
index ecbfd3b97..f45345341 100644
--- a/src/plugins/gui.c
+++ b/src/plugins/gui.c
@@ -24,16 +24,17 @@ PLUGIN_EVENTS_TABLE = {
{ NULL, NULL }
};
+typedef int (*TimerFunc)(int tid, unsigned int tick, int id, intptr data);
unsigned int (*gettick)();
-int (*add_timer_func_list)(int (*)(int,unsigned int,int,int),char*);
-int (*add_timer_interval)(unsigned int,int (*)(int,unsigned int,int,int),int,int,int);
+int (*add_timer_func_list)(TimerFunc func, char* name);
+int (*add_timer_interval)(unsigned int tick, TimerFunc func, int id, intptr data, int interval);
//-----------------------------------------------------
//I'm Alive Alert
//Used to output 'I'm Alive' every few seconds
//Intended to let frontends know if the app froze
//-----------------------------------------------------
-int imalive_timer(int tid, unsigned int tick, int id, int data)
+int imalive_timer(int tid, unsigned int tick, int id, intptr data)
{
printf("I'm Alive\n");
return 0;
@@ -43,7 +44,7 @@ int imalive_timer(int tid, unsigned int tick, int id, int data)
//Flush stdout
//stdout buffer needs flushed to be seen in GUI
//-----------------------------------------------------
-int flush_timer(int tid, unsigned int tick, int id, int data)
+int flush_timer(int tid, unsigned int tick, int id, intptr data)
{
fflush(stdout);
return 0;