diff --git a/cmake/enable_sdks.cmake b/cmake/enable_sdks.cmake index 23f1d4e9..5b60e44b 100644 --- a/cmake/enable_sdks.cmake +++ b/cmake/enable_sdks.cmake @@ -340,7 +340,7 @@ function(target_add_vst3_wrapper) ) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") - target_compile_options(${V3_TARGET}-clap-wrapper-vst3-lib PRIVATE -Wall) + target_compile_options(${V3_TARGET}-clap-wrapper-vst3-lib PRIVATE -Wall -Wextra -Wno-unused-parameter -Wpedantic) endif() if (APPLE) target_link_libraries(${V3_TARGET}-clap-wrapper-vst3-lib PUBLIC macos_filesystem_support) diff --git a/src/detail/vst3/process.cpp b/src/detail/vst3/process.cpp index 959119a3..c0763ecb 100644 --- a/src/detail/vst3/process.cpp +++ b/src/detail/vst3/process.cpp @@ -49,7 +49,7 @@ namespace Clap if ( numInputs > 0) { _input_ports = new clap_audio_buffer_t[numInputs]; - for (int i = 0; i < numInputs; ++i) + for (auto i = 0U; i < numInputs; ++i) { clap_audio_buffer_t& bus = _input_ports[i]; Vst::BusInfo info; @@ -77,7 +77,7 @@ namespace Clap if (numOutputs > 0) { _output_ports = new clap_audio_buffer_t[numOutputs]; - for (int i = 0; i < numOutputs; ++i) + for (auto i = 0U; i < numOutputs; ++i) { clap_audio_buffer_t& bus = _output_ports[i]; Vst::BusInfo info; @@ -361,7 +361,7 @@ namespace Clap { // setting the buffers auto inbusses = _audioinputs->size(); - for (int i = 0; i < inbusses; ++i) + for (auto i = 0U; i < inbusses; ++i) { if (_vstdata->inputs[i].numChannels > 0) _input_ports[i].data32 = _vstdata->inputs[i].channelBuffers32; @@ -370,7 +370,7 @@ namespace Clap } auto outbusses = _audiooutputs->size(); - for (int i = 0; i < outbusses; ++i) + for (auto i = 0U; i < outbusses; ++i) { if (_vstdata->outputs[i].numChannels > 0) _output_ports[i].data32 = _vstdata->outputs[i].channelBuffers32; diff --git a/src/detail/vst3/process.h b/src/detail/vst3/process.h index c59aea1f..41d4bd83 100644 --- a/src/detail/vst3/process.h +++ b/src/detail/vst3/process.h @@ -13,10 +13,21 @@ */ #include + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wextra" +#endif + #include #include #include #include + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + #include #include diff --git a/src/wrapasvst3.cpp b/src/wrapasvst3.cpp index 79fad4b9..8c9b0ed3 100644 --- a/src/wrapasvst3.cpp +++ b/src/wrapasvst3.cpp @@ -399,11 +399,11 @@ void ClapAsVst3::addMIDIBusFrom(const clap_note_port_info_t* info, uint32_t inde void ClapAsVst3::updateAudioBusses() { - for ( int i = 0 ; i < audioInputs.size() ; ++i) + for ( auto i = 0U; i < audioInputs.size() ; ++i) { _processAdapter->activateAudioBus(Vst::kInput, i,audioInputs[i]->isActive()); } - for (int i = 0; i < audioOutputs.size(); ++i) + for (auto i = 0U; i < audioOutputs.size(); ++i) { _processAdapter->activateAudioBus(Vst::kOutput, i, audioOutputs[i]->isActive()); } @@ -668,7 +668,7 @@ void ClapAsVst3::param_rescan(clap_param_rescan_flags flags) vstflags |= Vst::RestartFlags::kMidiCCAssignmentChanged; } - vstflags |= ((flags & CLAP_PARAM_RESCAN_VALUES) ? Vst::RestartFlags::kParamValuesChanged : 0u); + vstflags |= ((flags & CLAP_PARAM_RESCAN_VALUES) ? (uint32_t)Vst::RestartFlags::kParamValuesChanged : 0u); vstflags |= ((flags & CLAP_PARAM_RESCAN_INFO) ? Vst::RestartFlags::kParamValuesChanged | Vst::RestartFlags::kParamTitlesChanged : 0u); if (vstflags != 0) { diff --git a/src/wrapasvst3.h b/src/wrapasvst3.h index 7458a21e..5403e5d9 100644 --- a/src/wrapasvst3.h +++ b/src/wrapasvst3.h @@ -14,10 +14,21 @@ */ #include "clap_proxy.h" + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wextra" +#endif + #include #include #include #include + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + #include "detail/vst3/plugview.h" #include "detail/os/osutil.h" #include "detail/clap/automation.h" diff --git a/src/wrapasvst3_entry.cpp b/src/wrapasvst3_entry.cpp index 078cbe11..764399bd 100644 --- a/src/wrapasvst3_entry.cpp +++ b/src/wrapasvst3_entry.cpp @@ -268,7 +268,7 @@ IPluginFactory* GetPluginFactoryEntryPoint() { char x[sizeof(g)*2+8]; char* o = x; constexpr char hexchar[] = "0123456789ABCDEF"; - for (int i = 0 ; i < sizeof(g) ; i++) + for (auto i = 0U ; i < sizeof(g) ; i++) { auto n = v[i]; *o++ = hexchar[(n >> 4) & 0xF];