Skip to content

Commit 00e671d

Browse files
committed
Deal with C++ and cmake warnings
1 parent 0e4b990 commit 00e671d

File tree

2 files changed

+27
-18
lines changed

2 files changed

+27
-18
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
cmake_minimum_required(VERSION 3.18)
1010

11+
cmake_policy(SET CMP0177 NEW)
12+
1113
set(CMAKE_CXX_STANDARD 17)
1214
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1315
set(CMAKE_CXX_EXTENSIONS OFF)
@@ -110,9 +112,10 @@ endif()
110112

111113
FetchContent_Declare(
112114
fluid_waveform
113-
URL https://github.com/flucoma/fluid.waveform/releases/download/build/fluid.waveform.tar.gz
115+
URL https://github.com/flucoma/fluid.waveform/releases/download/build/fluid.waveform.tar.gz
114116
CONFIGURE_COMMAND ""
115117
BUILD_COMMAND ""
118+
DOWNLOAD_EXTRACT_TIMESTAMP
116119
)
117120
FetchContent_MakeAvailable(fluid_waveform)
118121

source/include/FluidMaxWrapper.hpp

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ under the European Union’s Horizon 2020 research and innovation programme
3535
#include <tuple>
3636
#include <utility>
3737

38+
#pragma clang diagnostic push
39+
#pragma clang diagnostic ignored "-Winvalid-offsetof"
40+
#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
41+
3842
namespace fluid {
3943
namespace client {
4044

@@ -225,26 +229,26 @@ class RealTime
225229
case 1:
226230
{
227231
if(!client.controlChannelsIn())
228-
snprintf_zero(s, 512, "(signal) %s", client.getInputLabel(index));
232+
snprintf_zero(s, 256, "(signal) %s", client.getInputLabel(index));
229233
else
230-
snprintf_zero(s, 512, "(list) %s", client.getInputLabel(index));
234+
snprintf_zero(s, 256, "(list) %s", client.getInputLabel(index));
231235
break;
232236
}
233237
case 2:
234238
if (index < client.audioChannelsOut())
235239
{
236-
snprintf_zero(s, 512, "(signal) %s", client.getOutputLabel(index));
240+
snprintf_zero(s, 256, "(signal) %s", client.getOutputLabel(index));
237241
break;
238242
}
239243
else if (index <
240244
client.audioChannelsOut() + client.controlChannelsOut().count)
241245
{
242-
snprintf_zero(s, 512, "(list) %s", client.getOutputLabel(index));
246+
snprintf_zero(s, 256, "(list) %s", client.getOutputLabel(index));
243247
break;
244248
}
245249
else
246250
{
247-
strncpy_zero(s, "(list) dumpout", 512);
251+
strncpy_zero(s, "(list) dumpout", 256);
248252
break;
249253
}
250254
}
@@ -465,16 +469,16 @@ struct NonRealTime
465469
{
466470
switch (io)
467471
{
468-
case 1: strncpy_zero(s, "(anything) messages in", 512); break;
472+
case 1: strncpy_zero(s, "(anything) messages in", 256); break;
469473
case 2:
470474
if (index < 1)
471475
{
472-
strncpy_zero(s, "(anything) message results", 512);
476+
strncpy_zero(s, "(anything) message results", 256);
473477
break;
474478
}
475479
else
476480
{
477-
strncpy_zero(s, "(anything) dumpout", 512);
481+
strncpy_zero(s, "(anything) dumpout", 256);
478482
break;
479483
}
480484
}
@@ -485,7 +489,7 @@ struct NonRealTime
485489
{
486490
case 1:
487491
{
488-
if(index == 0) strncpy_zero(s, "(bang) start processing; (buffer <symbol>) set source and start processing", 512);
492+
if(index == 0) strncpy_zero(s, "(bang) start processing; (buffer <symbol>) set source and start processing", 256);
489493
else x->mInputBufferAssist[index](x,s);
490494
break;
491495
}
@@ -494,7 +498,7 @@ struct NonRealTime
494498
{
495499
x->mOutputBufferAssist[index](x,s);
496500
}
497-
else strncpy_zero(s, "(anything) dumpout", 512);
501+
else strncpy_zero(s, "(anything) dumpout", 256);
498502
}
499503
}
500504
}
@@ -1304,8 +1308,8 @@ class FluidMaxWrapper
13041308
static constexpr index N = decltype(idx)::value;
13051309
mInputBufferAssist.push_back([](FluidMaxWrapper *x, char* s)
13061310
{
1307-
static const std::string param_name = lowerCase(x->params().template descriptorAt<N>().name);
1308-
sprintf(s,"(buffer <symbol>): set %s buffer", param_name.c_str());
1311+
static const std::string param_name = lowerCase(x->params().template descriptorAt<N>().name);
1312+
snprintf(s, 256, "(buffer <symbol>): set %s buffer", param_name.c_str());
13091313
});
13101314
});
13111315

@@ -1316,7 +1320,7 @@ class FluidMaxWrapper
13161320
mOutputBufferAssist.push_back([](FluidMaxWrapper *x, char* s)
13171321
{
13181322
static const std::string param_name = lowerCase(x->params().template descriptorAt<N>().name);
1319-
sprintf(s,"buffer: %s", param_name.c_str());
1323+
snprintf(s, 256, "buffer: %s", param_name.c_str());
13201324
});
13211325
});
13221326

@@ -1641,7 +1645,7 @@ class FluidMaxWrapper
16411645
{
16421646
switch (io)
16431647
{
1644-
case 1: strncpy_zero(s, "(anything) messages in", 512); break;
1648+
case 1: strncpy_zero(s, "(anything) messages in", 256); break;
16451649
case 2:
16461650
if (index < 2)
16471651
{
@@ -1650,16 +1654,16 @@ class FluidMaxWrapper
16501654
using ClientClass = typename ClientType::Client;
16511655
if (index == 0 && isModel && isAudioOut<ClientClass>)
16521656
{
1653-
strncpy_zero(s, "(signal) audio out", 512);
1657+
strncpy_zero(s, "(signal) audio out", 256);
16541658
break;
16551659
}
16561660

1657-
strncpy_zero(s, "(unused)", 512);
1661+
strncpy_zero(s, "(unused)", 256);
16581662
break;
16591663
}
16601664
else
16611665
{
1662-
strncpy_zero(s, "(list) message results / dumpout", 512);
1666+
strncpy_zero(s, "(list) message results / dumpout", 256);
16631667
break;
16641668
}
16651669
}
@@ -2589,3 +2593,5 @@ void makeMaxWrapper(const char* classname)
25892593

25902594
} // namespace client
25912595
} // namespace fluid
2596+
2597+
#pragma clang diagnostic pop

0 commit comments

Comments
 (0)