From 4d3e0dbda0049fad90a6a9651f730be261a1f17c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 2 Sep 2024 21:06:01 +0200 Subject: [PATCH] update.cpp: Fix format specifiers for time_t for platform compatibility - Cast time_t variables to int64_t to match the expected format specifier. This should fix addresses the warnings about mismatched format specifiers for time_t. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/91531a287a2691e290af760dfca76caa7ce59646 Author: Thilo Graf Date: 2024-09-02 (Mon, 02 Sep 2024) ------------------ This commit was generated by Migit --- src/gui/update.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 6a7cdcc90..a8d4a1344 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -153,8 +153,7 @@ void CFlashUpdate::update_php(std::string &url, const char *type) } } -bool CFlashUpdate::checkOnlineVersion() -{ +bool CFlashUpdate::checkOnlineVersion() { CHTTPTool httpTool; std::string url; std::string name; @@ -173,7 +172,7 @@ bool CFlashUpdate::checkOnlineVersion() dprintf(DEBUG_NORMAL, "[update] file %s\n", g_settings.softupdate_url_file.c_str()); CFlashVersionInfo curInfo(versionString.c_str()); curVer = curInfo.getVersion(); - dprintf(DEBUG_NORMAL, "[update] current flash-version: %s (%d) date %s (%ld)\n", versionString.c_str(), curInfo.getVersion(), curInfo.getDate(), curInfo.getDateTime()); + dprintf(DEBUG_NORMAL, "[update] current flash-version: %s (%d) date %s (%" PRId64 ")\n", versionString.c_str(), curInfo.getVersion(), curInfo.getDate(), static_cast(curInfo.getDateTime())); std::ifstream urlFile(g_settings.softupdate_url_file.c_str()); if (urlFile >> url) @@ -200,7 +199,7 @@ bool CFlashUpdate::checkOnlineVersion() std::getline(in, name); CFlashVersionInfo versionInfo(version); newVer = versionInfo.getVersion(); - dprintf(DEBUG_NORMAL, "[update] url %s version %s (%d) timestamp %s (%ld) md5 %s name %s\n", url.c_str(), version.c_str(), newVer, versionInfo.getDate(), versionInfo.getDateTime(), md5.c_str(), name.c_str()); + dprintf(DEBUG_NORMAL, "[update] url %s version %s (%d) timestamp %s (%" PRId64 ") md5 %s name %s\n", url.c_str(), version.c_str(), newVer, versionInfo.getDate(), static_cast(versionInfo.getDateTime()), md5.c_str(), name.c_str()); if (versionInfo.snapshot <= '9' && (newVer > curVer || versionInfo.getDateTime() > curInfo.getDateTime())) { newfound = true; @@ -237,7 +236,7 @@ bool CFlashUpdate::selectHttpImage(void) } CFlashVersionInfo curInfo(versionString.c_str()); - dprintf(DEBUG_NORMAL, "[update] current flash-version: %s (%d) date %s (%ld)\n", versionString.c_str(), curInfo.getVersion(), curInfo.getDate(), curInfo.getDateTime()); + dprintf(DEBUG_NORMAL, "[update] current flash-version: %s (%d) date %s (%" PRId64 ")\n", versionString.c_str(), curInfo.getVersion(), curInfo.getDate(), static_cast(curInfo.getDateTime())); curVer = curInfo.getVersion(); httpTool.setStatusViewer(this); @@ -295,7 +294,7 @@ bool CFlashUpdate::selectHttpImage(void) CFlashVersionInfo versionInfo(versions[i]); newVer = versionInfo.getVersion(); - dprintf(DEBUG_NORMAL, "[update] url %s version %s (%d) timestamp %s (%ld) md5 %s name %s\n", url.c_str(), version.c_str(), newVer, versionInfo.getDate(), versionInfo.getDateTime(), md5.c_str(), name.c_str()); + dprintf(DEBUG_NORMAL, "[update] url %s version %s (%d) timestamp %s (%" PRId64 ") md5 %s name %s\n", url.c_str(), version.c_str(), newVer, versionInfo.getDate(), static_cast(versionInfo.getDateTime()), md5.c_str(), name.c_str()); if (versionInfo.snapshot <= '9' && (newVer > curVer || versionInfo.getDateTime() > curInfo.getDateTime())) newfound = 1; fileTypes[i] = versionInfo.snapshot;