From 588d56658bff9bc73dcc7ef1a1fae9a656557f85 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 2 Sep 2024 21:06:01 +0200 Subject: [PATCH] timermanager.cpp: Fix format specifiers - Changed format specifiers from %ld to %" PRId64 " for `time_t` variables to ensure compatibility across different platforms. - Cast `time_t` variables to `int64_t` for proper formatting. - Updated printf statements and debug macros accordingly. - Fixes some translations and code formatting. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c1e257ec5c731a507d360d8aba48a36801d365fd Author: Thilo Graf Date: 2024-09-02 (Mon, 02 Sep 2024) Origin message was: ------------------ timermanager.cpp: Fix format specifiers - Changed format specifiers from %ld to %" PRId64 " for `time_t` variables to ensure compatibility across different platforms. - Cast `time_t` variables to `int64_t` for proper formatting. - Updated printf statements and debug macros accordingly. - Fixes some translations and code formatting. ------------------ This commit was generated by Migit --- src/timerd/timermanager.cpp | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 79c06d6a5..5cede0444 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -747,17 +747,17 @@ void CTimerManager::saveEventsToConfig() bool CTimerManager::shutdown() { timerd_debug = 1; //FIXME - time_t nextAnnounceTime=0; - bool status=false; + time_t nextAnnounceTime = 0; + bool status = false; timer_is_rec = false; dprintf("stopping timermanager thread ...\n"); dprintf("Waiting for timermanager thread to terminate ...\n"); pthread_cancel(thrTimer); - pthread_join(thrTimer,NULL); + pthread_join(thrTimer, NULL); dprintf("Timermanager thread terminated\n"); - if(m_saveEvents) + if (m_saveEvents) { dprintf("shutdown: saving config\n"); saveEventsToConfig(); @@ -771,23 +771,23 @@ bool CTimerManager::shutdown() } CTimerEventMap::iterator pos = events.begin(); - for(;pos != events.end();++pos) + for (; pos != events.end(); ++pos) { CTimerEvent *event = pos->second; - dprintf("shutdown: timer type %d state %d announceTime: %ld\n", event->eventType, event->eventState, event->announceTime); - bool standby_on_timer = (event->eventType == CTimerd::TIMER_STANDBY && static_cast(event)->standby_on);// wakeup without CEC-on from depstanby + dprintf("shutdown: timer type %d state %d announceTime: %" PRId64 "\n", event->eventType, event->eventState, (int64_t)event->announceTime); + bool standby_on_timer = (event->eventType == CTimerd::TIMER_STANDBY && static_cast(event)->standby_on); // wakeup without CEC-on from deep standby - if((event->eventType == CTimerd::TIMER_RECORD || - event->eventType == CTimerd::TIMER_EXEC_PLUGIN || //NI - event->eventType == CTimerd::TIMER_ZAPTO || standby_on_timer ) && + if ((event->eventType == CTimerd::TIMER_RECORD || + event->eventType == CTimerd::TIMER_EXEC_PLUGIN || //NI + event->eventType == CTimerd::TIMER_ZAPTO || standby_on_timer) && event->eventState < CTimerd::TIMERSTATE_ISRUNNING) { - // Wir wachen nur für Records und Zaptos und Stanby-ON wieder auf - if(event->announceTime < nextAnnounceTime || nextAnnounceTime==0) + // We wake up only for Records and Zaptos and Standby-ON + if (event->announceTime < nextAnnounceTime || nextAnnounceTime == 0) { - nextAnnounceTime=event->announceTime; - dprintf("shutdown: nextAnnounceTime %ld\n", nextAnnounceTime); - if ( event->eventType == CTimerd::TIMER_RECORD || standby_on_timer ) + nextAnnounceTime = event->announceTime; + dprintf("shutdown: nextAnnounceTime %" PRId64 "\n", (int64_t)nextAnnounceTime); + if (event->eventType == CTimerd::TIMER_RECORD || standby_on_timer) timer_is_rec = true; else timer_is_rec = false; @@ -796,12 +796,12 @@ bool CTimerManager::shutdown() } timer_minutes = 0; - if(nextAnnounceTime != 0) + if (nextAnnounceTime != 0) { - timer_minutes = (nextAnnounceTime - 3*60)/60; + timer_minutes = (nextAnnounceTime - 3 * 60) / 60; } - dprintf("shutdown: timeset: %d timer_minutes %ld\n", timeset, timer_minutes); - if(rc == 0) + dprintf("shutdown: timeset: %d timer_minutes %" PRId64 "\n", timeset, (int64_t)timer_minutes); + if (rc == 0) pthread_mutex_unlock(&tm_eventsMutex); return status; }