Skip to content

Commit

Permalink
- fix warnings when compiling DLL on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Hart committed Jan 9, 2024
1 parent fe016bb commit 7424b75
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 15 deletions.
9 changes: 9 additions & 0 deletions hi_backend/snex_workbench/WorkbenchProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1633,6 +1633,11 @@ void DspNetworkCompileExporter::createMainCppFile(bool isDllMainFile)
b.addComment("Now we can add the rest of the codebase", snex::cppgen::Base::CommentType::FillTo80);
Include(b, "JuceHeader.h");

b.addEmptyLine();

b << "#pragma clang diagnostic push";
b << "#pragma clang diagnostic ignored \"-Wreturn-type-c-linkage\"";

b.addEmptyLine();

{
Expand Down Expand Up @@ -1835,6 +1840,10 @@ void DspNetworkCompileExporter::createMainCppFile(bool isDllMainFile)
}
}

b.addEmptyLine();
b << "#pragma clang diagnostic pop";
b.addEmptyLine();

f.replaceWithText(b.toString());

auto rnboSibling = f.getSiblingFile("RNBO.cpp");
Expand Down
2 changes: 2 additions & 0 deletions hi_dsp_library/node_api/helpers/ParameterData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ juce::Array<juce::Identifier> RangeHelpers::getRangeIds(bool includeValue, IdSet
case IdSet::ScriptComponents: rangeIds = { Identifier("min"), Identifier("max"), Identifier("stepSize"), Identifier("middlePosition") }; break;
case IdSet::MidiAutomation: rangeIds = { Identifier("Start"), Identifier("End"), Identifier("Interval"), Identifier("Skew") }; break;
case IdSet::MidiAutomationFull: rangeIds = { Identifier("FullStart"), Identifier("FullEnd"), Identifier("Interval"), Identifier("Skew") }; break;
case IdSet::numIdSets:
default: break;
}

if (includeValue)
Expand Down
4 changes: 4 additions & 0 deletions hi_dsp_library/node_api/nodes/processors.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ struct dynamic
case Types::Cubic: c.process(ratio, inp, out, numOut, numIn, false); break;
case Types::Linear: l.process(ratio, inp, out, numOut, numIn, false); break;
case Types::None: n.process(ratio, inp, out, numOut, numIn, false); break;
case Types::numTypes:
default: break;
}
}

Expand All @@ -81,6 +83,8 @@ struct dynamic
case Types::Cubic: c.reset(); break;
case Types::Linear: l.reset(); break;
case Types::None: n.reset(); break;
case Types::numTypes:
default: break;
}
}

Expand Down
4 changes: 2 additions & 2 deletions hi_tools/hi_dispatch/02_events/RootObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ RootObject::Child(r)

Queueable::~Queueable()
{
int index = 0;

#if ENABLE_QUEUE_AND_LOGGER
int index = 0;

if(auto l = getRootObject().getLogger())
l->log(l, EventType::Remove, (uint8*)&index, sizeof(int));
#endif
Expand Down
3 changes: 3 additions & 0 deletions hi_tools/hi_dispatch/02_events/SourceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ class SourceManager : public Suspendable,
{
auto& v = used ? messageCounter : skippedCounter;
auto b = used ? messageCounterId.get() : skippedCounterId.get();

ignoreUnused(v, b);

TRACE_COUNTER("dispatch", perfetto::CounterTrack(b), ++v);
}

Expand Down
6 changes: 5 additions & 1 deletion hi_tools/hi_dispatch/03_library/Processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void ProcessorHandler::BypassListener::slotChanged(const ListenerData& d)
jassert(f);

auto slotType = (SlotTypes)d.slotIndex;
ignoreUnused(slotType);
jassert(slotType == SlotTypes::Bypassed);
TRACE_DISPATCH("onBypass");

Expand All @@ -62,7 +63,9 @@ ProcessorHandler::AttributeListener::AttributeListener(RootObject& r, ListenerOw
f(f_)
{}

#ifndef TRACE_DISPATCH_CALLBACK
#define TRACE_DISPATCH_CALLBACK(obj, callbackName, arg) StringBuilder n; n << (obj).getDispatchId() << "." << callbackName << "(" << (int)arg << ")"; TRACE_DISPATCH(DYNAMIC_STRING_BUILDER(n));
#endif

void ProcessorHandler::AttributeListener::slotChanged(const ListenerData& d)
{
Expand Down Expand Up @@ -102,6 +105,7 @@ void ProcessorHandler::NameAndColourListener::slotChanged(const ListenerData& d)
{
jassert(d.s != nullptr);
auto slotType = (SlotTypes)d.slotIndex;
ignoreUnused(slotType);
jassert(slotType == SlotTypes::NameAndColour);
jassert(f);

Expand Down Expand Up @@ -347,4 +351,4 @@ Modulator::~Modulator()
}
} // library
} // dispatch
} // hise
} // hise
7 changes: 7 additions & 0 deletions hi_tools/hi_neural/RTNeural/modules/xsimd/arch/xsimd_sse2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,10 @@ namespace xsimd
}
}


