Skip to content

Commit

Permalink
Turn on Wextra and Wpedantic on clang/gcc
Browse files Browse the repository at this point in the history
Ignore unused-parameter; it is useful to document intent.
Keep the rest
If we merge free-audio#107 we will be able to turn on Werror also, at least
on mac.
  • Loading branch information
baconpaul committed Sep 8, 2023
1 parent f7a55fd commit 585bbfd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmake/enable_sdks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions src/detail/vst3/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/wrapasvst3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,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());
}
Expand Down
2 changes: 1 addition & 1 deletion src/wrapasvst3_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 585bbfd

Please sign in to comment.