mirror of
https://github.com/anope/anope.git
synced 2026-06-28 06:36:38 +02:00
Consistently use time_t for the timer duration.
This commit is contained in:
+4
-4
@@ -24,9 +24,9 @@ private:
|
||||
*/
|
||||
time_t trigger;
|
||||
|
||||
/** Numer of seconds between triggers
|
||||
/** Number of seconds between triggers
|
||||
*/
|
||||
long secs;
|
||||
time_t secs;
|
||||
|
||||
/** True if this is a repeating timer
|
||||
*/
|
||||
@@ -37,14 +37,14 @@ public:
|
||||
* @param time_from_now The number of seconds from now to trigger the timer
|
||||
* @param repeating Repeat this timer every time_from_now if this is true
|
||||
*/
|
||||
Timer(long time_from_now, bool repeating = false);
|
||||
Timer(time_t time_from_now, bool repeating = false);
|
||||
|
||||
/** Constructor, initializes the triggering time
|
||||
* @param creator The creator of the timer
|
||||
* @param time_from_now The number of seconds from now to trigger the timer
|
||||
* @param repeating Repeat this timer every time_from_now if this is true
|
||||
*/
|
||||
Timer(Module *creator, long time_from_now, bool repeating = false);
|
||||
Timer(Module *creator, time_t time_from_now, bool repeating = false);
|
||||
|
||||
/** Destructor, removes the timer from the list
|
||||
*/
|
||||
|
||||
@@ -70,7 +70,7 @@ class NickServHeld final
|
||||
Reference<NickAlias> na;
|
||||
Anope::string nick;
|
||||
public:
|
||||
NickServHeld(Module *me, NickAlias *n, long l)
|
||||
NickServHeld(Module *me, NickAlias *n, time_t l)
|
||||
: Timer(me, l)
|
||||
, na(n)
|
||||
, nick(na->nick)
|
||||
|
||||
@@ -211,7 +211,7 @@ class ModuleProxyScan final
|
||||
: public Timer
|
||||
{
|
||||
public:
|
||||
ConnectionTimeout(Module *c, long timeout)
|
||||
ConnectionTimeout(Module *c, time_t timeout)
|
||||
: Timer(c, timeout, true)
|
||||
{
|
||||
}
|
||||
|
||||
+4
-4
@@ -11,20 +11,20 @@
|
||||
|
||||
std::multimap<time_t, Timer *> TimerManager::Timers;
|
||||
|
||||
Timer::Timer(long time_from_now, bool repeating)
|
||||
Timer::Timer(time_t time_from_now, bool repeating)
|
||||
{
|
||||
owner = NULL;
|
||||
trigger = Anope::CurTime + time_from_now;
|
||||
trigger = Anope::CurTime + std::abs(time_from_now);
|
||||
secs = time_from_now;
|
||||
repeat = repeating;
|
||||
|
||||
TimerManager::AddTimer(this);
|
||||
}
|
||||
|
||||
Timer::Timer(Module *creator, long time_from_now, bool repeating)
|
||||
Timer::Timer(Module *creator, time_t time_from_now, bool repeating)
|
||||
{
|
||||
owner = creator;
|
||||
trigger = Anope::CurTime + time_from_now;
|
||||
trigger = Anope::CurTime + std::abs(time_from_now);
|
||||
secs = time_from_now;
|
||||
repeat = repeating;
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ class ReconnectTimer final
|
||||
: public Timer
|
||||
{
|
||||
public:
|
||||
ReconnectTimer(int wait)
|
||||
ReconnectTimer(time_t wait)
|
||||
: Timer(wait)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user