diff --git a/src/detail/standalone/windows/windows_standalone.cpp b/src/detail/standalone/windows/windows_standalone.cpp index db74faee..a8b40bec 100644 --- a/src/detail/standalone/windows/windows_standalone.cpp +++ b/src/detail/standalone/windows/windows_standalone.cpp @@ -21,7 +21,7 @@ ::HFONT getScaledFontFromSystem(double scale) { ::LOGFONTW fontAttributes{}; ::GetObjectW(getFontFromSystem(), sizeof(fontAttributes), &fontAttributes); - fontAttributes.lfHeight = fontAttributes.lfHeight * scale; + fontAttributes.lfHeight = static_cast<::LONG>(fontAttributes.lfHeight * scale); return ::CreateFontIndirectW(&fontAttributes); } @@ -161,18 +161,14 @@ int run() return static_cast(msg.wParam); } -int abort(int exitCode) +void abort(int exitCode) { ::ExitProcess(exitCode); - - return exitCode; } -int quit(int exitCode) +void quit(int exitCode) { ::PostQuitMessage(exitCode); - - return exitCode; } bool MessageHandler::on(::UINT msg, MessageCallback callback) @@ -1072,7 +1068,7 @@ Plugin::Plugin(const clap_plugin_entry* entry, int argc, char** argv) // We can restore size here // setWindowPosition(m_window.hwnd.get(), previousWidth, previousHeight); // log("x: {} y: {}", sah->position.x, sah->position.y); - if (position.width != 0 | position.height != 0) + if (position.width != 0 || position.height != 0) { setPosition(position); } @@ -1100,7 +1096,7 @@ Plugin::Plugin(const clap_plugin_entry* entry, int argc, char** argv) else { setStyle(WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX); - adjustSize(500 * scale, 0); + adjustSize(static_cast(500 * scale), 0); toggleCentered(true); } @@ -1163,8 +1159,8 @@ void Plugin::refreshLayout() settings.bufferSize.refreshFont(settings.scale); settings.midiIn.refreshFont(settings.scale); - auto x{150 * settings.scale}; - auto width{500 * settings.scale}; + auto x{static_cast(150 * settings.scale)}; + auto width{static_cast(500 * settings.scale)}; auto height{settings.api.position.height}; settings.api.setPosition(x, 10, width - x - 10, height); @@ -1182,9 +1178,9 @@ void Plugin::refreshLayout() x, settings.sampleRate.position.y + settings.sampleRate.position.height + 10, width - x - 10, height); - settings.midiIn.setPosition(x, - settings.bufferSize.position.y + settings.bufferSize.position.height + 10, - width - x - 10, (settings.midiIn.getItemHeight() * sah->numMidiPorts)); + settings.midiIn.setPosition( + x, settings.bufferSize.position.y + settings.bufferSize.position.height + 10, width - x - 10, + (static_cast(settings.midiIn.getItemHeight() * sah->numMidiPorts))); if (sah->numMidiPorts != 0) { @@ -1327,12 +1323,13 @@ bool Plugin::loadSettings() sah->audioApiName = settings.get("audioApiName"); sah->audioApi = sah->rtaDac->getCompiledApiByName(sah->audioApiName); sah->audioApiDisplayName = sah->rtaDac->getApiDisplayName(sah->audioApi); - sah->audioInputDeviceID = settings.get("audioInputDeviceID"); - sah->audioOutputDeviceID = settings.get("audioOutputDeviceID"); + sah->audioInputDeviceID = static_cast(settings.get("audioInputDeviceID")); + sah->audioOutputDeviceID = + static_cast(settings.get("audioOutputDeviceID")); sah->audioInputUsed = settings.get("audioInputUsed"); sah->audioOutputUsed = settings.get("audioOutputUsed"); - sah->currentSampleRate = settings.get("currentSampleRate"); - sah->currentBufferSize = settings.get("currentBufferSize"); + sah->currentSampleRate = static_cast(settings.get("currentSampleRate")); + sah->currentBufferSize = static_cast(settings.get("currentBufferSize")); position = settings.get("position"); return parsed; diff --git a/src/detail/standalone/windows/windows_standalone.h b/src/detail/standalone/windows/windows_standalone.h index 71e8a240..b4f6a933 100644 --- a/src/detail/standalone/windows/windows_standalone.h +++ b/src/detail/standalone/windows/windows_standalone.h @@ -68,8 +68,8 @@ void log(const fmt::wformat_string fmt, Args&&... args) } int run(); -int abort(int exitCode = EXIT_FAILURE); -int quit(int exitCode = EXIT_SUCCESS); +void abort(int exitCode = EXIT_FAILURE); +void quit(int exitCode = EXIT_SUCCESS); struct Message {