diff --git a/src/common/events.h b/src/common/events.h index d1d06429..f49544cc 100644 --- a/src/common/events.h +++ b/src/common/events.h @@ -39,7 +39,7 @@ class DefaultDataConverter { const int /*index*/, const intptr_t /*value*/, const void* data) { - if (data == nullptr) { + if (!data) { return nullptr; } @@ -355,7 +355,7 @@ auto passthrough_event(AEffect* plugin, F callback) { // `effEditOpen()` I can assume there are plugins that don't // handle this correctly. VstRect* editor_rect = *static_cast(data); - if (editor_rect == nullptr) { + if (!editor_rect) { return nullptr; } @@ -369,7 +369,7 @@ auto passthrough_event(AEffect* plugin, F callback) { // host doesn't support this. const auto time_info = reinterpret_cast(return_value); - if (time_info == nullptr) { + if (!time_info) { return nullptr; } else { return *time_info; diff --git a/src/plugin/configuration.cpp b/src/plugin/configuration.cpp index a7fd2984..b1b42f18 100644 --- a/src/plugin/configuration.cpp +++ b/src/plugin/configuration.cpp @@ -50,7 +50,7 @@ Configuration::Configuration(const fs::path& config_path, // If the table is missing some fields then they will simply be left at // their defaults - if (toml::table* config = value.as_table(); config != nullptr) { + if (toml::table* config = value.as_table()) { group = (*config)["group"].value(); } diff --git a/src/wine-host/bridges/vst2.cpp b/src/wine-host/bridges/vst2.cpp index 274ea05e..4f5d1e85 100644 --- a/src/wine-host/bridges/vst2.cpp +++ b/src/wine-host/bridges/vst2.cpp @@ -58,7 +58,7 @@ uint32_t WINAPI handle_process_replacing_proxy(void*); Vst2Bridge& get_bridge_instance(const AEffect* plugin) { // This is needed during the initialization of the plugin since we can only // add our own pointer after it's done initializing - if (current_bridge_instance != nullptr) { + if (current_bridge_instance) { return *current_bridge_instance; } @@ -77,7 +77,7 @@ Vst2Bridge::Vst2Bridge(boost::asio::io_context& main_context, host_vst_parameters(io_context), host_vst_process_replacing(io_context) { // Got to love these C APIs - if (plugin_handle == nullptr) { + if (!plugin_handle) { throw std::runtime_error("Could not load the Windows .dll file at '" + plugin_dll_path + "'"); } @@ -90,11 +90,11 @@ Vst2Bridge::Vst2Bridge(boost::asio::io_context& main_context, reinterpret_cast(reinterpret_cast( GetProcAddress(plugin_handle.get(), name))); - if (vst_entry_point != nullptr) { + if (vst_entry_point) { break; } } - if (vst_entry_point == nullptr) { + if (!vst_entry_point) { throw std::runtime_error( "Could not find a valid VST entry point for '" + plugin_dll_path + "'."); @@ -116,7 +116,7 @@ Vst2Bridge::Vst2Bridge(boost::asio::io_context& main_context, std::lock_guard lock(current_bridge_instance_mutex); current_bridge_instance = this; plugin = vst_entry_point(host_callback_proxy); - if (plugin == nullptr) { + if (!plugin) { throw std::runtime_error("VST plugin at '" + plugin_dll_path + "' failed to initialize."); } @@ -301,7 +301,7 @@ void Vst2Bridge::handle_process_replacing() { // Any plugin made in the last fifteen years or so should // support `processReplacing`. In the off chance it does not we // can just emulate this behavior ourselves. - if (plugin->processReplacing != nullptr) { + if (plugin->processReplacing) { plugin->processReplacing(plugin, inputs.data(), outputs.data(), request.sample_frames); diff --git a/src/wine-host/editor.cpp b/src/wine-host/editor.cpp index e316c3d6..d4d3c418 100644 --- a/src/wine-host/editor.cpp +++ b/src/wine-host/editor.cpp @@ -258,7 +258,7 @@ LRESULT CALLBACK window_proc(HWND handle, reinterpret_cast(lParam); const auto editor = static_cast(window_parameters->lpCreateParams); - if (editor == nullptr) { + if (!editor) { break; } @@ -272,7 +272,7 @@ LRESULT CALLBACK window_proc(HWND handle, case WM_TIMER: { auto editor = reinterpret_cast( GetWindowLongPtr(handle, GWLP_USERDATA)); - if (editor == nullptr || wParam != idle_timer_id) { + if (!editor || wParam != idle_timer_id) { break; }