Skip to content

Commit

Permalink
Merge pull request #3 from RareBreeds/SquinkyWarningFixes
Browse files Browse the repository at this point in the history
Fix build warnings
  • Loading branch information
kockie69 authored Sep 30, 2021
2 parents d826b7f + 535c45d commit 6c9aacf
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 38 deletions.
2 changes: 1 addition & 1 deletion dsp/SimdBlocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "asserts.h"

//#include <simd/vector.hpp>
//#include <simd/Vector.hpp>
//#include <simd/functions.hpp>
#include "SqMath.h"

Expand Down
2 changes: 1 addition & 1 deletion dsp/filters/ButterworthFilterDesigner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ template class ButterworthFilterDesigner<double>;
template class ButterworthFilterDesigner<float>;

#if 1
//#include <simd/vector.hpp>
//#include <simd/Vector.hpp>
//#include <simd/functions.hpp>
#include "simd.h"

Expand Down
2 changes: 1 addition & 1 deletion dsp/generators/BasicVCO.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "SqPort.h"
#include "dsp/approx.hpp"
#include "dsp/minblep.hpp"
#include "simd/vector.hpp"
#include "simd/Vector.hpp"
#include "simd/functions.hpp"

#include "ObjectCache.h"
Expand Down
2 changes: 1 addition & 1 deletion dsp/samp/SInstrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "SqLog.h"

