]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/timer.cpp
Applied a modification of Patch #704995 which changes how the lines
[wxWidgets.git] / src / generic / timer.cpp
index 39974a6b8e361efac41926879df2acce05aea7cb..97ac996536e5039e8b25a21d24eb46e153f6e294 100644 (file)
@@ -3,7 +3,7 @@
 // Purpose:     wxTimer implementation
 // Author:      Vaclav Slavik
 // Id:          $Id$
-// Copyright:   (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
+// Copyright:   (c) Vaclav Slavik
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
     extern "C" ulong _EVT_getTicks();
     #define GetMillisecondsTime() _EVT_getTicks()
 #else
-    #define GetMillisecondsTime() wxGetLocalTimeMillis().ToLong()
+//    #define GetMillisecondsTime() wxGetLocalTimeMillis().ToLong()
+    // Suppresses the debug warning in ToLong. FIXME: check
+    // that we don't drastically lose precision
+    #define GetMillisecondsTime() (unsigned long) wxGetLocalTimeMillis().GetValue()
 #endif
 
 // ----------------------------------------------------------------------------
@@ -87,8 +90,8 @@ void wxTimerScheduler::QueueTimer(wxTimerDesc *desc, unsigned long when)
     desc->shotTime = when;
     desc->running = TRUE;
 
-    wxLogTrace("timer", "queued timer %p at tick %i"
-               desc->timer, when);
+    wxLogTrace( wxT("timer"), wxT("queued timer %p at tick %ld")
+               desc->timer, (long) when);
 
     if ( m_timers )
     {
@@ -140,8 +143,8 @@ void wxTimerScheduler::NotifyTimers()
             
             if ( !timerDeleted )
             {
-                wxLogTrace("timer", "notified timer %p sheduled for %i"
-                           desc->timer, desc->shotTime);
+                wxLogTrace( wxT("timer"), wxT("notified timer %p sheduled for %ld")
+                           desc->timer, (long) desc->shotTime);
 
                 desc->deleteFlag = NULL;
                 if ( !oneShot )
@@ -169,7 +172,7 @@ void wxTimer::Init()
 
 wxTimer::~wxTimer()
 {
-    wxLogTrace("timer", "destroying timer %p...", this);
+    wxLogTrace( wxT("timer"), wxT("destroying timer %p..."), this);
     if ( IsRunning() )
         Stop();
 
@@ -181,7 +184,7 @@ wxTimer::~wxTimer()
         *m_desc->deleteFlag = TRUE;
 
     delete m_desc;
-    wxLogTrace("timer", "    ...done destroying timer %p...", this);
+    wxLogTrace( wxT("timer"), wxT("    ...done destroying timer %p..."), this);
 }
 
 bool wxTimer::IsRunning() const
@@ -191,7 +194,7 @@ bool wxTimer::IsRunning() const
 
 bool wxTimer::Start(int millisecs, bool oneShot)
 {
-    wxLogTrace("timer", "started timer %p: %i ms, oneshot=%i"
+    wxLogTrace( wxT("timer"), wxT("started timer %p: %i ms, oneshot=%i")
                this, millisecs, oneShot);
 
     if ( !wxTimerBase::Start(millisecs, oneShot) )