]> git.tdb.fi Git - libs/core.git/blobdiff - source/time/timer.cpp
Drop copyright and license notices from source files
[libs/core.git] / source / time / timer.cpp
index 9471463216206b701d285562bb41e0af1901fafc..59360b63fa6e18a83fed699429bf7e76a75d0b75 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspcore     
-Copyright © 2006, 2009  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include <algorithm>
 #include "timer.h"
 #include "utils.h"
@@ -22,7 +15,7 @@ Timer::~Timer()
 
 Timer::Slot &Timer::add(const TimeDelta &td)
 {
-       Slot *s=new Slot(td);
+       Slot *s = new Slot(td);
        mutex.lock();
        slots.push_back(s);
        push_heap(slots.begin(), slots.end());
@@ -33,7 +26,7 @@ Timer::Slot &Timer::add(const TimeDelta &td)
 
 Timer::Slot &Timer::add(const TimeStamp &ts)
 {
-       Slot *s=new Slot(ts);
+       Slot *s = new Slot(ts);
        {
                MutexLock l(mutex);
                slots.push_back(s);
@@ -58,7 +51,7 @@ void Timer::cancel(Slot &slot)
 
 void Timer::tick(bool block)
 {
-       Slot *next=0;
+       Slot *next = 0;
        {
                MutexLock l(mutex);
                while(1)
@@ -71,9 +64,9 @@ void Timer::tick(bool block)
                                        return;
                        }
 
-                       next=slots.begin()->slot;
-                       const TimeStamp &stamp=next->get_timeout();
-                       const TimeStamp t=now();
+                       next = slots.begin()->slot;
+                       const TimeStamp &stamp = next->get_timeout();
+                       const TimeStamp t = now();
                        if(stamp<=t)
                                break;
                        else if(block)
@@ -125,7 +118,7 @@ bool Timer::Slot::increment()
 {
        if(!interval)
                return false;
-       timeout+=interval;
+       timeout += interval;
        return true;
 }