(Windows) Fixed some MinGW compiler warnings.

This commit is contained in:
Leon Styhre 2021-09-19 15:27:32 +02:00
parent e30cad2e9f
commit 970b7dd63d
2 changed files with 5 additions and 3 deletions

View file

@ -131,9 +131,10 @@ void VolumeControl::init()
// Retrieve endpoint volume.
defaultDevice->Activate(__uuidof(IAudioEndpointVolume), CLSCTX_INPROC_SERVER,
nullptr, reinterpret_cast<LPVOID*>(&endpointVolume));
if (endpointVolume == nullptr)
if (endpointVolume == nullptr) {
LOG(LogError) << "VolumeControl::init(): "
"Failed to get default audio endpoint volume!";
}
// Release default device. we don't need it anymore.
defaultDevice->Release();
}
@ -245,8 +246,9 @@ void VolumeControl::setVolume(int volume)
float floatVolume = 0.0f; // 0-1
if (volume > 0)
floatVolume = static_cast<float>(volume) / 100.0f;
if (endpointVolume->SetMasterVolumeLevelScalar(floatVolume, nullptr) != S_OK)
if (endpointVolume->SetMasterVolumeLevelScalar(floatVolume, nullptr) != S_OK) {
LOG(LogError) << "VolumeControl::setVolume(): Failed to set master volume";
}
}
#endif
}

View file

@ -132,7 +132,7 @@ bool parseArgs(int argc, char* argv[])
#if defined(_WIN64)
// Print any command line output to the console.
if (argc > 1)
win64ConsoleType consoleType = outputToConsole(false);
outputToConsole(false);
#endif
std::string portableFilePath = Utils::FileSystem::getExePath() + "/portable.txt";