From bc9e0854a2c7336c6f7b4a388b5ff00b9f4865e8 Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Mon, 21 Apr 2008 21:34:31 +0000 Subject: * 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 --- src/plugins/console.c | 8 ++++---- src/plugins/gui.c | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/plugins') 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; -- cgit v1.2.3-60-g2f50