#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshorten-64-to-32"

// mask
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
inline uint64_t mask(batch_bool<T, A> const& self, requires_arch<sse2>) noexcept
Expand Down Expand Up @@ -1047,6 +1051,9 @@ namespace xsimd
return {};
}
}

#pragma clang diagnostic pop

template <class A>
inline uint64_t mask(batch_bool<float, A> const& self, requires_arch<sse2>) noexcept
{
Expand Down
13 changes: 1 addition & 12 deletions hi_tools/hi_tools/MiscToolClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2381,12 +2381,6 @@ void Spectrum2D::draw(Graphics& g, const Image& img, Rectangle<int> area, Graphi
g.saveState();
g.setImageResamplingQuality(quality);

float offsetX = JUCE_LIVE_CONSTANT_OFF(0.0);
float offsetY = JUCE_LIVE_CONSTANT_OFF(0.0);

float scaleX = JUCE_LIVE_CONSTANT_OFF(0.0);
float scaleY = JUCE_LIVE_CONSTANT_OFF(0.0);

auto t = AffineTransform::translation(-img.getWidth() / 2, -img.getHeight() / 2);

t = t.followedBy(AffineTransform::rotation(float_Pi * 1.5f));
Expand Down Expand Up @@ -2493,14 +2487,11 @@ Image Spectrum2D::createSpectrumImage(AudioSampleBuffer& lastBuffer)

auto newImage = Image(Image::RGB, lastBuffer.getNumSamples(), lastBuffer.getNumChannels(), true);

auto s2dHalf = parameters->Spectrum2DSize / 2;

Image::BitmapData bd(newImage, Image::BitmapData::writeOnly);

for(int y = 0; y < lastBuffer.getNumChannels(); y++)
{
auto src = lastBuffer.getReadPointer(y);
auto dst = bd.getLinePointer(y);

for(int x = 0; x < lastBuffer.getNumSamples(); x++)
{
Expand Down Expand Up @@ -2548,8 +2539,6 @@ AudioSampleBuffer Spectrum2D::createSpectrumBuffer()
if (numSamplesToFill == 0)
return {};

auto paddingSize = JUCE_LIVE_CONSTANT_OFF(0);

AudioSampleBuffer b(numSamplesToFill, parameters->Spectrum2DSize / 2);
b.clear();

Expand All @@ -2572,7 +2561,7 @@ AudioSampleBuffer Spectrum2D::createSpectrumBuffer()
for(int i = 0; i < size; i++)
{
auto normIndex = (float)i / (float)size;
auto skewedProportionY = holder->getYPosition((float)i / (float)size);
auto skewedProportionY = holder->getYPosition(normIndex);
positions[i] = skewedProportionY;
}

Expand Down

0 comments on commit 7424b75

Please sign in to comment.