From 07efc7f7a3b4271dbf5489e21ec6ccf3f6d7cece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 19 May 2026 13:59:04 +0200 Subject: [PATCH] Buildfix, remove some .c_str() --- Common/TimeUtil.cpp | 2 +- Common/TimeUtil.h | 2 +- Core/SaveState.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Common/TimeUtil.cpp b/Common/TimeUtil.cpp index 2279f11d77..1178e4e213 100644 --- a/Common/TimeUtil.cpp +++ b/Common/TimeUtil.cpp @@ -385,7 +385,7 @@ void GetCurrentTimeFormatted(char formattedTime[13]) { #endif } -void FormatUnixTime(double unixTimeSeconds, char *formatted, size_t bufSize, bool includeDate) { +void FormatUnixTime(double unixTimeSeconds, char *formatted, int bufSize, bool includeDate) { #ifdef _WIN32 ULARGE_INTEGER uli; uli.QuadPart = (ULONGLONG)(unixTimeSeconds * TICKS_PER_SECOND) + UNIX_TIME_START; // Convert seconds to ticks and add the offset to get FILETIME ticks. diff --git a/Common/TimeUtil.h b/Common/TimeUtil.h index 27adb8ade2..30f4802ffa 100644 --- a/Common/TimeUtil.h +++ b/Common/TimeUtil.h @@ -34,7 +34,7 @@ void sleep_random(double minSeconds, double maxSeconds, const char *reason); void yield(); void GetCurrentTimeFormatted(char formattedTime[13]); -void FormatUnixTime(double unixTimeSeconds, char *formatted, size_t bufSize, bool includeDate = true); +void FormatUnixTime(double unixTimeSeconds, char *formatted, int bufSize, bool includeDate = true); // Most accurate timer possible - no extra double conversions. Only for spans. class Instant { diff --git a/Core/SaveState.cpp b/Core/SaveState.cpp index 521c6057c1..cdc7843f5d 100644 --- a/Core/SaveState.cpp +++ b/Core/SaveState.cpp @@ -832,7 +832,7 @@ int g_screenshotFailures; if (result == CChunkFileReader::ERROR_NONE) { callbackMessage = op.slot != LOAD_UNDO_SLOT ? sc->T("Loaded State") : sc->T("State load undone"); callbackResult = TriggerLoadWarnings(callbackMessage); - callbackMetadata = SaveState::GetSaveFileDateAsString(op.path.GetFilename().c_str()); + callbackMetadata = SaveState::GetSaveFileDateAsString(op.path.GetFilename()); hasLoadedState = true; Core_ResetException(); @@ -858,7 +858,7 @@ int g_screenshotFailures; ERROR_LOG(Log::SaveState, "Load state failure: %s", errorString.c_str()); callbackResult = Status::FAILURE; } else { - callbackMessage = sc->T(errorString.c_str(), i18nLoadFailure); + callbackMessage = sc->T(errorString, i18nLoadFailure); callbackResult = Status::FAILURE; } break;