From 19b875830b1afc3e3b907eece5c7df4a7e2cc4a4 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 8 Jul 2020 22:33:14 +0200 Subject: [PATCH] Stop using deprecated CFAbsoluteTimeAddGregorianUnits() since we are still working in seconds, the replacement is rather simple --- src/osx/core/timer.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/osx/core/timer.cpp b/src/osx/core/timer.cpp index b78d63c5e6..900295d2b6 100644 --- a/src/osx/core/timer.cpp +++ b/src/osx/core/timer.cpp @@ -69,10 +69,6 @@ bool wxOSXTimerImpl::Start( int milliseconds, bool mode ) wxCHECK_MSG( m_milli > 0, false, wxT("invalid value for timer timeout") ); wxCHECK_MSG( m_info->m_timerRef == NULL, false, wxT("attempting to restart a timer") ); - CFGregorianUnits gumilli ; - memset(&gumilli,0,sizeof(gumilli) ); - gumilli.seconds = m_milli / 1000.0; - CFRunLoopTimerContext ctx ; memset( &ctx, 0 , sizeof(ctx) ); ctx.version = 0; @@ -80,8 +76,7 @@ bool wxOSXTimerImpl::Start( int milliseconds, bool mode ) m_info->m_timer = this; m_info->m_timerRef = CFRunLoopTimerCreate( - kCFAllocatorDefault, - CFAbsoluteTimeAddGregorianUnits( CFAbsoluteTimeGetCurrent() , NULL, gumilli ), + kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + m_milli / 1000.0, IsOneShot() ? 0 : CFTimeInterval( m_milli / 1000.0 ) , 0, 0, wxProcessTimer, &ctx);