From 379d5ca3768b254cc2480e4a2a7a3daf29027164 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 15 Nov 2025 13:34:11 -0600 Subject: [PATCH] Fix some compiler warnings --- app/main.cpp | 18 ++++++++++++++---- app/streaming/audio/audio.cpp | 2 ++ app/streaming/bandwidth.cpp | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index 1b52830e..8fb91494 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -621,12 +621,22 @@ int main(int argc, char *argv[]) if (AttachConsole(ATTACH_PARENT_PROCESS)) { // If we didn't have an old stdout/stderr handle, use the new CONOUT$ handle if (IS_UNSPECIFIED_HANDLE(oldConOut)) { - freopen("CONOUT$", "w", stdout); - setvbuf(stdout, NULL, _IONBF, 0); + FILE* fp; + if (freopen_s(&fp, "CONOUT$", "w", stdout) == 0) { + setvbuf(fp, NULL, _IONBF, 0); + } + else { + freopen_s(&fp, "NUL", "w", stdout); + } } if (IS_UNSPECIFIED_HANDLE(oldConErr)) { - freopen("CONOUT$", "w", stderr); - setvbuf(stderr, NULL, _IONBF, 0); + FILE* fp; + if (freopen_s(&fp, "CONOUT$", "w", stderr) == 0) { + setvbuf(fp, NULL, _IONBF, 0); + } + else { + freopen_s(&fp, "NUL", "w", stderr); + } } } #endif diff --git a/app/streaming/audio/audio.cpp b/app/streaming/audio/audio.cpp index 4fd3d71d..4668eec9 100644 --- a/app/streaming/audio/audio.cpp +++ b/app/streaming/audio/audio.cpp @@ -97,6 +97,8 @@ int Session::getAudioRendererCapabilities(int audioConfiguration) { int caps = 0; + Q_UNUSED(audioConfiguration); + // All audio renderers support arbitrary audio duration caps |= CAPABILITY_SUPPORTS_ARBITRARY_AUDIO_DURATION; diff --git a/app/streaming/bandwidth.cpp b/app/streaming/bandwidth.cpp index f5a184c6..cb3dfe3d 100644 --- a/app/streaming/bandwidth.cpp +++ b/app/streaming/bandwidth.cpp @@ -67,7 +67,7 @@ double BandwidthTracker::GetPeakMbps() { } unsigned int BandwidthTracker::GetWindowSeconds() { - return windowSeconds.count(); + return (unsigned int)windowSeconds.count(); } /// private methods