Skip to content

Commit

Permalink
Fix more compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyschoen committed Feb 13, 2025
1 parent 21de5f9 commit 4cd9bd4
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Source/CanvasViewport.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class Minimap : public Component
}

auto showMinimap = SettingsFile::getInstance()->getProperty<int>("show_minimap");
float fadedIn;
float fadedOut;
float fadedIn = 0.0f;
float fadedOut = 0.0f;
if (showMinimap == 1) {
fadedIn = 0.0f;
fadedOut = 0.0f;
Expand Down
6 changes: 3 additions & 3 deletions Source/Components/MarkupDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class Block : public Component {
int const tidx = line.indexOf("<");
Colour nextColour = currentColour;
String nextLink;
if (bidx > -1 && bidx < iidx | iidx == -1 && bidx < tidx | tidx == -1) {
if ((bidx > -1 && bidx < iidx) || (iidx == -1 && bidx < tidx) || tidx == -1) {
// if the next token is toggling the bold state...
// ...first add everything up to the token...
auto linkText = line.substring(0, bidx);
Expand All @@ -283,7 +283,7 @@ class Block : public Component {
line = line.substring(bidx + 1); // ...then drop up to and including the token...
bold = !bold; // ...toggle the bold status...
needsNewFont = true; // ...and request new font.
} else if (iidx > -1 && iidx < tidx | tidx == -1) {
} else if ((iidx > -1 && iidx < tidx) || tidx == -1) {
// if the next token is toggling the italic state...
// ...first add everything up to the token...
auto linkText = line.substring(0, iidx);
Expand Down Expand Up @@ -1108,7 +1108,7 @@ class MarkupDisplayComponent final : public Component {
String line = lines[li];
if (line.contains("```")) {
StringArray clines;
if (auto const multiLine = line.lastIndexOf("```") == line.indexOf("```")) {
if (line.lastIndexOf("```") == line.indexOf("```")) {
do {
clines.add(lines[li].replace("```", ""));
} while (++li < lines.size() && !lines[li].contains("```"));
Expand Down
2 changes: 1 addition & 1 deletion Source/Heavy/DaisyExporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ class DaisyExporter final : public ExporterBase {

Toolchain runTest;
auto output = runTest.startShellScriptWithOutput(testBootloaderScript);
if (bool bootloaderNotFound = output.contains("alt=1")) {
if (output.contains("alt=1")) {
exportingView->logToConsole("Bootloader not found...\n");
bootloaderExitCode = flashBootloader(bin, sourceDir, make, gccPath);
} else {
Expand Down
2 changes: 1 addition & 1 deletion Source/Iolet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void Iolet::createConnection()
bool const sameDirection = isInlet == c->getIolet()->isInlet;

// Create new connection if allowed
if (bool const connectionAllowed = c->getIolet() != this && c->getIolet()->object != object && !sameDirection) {
if (c->getIolet() != this && c->getIolet()->object != object && !sameDirection) {

auto const outlet = isInlet ? c->getIolet() : this;
auto const inlet = isInlet ? this : c->getIolet();
Expand Down
8 changes: 4 additions & 4 deletions Source/Objects/DropzoneObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class DropzoneObject final : public ObjectBase, public FileDragAndDropTarget, pu
auto bounds = getPdBounds();
auto* patch = cnv->patch.getRawPointer();
char cnvName[32];
snprintf(cnvName, 32, ".x%lx", glist_getcanvas(patch));
snprintf(cnvName, 32, ".x%lx", reinterpret_cast<unsigned long>(glist_getcanvas(patch)));
if (auto gobj = ptr.get<t_gobj>()) {
pd->sendMessage("__else_dnd_rcv", "_drag_over", { pd->generateSymbol(cnvName), x + bounds.getX(), y + bounds.getY() });
}
Expand All @@ -155,7 +155,7 @@ class DropzoneObject final : public ObjectBase, public FileDragAndDropTarget, pu
{
auto* patch = cnv->patch.getRawPointer();
char cnvName[32];
snprintf(cnvName, 32, ".x%lx", (uint64_t)glist_getcanvas(patch));
snprintf(cnvName, 32, ".x%lx", reinterpret_cast<unsigned long>(glist_getcanvas(patch)));
if (auto gobj = ptr.get<t_gobj>()) {
pd->sendMessage("__else_dnd_rcv", "_drag_drop", { pd->generateSymbol(cnvName), 0.0f, pd->generateSymbol(file.replace("\\", "/")) });
}
Expand All @@ -177,7 +177,7 @@ class DropzoneObject final : public ObjectBase, public FileDragAndDropTarget, pu
auto bounds = getPdBounds();
auto* patch = cnv->patch.getRawPointer();
char cnvName[32];
snprintf(cnvName, 32, ".x%lx", (uint64_t)glist_getcanvas(patch));
snprintf(cnvName, 32, ".x%lx", reinterpret_cast<unsigned long>(glist_getcanvas(patch)));
if (auto gobj = ptr.get<t_gobj>()) {
pd->sendMessage("__else_dnd_rcv", "_drag_over", { pd->generateSymbol(cnvName), x + bounds.getX(), y + bounds.getY() });
}
Expand All @@ -194,7 +194,7 @@ class DropzoneObject final : public ObjectBase, public FileDragAndDropTarget, pu
void textDropped (const String& text, int x, int y) override {
auto* patch = cnv->patch.getRawPointer();
char cnvName[32];
snprintf(cnvName, 32, ".x%lx", (uint64_t)glist_getcanvas(patch));
snprintf(cnvName, 32, ".x%lx", reinterpret_cast<unsigned long>(glist_getcanvas(patch)));
if (auto gobj = ptr.get<t_gobj>()) {
pd->sendMessage("__else_dnd_rcv", "_drag_drop", { pd->generateSymbol(cnvName), 1.0f, pd->generateSymbol(text) });
}
Expand Down
4 changes: 1 addition & 3 deletions Source/Pd/Instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ void Instance::initialisePd(String& pdlua_version)
pluginLatencyReceiver = pd::Setup::createReceiver(this, "latency_compensation", reinterpret_cast<t_plugdata_banghook>(internal::instance_multi_bang), reinterpret_cast<t_plugdata_floathook>(internal::instance_multi_float), reinterpret_cast<t_plugdata_symbolhook>(internal::instance_multi_symbol),
reinterpret_cast<t_plugdata_listhook>(internal::instance_multi_list), reinterpret_cast<t_plugdata_messagehook>(internal::instance_multi_message));

// JYG added This
dataBufferReceiver = pd::Setup::createReceiver(this, "to_daw_databuffer", reinterpret_cast<t_plugdata_banghook>(internal::instance_multi_bang), reinterpret_cast<t_plugdata_floathook>(internal::instance_multi_float), reinterpret_cast<t_plugdata_symbolhook>(internal::instance_multi_symbol),
reinterpret_cast<t_plugdata_listhook>(internal::instance_multi_list), reinterpret_cast<t_plugdata_messagehook>(internal::instance_multi_message));

Expand Down Expand Up @@ -865,7 +864,7 @@ void Instance::handleAsyncUpdate()
Message mess;
while (guiMessageQueue.try_dequeue(mess)) {

switch (auto const dest = hash(mess.destination)) {
switch (hash(mess.destination)) {
case hash("pd"):
receiveSysMessage(mess.selector, mess.list);
break;
Expand Down Expand Up @@ -929,7 +928,6 @@ void Instance::handleAsyncUpdate()
performParameterChange(1, name, state);
}
break;
// JYG added this
case hash("to_daw_databuffer"):
fillDataBuffer(mess.list);
break;
Expand Down
1 change: 0 additions & 1 deletion Source/Pd/Instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ class Instance : public AsyncUpdater {

virtual void performLatencyCompensationChange(float value) = 0;

// JYG added this
virtual void fillDataBuffer(SmallArray<pd::Atom> const& list) = 0;
virtual void parseDataBuffer(XmlElement const& xml) = 0;

Expand Down

0 comments on commit 4cd9bd4

Please sign in to comment.