void SInstrument::_dump() {
const int hsize = headings.size();
//const int hsize = headings.size();
//SQINFO("Num Headings = %d", hsize);
for (auto h : headings) {
//SQINFO("--h:");
Expand Down
6 changes: 3 additions & 3 deletions midi/controller/MidiTrackPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ void MidiTrackPlayer::reset(bool resetGates, bool resetSectionIndex) {
MidiTrackPlayer::MidiTrackPlayer(
std::shared_ptr<IMidiPlayerHost4> host,
int trackIndex,
std::shared_ptr<MidiSong4> _song) : constTrackIndex(trackIndex),
std::shared_ptr<MidiSong4> _song) : host(host),
constTrackIndex(trackIndex),
voiceAssigner(voices, 16),
cv0Trigger(false),
cv1Trigger(false),
host(host) {
cv1Trigger(false) {
setSong(_song, trackIndex);
for (int i = 0; i < 16; ++i) {
MidiVoice& vx = voices[i];
Expand Down
7 changes: 2 additions & 5 deletions sqsrc/clock/TriggerSequencer.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@ class TriggerSequencer {

double newDelayMetric = double(newDelayPPQ) / double(StochasticNote::ppq);
nextEventTimeMetric = newDelayMetric;
if (nextEventTimeMetric > 0) {
//if (nextEventTimeMetric > 0) {
//SQINFO("data not at zero, %f", nextEventTimeMetric);
}
} else {
nextEventTimeMetric;
//}
}
}

Expand Down Expand Up @@ -140,7 +138,6 @@ class TriggerSequencer {

inline void TriggerSequencer::playOnce(double metricTime, float quantizeInterval) {
//SQINFO("TSeq::play once, metric %f", metricTime);
bool didClock = false;

// const double delayMetricQuantized = TimeUtils::quantize(delayMetric, quantizeInterval, true);
const double eventTimeMetricQuantized = TimeUtils::quantize(nextEventTimeMetric, quantizeInterval, true);
Expand Down
2 changes: 1 addition & 1 deletion sqsrc/grammar/StochasticProductionRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ bool StochasticProductionRule::isGrammarValid(const StochasticGrammar& grammar)
}

if (rulesHit.size() != grammar.size()) {
const int gsize = int(grammar.size());
//const int gsize = int(grammar.size());
//SQINFO("didn't hit all rules g=%d found%d", gsize, int(rulesHit.size()));
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions sqsrc/grammar/StochasticProductionRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ StochasticProductionRuleEntry::duration() const {
inline void
StochasticProductionRuleEntry::_dump() const {
//SQINFO("Entry p=%f notes:", probability);
for (auto note : rhsProducedNotes) {
//for (auto note : rhsProducedNotes) {
//SQINFO(" note %d", note.duration);
}
//}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/C2Json.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ inline void C2Json::jsonToParamsOrig(json_t* rootJ, CompressorParamHolder* param
(json_array_size(makeupsJ) < 16) ||
(json_array_size(enabledsJ) < 16) ||
(json_array_size(ratiosJ) < 16)) {
WARN("orig parameter json malformed2 %d", json_array_size(attacksJ));
WARN("orig parameter json malformed2 %lu", (unsigned long)json_array_size(attacksJ));
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ctrl/SqHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SqHelper {
*/
static std::shared_ptr<::rack::Svg> loadSvg(const char* path, bool pathIsAbsolute = false) {
if (pathIsAbsolute) {
APP->window->loadSvg(path);
return APP->window->loadSvg(path);
} else {
return APP->window->loadSvg(
SqHelper::assetPlugin(pluginInstance, path));
Expand Down
4 changes: 2 additions & 2 deletions src/grammar/GMRSerialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ StochasticGrammarPtr GMRSerialization::readGrammarFile(const std::string& path)
s.add(" ");
s.add(error.text);
// fclose(file);
WARN(s.str().c_str());
WARN("%s", s.str().c_str());

return nullptr;
}
Expand Down Expand Up @@ -190,4 +190,4 @@ StochasticGrammarPtr GMRSerialization::readGrammar(json_t* theJson) {
//SQWARN("could not load grammer");
return nullptr;
}
}
}
5 changes: 2 additions & 3 deletions src/grammar/GrammarRulePanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#include "StochasticGrammar2.h"
#include "StochasticProductionRule.h"

GrammarRulePanel::GrammarRulePanel(const Vec &pos, const Vec &size, StochasticGrammarPtr g, Module *m) : grammar(g),
module(m) {
GrammarRulePanel::GrammarRulePanel(const Vec &pos, const Vec &size, StochasticGrammarPtr g, Module *m) : grammar(g) {
this->box.pos = pos;
this->box.size = size;

Expand Down Expand Up @@ -60,4 +59,4 @@ void GrammarRulePanel::draw(const DrawArgs &args) {
str.add(ruleDuration);
SqGfx::drawText2(vg, 5, 15, str.str().c_str(), 12, SqHelper::COLOR_WHITE);
OpaqueWidget::draw(args);
}
}
1 change: 0 additions & 1 deletion src/grammar/GrammarRulePanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ class GrammarRulePanel : public OpaqueWidget {

private:
StochasticGrammarPtr grammar;
Module *module;
int ruleDuration = 0;
};
5 changes: 2 additions & 3 deletions src/grammar/RuleRowEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@ class RuleRowEditor : public ModuleWidget {
StochasticProductionRuleEntryPtr entry;
std::string ruleText;

int ct = 0;
// void dump(const char* title) const;
};
// void dump(const char* title) const;
};
14 changes: 7 additions & 7 deletions src/kbd/KeyMapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ KeyMapping::KeyMapping(const std::string& configPath)
s.add(" ");
s.add(error.text);
fclose(file);
INFO(s.str().c_str());
INFO("%s", s.str().c_str());
return;
}
JSONcloser cl(mappingJson, file);
Expand All @@ -89,14 +89,14 @@ KeyMapping::KeyMapping(const std::string& configPath)
s.add("Bad binding entry (");
s.add(json_dumps(value, 0));
s.add(")");
INFO(s.str().c_str());
INFO("%s", s.str().c_str());
return;
}
if (theMap.find(*key) != theMap.end()) {
SqStream s;
s.add("duplicate key mapping: ");
s.add(json_dumps(value, 0));
INFO(s.str().c_str());
INFO("%s", s.str().c_str());
return;
}
theMap[*key] = act;
Expand Down Expand Up @@ -128,7 +128,7 @@ KeyMapping::KeyMapping(const std::string& configPath)
SqStream s;
s.add("bad key in ignore_case: ");
s.add(json_dumps(value, 0));
INFO(s.str().c_str());
INFO("%s", s.str().c_str());
return;
}
std::string key = json_string_value(value);
Expand All @@ -147,7 +147,7 @@ KeyMapping::KeyMapping(const std::string& configPath)
SqStream s;
s.add("use_defaults is not true or false, is");
s.add(json_dumps(useDefaultsJ, 0));
INFO(s.str().c_str());
INFO("%s", s.str().c_str());
return;
}
_useDefaults = json_is_true(useDefaultsJ);
Expand All @@ -160,7 +160,7 @@ KeyMapping::KeyMapping(const std::string& configPath)
SqStream s;
s.add("grab_keys is not true or false, is");
s.add(json_dumps(grabKeysJ, 0));
INFO(s.str().c_str());
INFO("%s", s.str().c_str());
return;
}
_grabKeys = json_is_true(grabKeysJ);
Expand Down Expand Up @@ -210,4 +210,4 @@ Actions::action KeyMapping::get(const SqKey& key)
} else {
return it->second;
}
}
}
2 changes: 1 addition & 1 deletion src/seq/ClockFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ void ClockFinder::go(ModuleWidget* host, int div, int clockInput, int runInput,
assert(inputs.size() == 3);

if (outputs.size() != 3 || inputs.size() != 3) {
WARN("bad I/O matchup. o=%d, i=%d", outputs.size(), inputs.size());
WARN("bad I/O matchup. o=%lu, i=%lu", (unsigned long)outputs.size(), (unsigned long)inputs.size());
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/seq/NoteDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ bool NoteDisplay::handleKey(int key, int mods, int action) {
handled = MidiKeyboardHandler::handle(sequencer, key, mods);
#endif
if (handled) {
APP->event->setSelected(this);
APP->event->setSelectedWidget(this);
}
}
return handled;
Expand Down
2 changes: 1 addition & 1 deletion src/seq/S4ButtonGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void S4ButtonGrid::init(Sequencer4Widget* parent, rack::engine::Module* module,
const float y = grid_y + row * (buttonSize + buttonMargin);
for (int col = 0; col < MidiSong4::numSectionsPerTrack; ++col) {
const float x = grid_x + col * (buttonSize + buttonMargin);
const int padNumber = row * MidiSong4::numSectionsPerTrack + col;
//const int padNumber = row * MidiSong4::numSectionsPerTrack + col;


S4Button* button = new S4Button(
Expand Down
4 changes: 2 additions & 2 deletions test/simd_testBiquad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "BiquadState.h"
#include "IIRDecimator.h"

#include <simd/vector.hpp>
#include <simd/Vector.hpp>
#include <simd/functions.hpp>

using float_4 = rack::simd::float_4;
Expand Down Expand Up @@ -291,4 +291,4 @@ void simd_testBiquad()
testBasicFilter3<float>();
#endif

}
}

0 comments on commit 6c9aacf

Please sign in to comment.