summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2011-03-24 22:57:06 -0700
committerBen Longbons <b.r.longbons@gmail.com>2011-03-24 22:57:06 -0700
commitdeec3c27f91a97d35aaf912422d1249ec609da05 (patch)
treeea9667aa5db695e88b8c0e00c07df57aa38a38b1
parentef740ac0479a5a4f4240db63b84531599a26a983 (diff)
downloadtmwa-deec3c27f91a97d35aaf912422d1249ec609da05.tar.gz
tmwa-deec3c27f91a97d35aaf912422d1249ec609da05.tar.bz2
tmwa-deec3c27f91a97d35aaf912422d1249ec609da05.tar.xz
tmwa-deec3c27f91a97d35aaf912422d1249ec609da05.zip
Fix accidentally-named interdb_val_t
-rw-r--r--src/common/timer.c8
-rw-r--r--src/common/timer.h10
2 files changed, 9 insertions, 9 deletions
diff --git a/src/common/timer.c b/src/common/timer.c
index 915aeb4..f4be19b 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -159,7 +159,7 @@ timer_id add_timer (tick_t tick, timer_func func, custom_id_t id, custom_data_t
}
timer_id add_timer_interval (tick_t tick, timer_func func, custom_id_t id,
- custom_data_t data, interdb_val_t interval)
+ custom_data_t data, interval_t interval)
{
timer_id tid = add_timer (tick, func, id, data);
timer_data[tid].type = TIMER_INTERVAL;
@@ -185,7 +185,7 @@ void delete_timer (timer_id id, timer_func func)
timer_data[id].tick -= 60 * 60 * 1000;
}
-tick_t addtick_timer (timer_id tid, interdb_val_t tick)
+tick_t addtick_timer (timer_id tid, interval_t tick)
{
return timer_data[tid].tick += tick;
}
@@ -195,12 +195,12 @@ struct TimerData *get_timer (timer_id tid)
return &timer_data[tid];
}
-interdb_val_t do_timer (tick_t tick)
+interval_t do_timer (tick_t tick)
{
timer_id i;
/// Number of milliseconds until it calls this again
// this says to wait 1 sec if all timers get popped
- interdb_val_t nextmin = 1000;
+ interval_t nextmin = 1000;
while ((i = top_timer_heap ()) != (timer_id)-1)
{
diff --git a/src/common/timer.h b/src/common/timer.h
index 2a38e04..e363a56 100644
--- a/src/common/timer.h
+++ b/src/common/timer.h
@@ -13,7 +13,7 @@ enum TIMER_TYPE
// TODO replace with signed 64-bit to make code more clear and protect from the future
typedef uint32_t tick_t;
-typedef uint32_t interdb_val_t;
+typedef uint32_t interval_t;
typedef uint32_t timer_id;
// BUG: pointers are stored in here
typedef int32_t custom_id_t;
@@ -33,7 +33,7 @@ struct TimerData
/// Type of timer - 0 initially
enum TIMER_TYPE type;
/// Repeat rate
- interdb_val_t interval;
+ interval_t interval;
};
/// Server time, in milliseconds, since the epoch,
@@ -46,14 +46,14 @@ tick_t gettick_nocache (void);
tick_t gettick (void);
timer_id add_timer (tick_t, timer_func, custom_id_t, custom_data_t);
-timer_id add_timer_interval (tick_t, timer_func, custom_id_t, custom_data_t, interdb_val_t);
+timer_id add_timer_interval (tick_t, timer_func, custom_id_t, custom_data_t, interval_t);
void delete_timer (timer_id, timer_func);
-tick_t addtick_timer (timer_id, interdb_val_t);
+tick_t addtick_timer (timer_id, interval_t);
struct TimerData *get_timer (timer_id tid);
/// Do all timers scheduled before tick, and return the number of milliseconds until the next timer happens
-interdb_val_t do_timer (tick_t tick);
+interval_t do_timer (tick_t tick);