Add wextra level warnings.

This commit is contained in:
James Grogan 2023-01-23 11:55:58 +00:00
parent e559f9674d
commit 119ea6f2cc
62 changed files with 235 additions and 231 deletions

View file

@ -20,7 +20,7 @@ if(MSVC)
else() else()
#set(GCC_COVERAGE_COMPILE_FLAGS "-fprofile-arcs -ftest-coverage") #set(GCC_COVERAGE_COMPILE_FLAGS "-fprofile-arcs -ftest-coverage")
#set(GCC_COVERAGE_LINK_FLAGS "-lgcov") #set(GCC_COVERAGE_LINK_FLAGS "-lgcov")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}")
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}") #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}")
endif() endif()

View file

@ -11,14 +11,14 @@ CanvasCommandSelectorView::CanvasCommandSelectorView()
{ {
auto circle_button = Button::Create(); auto circle_button = Button::Create();
auto on_circle_click = [this](Widget* self){ auto on_circle_click = [this](Widget*){
onCommandSelected(CanvasDrawCommand::CIRCLE); onCommandSelected(CanvasDrawCommand::CIRCLE);
}; };
circle_button->setLabel("Circle"); circle_button->setLabel("Circle");
circle_button->setMargin(2); circle_button->setMargin(2);
circle_button->setOnClickFunction(on_circle_click); circle_button->setOnClickFunction(on_circle_click);
auto on_line_click = [this](Widget* self){ auto on_line_click = [this](Widget*){
onCommandSelected(CanvasDrawCommand::LINE); onCommandSelected(CanvasDrawCommand::LINE);
}; };
auto line_button = Button::Create(); auto line_button = Button::Create();

View file

@ -31,7 +31,7 @@ bool CanvasDrawingArea::isDirty() const
return Widget::isDirty() || mContentDirty; return Widget::isDirty() || mContentDirty;
} }
void CanvasDrawingArea::doPaint(const PaintEvent* event) void CanvasDrawingArea::doPaint(const PaintEvent*)
{ {
mContentDirty = false; mContentDirty = false;
} }

View file

@ -35,7 +35,7 @@ void TextEditorView::initialize()
saveButton->setLabel("Save"); saveButton->setLabel("Save");
saveButton->setBackground(Theme::Sys::Color::Primary); saveButton->setBackground(Theme::Sys::Color::Primary);
saveButton->setMargin(2); saveButton->setMargin(2);
auto onSave = [this](Widget* self){ auto onSave = [this](Widget*){
if(mController && mTextBox) if(mController && mTextBox)
{ {
mController->SetContent(mTextBox->getContent()); mController->SetContent(mTextBox->getContent());
@ -47,7 +47,7 @@ void TextEditorView::initialize()
auto clearButton = Button::Create(); auto clearButton = Button::Create();
clearButton->setLabel("Clear"); clearButton->setLabel("Clear");
clearButton->setMargin(2); clearButton->setMargin(2);
auto onClear = [this](Widget* self){ auto onClear = [this](Widget*){
if(mController && mTextBox) if(mController && mTextBox)
{ {
mController->OnClear(); mController->OnClear();
@ -59,7 +59,7 @@ void TextEditorView::initialize()
auto loadButton = Button::Create(); auto loadButton = Button::Create();
loadButton->setLabel("Load"); loadButton->setLabel("Load");
loadButton->setMargin(2); loadButton->setMargin(2);
auto onLoad = [this](Widget* self){ auto onLoad = [this](Widget*){
if(mController && mTextBox) if(mController && mTextBox)
{ {
mController->OnLoad(); mController->OnLoad();

View file

@ -4,8 +4,8 @@ const TruthTable::TableData TruthTable::AND_TRUTH_TABLE = { {{0, 0}, {0}} };
TruthTable TruthTable::getAndTruthTable() TruthTable TruthTable::getAndTruthTable()
{ {
TruthTable table(2, 1); TruthTable table(2, 1);
table.setTable(AND_TRUTH_TABLE); table.setTable(AND_TRUTH_TABLE);
return table; return table;
} }

View file

@ -8,7 +8,7 @@ class TruthTable
public: public:
using TableData = std::map<std::vector<bool>, std::vector<bool> >; using TableData = std::map<std::vector<bool>, std::vector<bool> >;
TruthTable(std::size_t numInputColumns, std::size_t numOutputColumns) TruthTable(std::size_t, std::size_t)
//: mNumInputColumns(numInputColumns), //: mNumInputColumns(numInputColumns),
// mNumOutputColumns(numOutputColumns) // mNumOutputColumns(numOutputColumns)
{ {

View file

@ -21,7 +21,7 @@ void ElectronicCircuitNode::setContent(ElectronicCircuit* content)
mContentDirty = true; mContentDirty = true;
} }
void ElectronicCircuitNode::createOrUpdateGeometry(SceneInfo* sceneInfo) void ElectronicCircuitNode::createOrUpdateGeometry(SceneInfo*)
{ {
mInputTerminalNodes.clear(); mInputTerminalNodes.clear();
mWireNodes.clear(); mWireNodes.clear();

View file

@ -33,7 +33,7 @@ void LogicGateNode::update(SceneInfo* sceneInfo)
} }
} }
void LogicGateNode::createOrUpdateGeometry(SceneInfo* sceneInfo) void LogicGateNode::createOrUpdateGeometry(SceneInfo*)
{ {
if (!mPrimaryPath) if (!mPrimaryPath)
{ {

View file

@ -13,7 +13,7 @@ void TerminalNode::setContent(Terminal* terminal)
mContent = terminal; mContent = terminal;
} }
void TerminalNode::createOrUpdateGeometry(SceneInfo* sceneInfo) void TerminalNode::createOrUpdateGeometry(SceneInfo*)
{ {
if (!mMarker) if (!mMarker)
{ {
@ -32,4 +32,4 @@ void TerminalNode::update(SceneInfo* sceneInfo)
createOrUpdateGeometry(sceneInfo); createOrUpdateGeometry(sceneInfo);
mContentDirty = false; mContentDirty = false;
} }
} }

View file

@ -129,7 +129,7 @@ int MidiMetaEventAdapter::ReadChannelPrefixEvent(std::ifstream* file, MetaMidiEv
return byteCount; return byteCount;
} }
int MidiMetaEventAdapter::ReadTimeSignatureEvent(std::ifstream* file, MetaMidiEvent* event) int MidiMetaEventAdapter::ReadTimeSignatureEvent(std::ifstream* file, MetaMidiEvent*)
{ {
unsigned byteCount = 0; unsigned byteCount = 0;
int length = *BinaryStream::getNextByteAsInt(file); int length = *BinaryStream::getNextByteAsInt(file);
@ -154,7 +154,7 @@ int MidiMetaEventAdapter::ReadTimeSignatureEvent(std::ifstream* file, MetaMidiEv
return byteCount; return byteCount;
} }
int MidiMetaEventAdapter::ReadKeySignatureEvent(std::ifstream* file, MetaMidiEvent* event) int MidiMetaEventAdapter::ReadKeySignatureEvent(std::ifstream* file, MetaMidiEvent*)
{ {
unsigned byteCount = 0; unsigned byteCount = 0;
int length = *BinaryStream::getNextByteAsInt(file); int length = *BinaryStream::getNextByteAsInt(file);
@ -168,7 +168,7 @@ int MidiMetaEventAdapter::ReadKeySignatureEvent(std::ifstream* file, MetaMidiEve
return byteCount; return byteCount;
} }
int MidiMetaEventAdapter::ReadTimeCodeEvent(std::ifstream* file, MetaMidiEvent* event) int MidiMetaEventAdapter::ReadTimeCodeEvent(std::ifstream* file, MetaMidiEvent*)
{ {
unsigned byteCount = 0; unsigned byteCount = 0;
int length = *BinaryStream::getNextByteAsInt(file); int length = *BinaryStream::getNextByteAsInt(file);

View file

@ -4,52 +4,52 @@
#include "LineNode.h" #include "LineNode.h"
BlochSphereNode::BlochSphereNode(const Point& location) BlochSphereNode::BlochSphereNode(const Point& location)
: AbstractVisualNode(location, "BlochSphereNode") : AbstractVisualNode(location, "BlochSphereNode")
{ {
} }
void BlochSphereNode::setContent(BlochSphere* content) void BlochSphereNode::setContent(BlochSphere* content)
{ {
mContent = content; mContent = content;
mContentDirty = true; mContentDirty = true;
} }
void BlochSphereNode::setSize(double size) void BlochSphereNode::setSize(double size)
{ {
if (size != mSize) if (size != mSize)
{ {
mSize = size; mSize = size;
mContentDirty = true; mContentDirty = true;
} }
} }
void BlochSphereNode::update(SceneInfo* sceneInfo) void BlochSphereNode::update(SceneInfo*)
{ {
if (!mContentDirty) if (!mContentDirty)
{ {
return; return;
} }
mChildren.clear(); mChildren.clear();
auto loc = Point(mSize / 2.0, mSize / 2.0); auto loc = Point(mSize / 2.0, mSize / 2.0);
mInnerCircle = std::make_unique<CircleNode>(loc, mSize / 2.0); mInnerCircle = std::make_unique<CircleNode>(loc, mSize / 2.0);
mInnerCircle->setMinorRadius(mSize / 4.0); mInnerCircle->setMinorRadius(mSize / 4.0);
mInnerCircle->setStrokeThickness(0.5); mInnerCircle->setStrokeThickness(0.5);
mOuterCircle = std::make_unique<CircleNode>(loc, mSize/2.0); mOuterCircle = std::make_unique<CircleNode>(loc, mSize/2.0);
const auto end_point_x = Point(loc.getX() + 1.2 * mSize / 2.0, loc.getY()); const auto end_point_x = Point(loc.getX() + 1.2 * mSize / 2.0, loc.getY());
const std::vector<Point> points{end_point_x }; const std::vector<Point> points{end_point_x };
mXAxis = std::make_unique<LineNode>(loc, points); mXAxis = std::make_unique<LineNode>(loc, points);
mCentreCircle = std::make_unique<CircleNode>(loc, mSize / 50.0); mCentreCircle = std::make_unique<CircleNode>(loc, mSize / 50.0);
mCentreCircle->setFillColor(Color(0, 0, 0)); mCentreCircle->setFillColor(Color(0, 0, 0));
mCentreCircle->setHasStrokeColor(false); mCentreCircle->setHasStrokeColor(false);
addChild(mInnerCircle.get()); addChild(mInnerCircle.get());
addChild(mOuterCircle.get()); addChild(mOuterCircle.get());
addChild(mXAxis.get()); addChild(mXAxis.get());
addChild(mCentreCircle.get()); addChild(mCentreCircle.get());
} }

View file

@ -113,7 +113,7 @@ const std::string& TemplateExpression::getContent() const
return mContent; return mContent;
} }
std::string TemplateExpression::render(TemplateSubstitutionContext* substitutions, TemplateNode* parentContext) std::string TemplateExpression::render(TemplateSubstitutionContext* substitutions, TemplateNode*)
{ {
if (substitutions && substitutions->hasSubstitution(mContent)) if (substitutions && substitutions->hasSubstitution(mContent))
{ {
@ -143,7 +143,7 @@ bool TemplateTextBody::hasContent() const
return !mContent.empty(); return !mContent.empty();
} }
std::string TemplateTextBody::render(TemplateSubstitutionContext* substitutions, TemplateNode* parentContext) std::string TemplateTextBody::render(TemplateSubstitutionContext*, TemplateNode*)
{ {
std::string content; std::string content;
for(unsigned idx=0; idx<mContent.size(); idx++) for(unsigned idx=0; idx<mContent.size(); idx++)

View file

@ -191,7 +191,7 @@ void TemplateFile::onFoundBlock(const std::vector<std::string> args)
mWorkingNode = temp; mWorkingNode = temp;
} }
void TemplateFile::onFoundEndBlock(const std::vector<std::string> args) void TemplateFile::onFoundEndBlock(const std::vector<std::string>)
{ {
mWorkingNode = mWorkingNode->getParent(); mWorkingNode = mWorkingNode->getParent();
} }

View file

@ -107,7 +107,7 @@ void HuffmanEncoder::setUseFixedCode(bool useFixed)
mUseFixedCode = useFixed; mUseFixedCode = useFixed;
} }
uint32_t HuffmanEncoder::getLengthValue(unsigned length) uint32_t HuffmanEncoder::getLengthValue(unsigned)
{ {
return 0; return 0;
} }

View file

@ -77,7 +77,7 @@ bool HuffmanStream::readNextDistanceSymbol(unsigned& buffer)
return true; return true;
} }
void HuffmanStream::addValue(unsigned value, unsigned& count, unsigned& lastValue, std::vector<unsigned char>& literals, unsigned numLiterals, std::vector<unsigned char>& distances) void HuffmanStream::addValue(unsigned value, unsigned& count, unsigned& lastValue, std::vector<unsigned char>& literals, unsigned, std::vector<unsigned char>& distances)
{ {
if (count < mNumLiterals) if (count < mNumLiterals)
{ {

View file

@ -29,6 +29,8 @@ void CommandLineArgs::initialize(CommandLineArgs* args)
::LocalFree(szArglist); ::LocalFree(szArglist);
args->process(windowsArgs); args->process(windowsArgs);
#else
(void)args;
#endif #endif
} }

View file

@ -36,7 +36,7 @@ std::string File::dumpBinary()
const unsigned char val = static_cast<unsigned char>(mInHandle->get()); const unsigned char val = static_cast<unsigned char>(mInHandle->get());
const unsigned char ascii_val = std::isalpha(val) ? val : '.'; const unsigned char ascii_val = std::isalpha(val) ? val : '.';
sstr << count << " | " << ByteUtils::toString(val) << " | " << static_cast<int>(val) << " | " << ascii_val << '\n'; sstr << count << " | " << ByteUtils::toString(val) << " | " << static_cast<int>(val) << " | " << ascii_val << '\n';
if (count < 0 && count % 10 == 0) if (count % 10 == 0)
{ {
sstr << "\n"; sstr << "\n";
} }

View file

@ -62,7 +62,7 @@ void FileLogger::LogLine(const std::string& logType, const std::ostringstream& l
std::time_t t = std::time(nullptr); std::time_t t = std::time(nullptr);
const std::string cleanedFileName = fileName.substr(fileName.find_last_of("/\\") + 1); const std::string cleanedFileName = fileName.substr(fileName.find_last_of("/\\") + 1);
std::tm time_buf = { 0 }; std::tm time_buf{ };
#ifdef WIN32 #ifdef WIN32
gmtime_s(&time_buf, &t); gmtime_s(&time_buf, &t);
#else #else

View file

@ -16,7 +16,7 @@ class InputBitStream : public BitStream
void writeByte(unsigned char data, bool checkOverflow = true) override; void writeByte(unsigned char data, bool checkOverflow = true) override;
void writeBytes(const std::vector<unsigned char> data) override void writeBytes(const std::vector<unsigned char>) override
{ {
} }

View file

@ -29,7 +29,7 @@ void SqliteInterface::open(Database* db)
} }
} }
static int callback(void *NotUsed, int argc, char **argv, char **azColName) static int callback(void *, int argc, char **, char **)
{ {
for(int i=0; i<argc; i++) for(int i=0; i<argc; i++)
{ {

View file

@ -64,7 +64,7 @@ const Point& Arc::getLocation() const
return mStartPoint; return mStartPoint;
} }
void Arc::sample(SparseGrid<bool>* grid) const void Arc::sample(SparseGrid<bool>*) const
{ {
} }
@ -77,4 +77,4 @@ Arc::Type Arc::getType() const
Arc::CurveType Arc::getCurveType() const Arc::CurveType Arc::getCurveType() const
{ {
return CurveType::ARC; return CurveType::ARC;
} }

View file

@ -20,7 +20,7 @@ public:
CurveType getCurveType() const override; CurveType getCurveType() const override;
void sample(SparseGrid<bool>* grid) const override; void sample(SparseGrid<bool>*) const override;
std::string toPostScriptString(std::size_t precision = 0) const override; std::string toPostScriptString(std::size_t precision = 0) const override;
@ -32,4 +32,4 @@ private:
double mRotation{ 0 }; double mRotation{ 0 };
bool mLargeArc{ false }; bool mLargeArc{ false };
bool mSweep{ false }; bool mSweep{ false };
}; };

View file

@ -49,7 +49,7 @@ const Point& CubicBezierCurve::getLocation() const
return mStartPoint; return mStartPoint;
} }
void CubicBezierCurve::sample(SparseGrid<bool>* grid) const void CubicBezierCurve::sample(SparseGrid<bool>*) const
{ {
} }
@ -62,4 +62,4 @@ CubicBezierCurve::Type CubicBezierCurve::getType() const
CubicBezierCurve::CurveType CubicBezierCurve::getCurveType() const CubicBezierCurve::CurveType CubicBezierCurve::getCurveType() const
{ {
return CurveType::CUBIC_BEZIER; return CurveType::CUBIC_BEZIER;
} }

View file

@ -20,7 +20,7 @@ public:
CurveType getCurveType() const override; CurveType getCurveType() const override;
void sample(SparseGrid<bool>* grid) const override; void sample(SparseGrid<bool>*) const override;
std::string toPostScriptString(std::size_t precision = 0) const override; std::string toPostScriptString(std::size_t precision = 0) const override;
@ -29,4 +29,4 @@ private:
Point mEndPoint; Point mEndPoint;
Point mStartControlPoint; Point mStartControlPoint;
Point mEndControlPoint; Point mEndControlPoint;
}; };

View file

@ -5,13 +5,13 @@
class Curve : public PathElement class Curve : public PathElement
{ {
public: public:
enum class CurveType enum class CurveType
{ {
ARC, ARC,
QUADRATIC_BEZIER, QUADRATIC_BEZIER,
CUBIC_BEZIER, CUBIC_BEZIER,
UNKNOWN UNKNOWN
}; };
virtual CurveType getCurveType() const = 0; virtual CurveType getCurveType() const = 0;
}; };

View file

@ -9,37 +9,37 @@
class Line : public PathElement class Line : public PathElement
{ {
public: public:
enum class InputBufferType enum class InputBufferType
{ {
HORIZONTAL_REL, HORIZONTAL_REL,
HORIZONTAL_ABS, HORIZONTAL_ABS,
VERTICAL_REL, VERTICAL_REL,
VERTICAL_ABS, VERTICAL_ABS,
XY_REL, XY_REL,
XY_ABS XY_ABS
}; };
Line(const Point& start, const PointCollection& points); Line(const Point& start, const PointCollection& points);
Line(const Point& start, InputBufferType bufferType, const std::vector<double>& buffer); Line(const Point& start, InputBufferType bufferType, const std::vector<double>& buffer);
const PointCollection& getPoints() const; const PointCollection& getPoints() const;
Line::Type getType() const override; Line::Type getType() const override;
const Point& getLocation() const override; const Point& getLocation() const override;
Bounds getBounds() const override; Bounds getBounds() const override;
Point getFirstPoint() const override; Point getFirstPoint() const override;
Point getEndPoint() const override; Point getEndPoint() const override;
void sample(SparseGrid<bool>* grid) const override {}; void sample(SparseGrid<bool>*) const override {};
std::string toPostScriptString(std::size_t precision = 0) const override; std::string toPostScriptString(std::size_t precision = 0) const override;
private: private:
Point mStartPoint; Point mStartPoint;
PointCollection mPoints; PointCollection mPoints;
}; };

View file

@ -29,7 +29,7 @@ const Point& LineSegment::getPoint1() const
return mP1; return mP1;
} }
void LineSegment::sample(SparseGrid<bool>* grid) const void LineSegment::sample(SparseGrid<bool>*) const
{ {
} }

View file

@ -31,7 +31,7 @@ public:
bool isVertical() const; bool isVertical() const;
void sample(SparseGrid<bool>* grid) const override; void sample(SparseGrid<bool>*) const override;
std::string toPostScriptString(std::size_t precision = 0) const override; std::string toPostScriptString(std::size_t precision = 0) const override;

View file

@ -43,7 +43,7 @@ GeometryPath::Type GeometryPath::getType() const
return GeometryPath::Type::PATH; return GeometryPath::Type::PATH;
} }
void GeometryPath::sample(SparseGrid<bool>* grid) const void GeometryPath::sample(SparseGrid<bool>*) const
{ {
} }
@ -52,4 +52,4 @@ std::string GeometryPath::getAsPostScript() const
{ {
PathPostScriptConverter converter; PathPostScriptConverter converter;
return converter.toPostScript(this); return converter.toPostScript(this);
} }

View file

@ -11,53 +11,53 @@ using PathElementPtr = std::unique_ptr<PathElement>;
class GeometryPathFeature class GeometryPathFeature
{ {
public: public:
void addElement(PathElementPtr element) void addElement(PathElementPtr element)
{ {
if (mElements.empty()) if (mElements.empty())
{ {
mLocation = element->getFirstPoint(); mLocation = element->getFirstPoint();
} }
mElements.push_back(std::move(element)); mElements.push_back(std::move(element));
} }
const Point& getLocation() const const Point& getLocation() const
{ {
return mLocation; return mLocation;
} }
const std::vector<PathElementPtr>& getElements() const const std::vector<PathElementPtr>& getElements() const
{ {
return mElements; return mElements;
} }
private: private:
Point mLocation; Point mLocation;
std::vector<PathElementPtr> mElements; std::vector<PathElementPtr> mElements;
}; };
using GeometryPathFeaturePtr = std::unique_ptr<GeometryPathFeature>; using GeometryPathFeaturePtr = std::unique_ptr<GeometryPathFeature>;
class GeometryPath : public AbstractGeometricItem class GeometryPath : public AbstractGeometricItem
{ {
public: public:
~GeometryPath(); ~GeometryPath();
void addFeature(GeometryPathFeaturePtr feature); void addFeature(GeometryPathFeaturePtr feature);
void buildFromPostscript(const std::string& psString); void buildFromPostscript(const std::string& psString);
std::string getAsPostScript() const; std::string getAsPostScript() const;
const Point& getLocation() const override; const Point& getLocation() const override;
Bounds getBounds() const override; Bounds getBounds() const override;
Type getType() const override; Type getType() const override;
const std::vector<GeometryPathFeaturePtr>& getFeatures() const; const std::vector<GeometryPathFeaturePtr>& getFeatures() const;
void sample(SparseGrid<bool>* grid) const override; void sample(SparseGrid<bool>*) const override;
private: private:
Point mLocation; Point mLocation;
std::vector<GeometryPathFeaturePtr> mFeatures; std::vector<GeometryPathFeaturePtr> mFeatures;
}; };

View file

@ -7,25 +7,25 @@
class PathElement : public AbstractGeometricItem class PathElement : public AbstractGeometricItem
{ {
public: public:
enum class PostscriptPositioning enum class PostscriptPositioning
{ {
RELATIVE_TO, RELATIVE_TO,
ABSOLUTE_TO ABSOLUTE_TO
}; };
~PathElement(); ~PathElement();
virtual Point getFirstPoint() const = 0; virtual Point getFirstPoint() const = 0;
virtual Point getEndPoint() const = 0; virtual Point getEndPoint() const = 0;
void setPostscriptPositioning(PostscriptPositioning positioning) void setPostscriptPositioning(PostscriptPositioning positioning)
{ {
mPostscriptPositioning = positioning; mPostscriptPositioning = positioning;
} }
virtual std::string toPostScriptString(std::size_t precision = 0) const = 0; virtual std::string toPostScriptString(std::size_t precision = 0) const = 0;
protected: protected:
PostscriptPositioning mPostscriptPositioning{ PostscriptPositioning::RELATIVE_TO}; PostscriptPositioning mPostscriptPositioning{ PostscriptPositioning::RELATIVE_TO};
}; };

View file

@ -42,7 +42,7 @@ const Point& QuadraticBezierCurve::getLocation() const
return mStartPoint; return mStartPoint;
} }
void QuadraticBezierCurve::sample(SparseGrid<bool>* grid) const void QuadraticBezierCurve::sample(SparseGrid<bool>*) const
{ {
} }
@ -55,4 +55,4 @@ QuadraticBezierCurve::Type QuadraticBezierCurve::getType() const
QuadraticBezierCurve::CurveType QuadraticBezierCurve::getCurveType() const QuadraticBezierCurve::CurveType QuadraticBezierCurve::getCurveType() const
{ {
return CurveType::QUADRATIC_BEZIER; return CurveType::QUADRATIC_BEZIER;
} }

View file

@ -6,26 +6,26 @@
class QuadraticBezierCurve : public Curve class QuadraticBezierCurve : public Curve
{ {
public: public:
QuadraticBezierCurve(const Point& startPoint, const Point& endPoint, const Point& controlPoint); QuadraticBezierCurve(const Point& startPoint, const Point& endPoint, const Point& controlPoint);
Point getFirstPoint() const override; Point getFirstPoint() const override;
Point getEndPoint() const override; Point getEndPoint() const override;
Bounds getBounds() const override; Bounds getBounds() const override;
const Point& getLocation() const override; const Point& getLocation() const override;
Type getType() const override; Type getType() const override;
CurveType getCurveType() const override; CurveType getCurveType() const override;
void sample(SparseGrid<bool>* grid) const override; void sample(SparseGrid<bool>*) const override;
std::string toPostScriptString(std::size_t precision = 0) const override; std::string toPostScriptString(std::size_t precision = 0) const override;
private: private:
Point mStartPoint; Point mStartPoint;
Point mEndPoint; Point mEndPoint;
Point mControlPoint; Point mControlPoint;
}; };

View file

@ -28,7 +28,7 @@ void Circle::setMinorRadius(double radius)
mMinorRadius = radius; mMinorRadius = radius;
} }
void Circle::sample(SparseGrid<bool>* grid) const void Circle::sample(SparseGrid<bool>*) const
{ {
} }

View file

@ -22,7 +22,7 @@ public:
void setMinorRadius(double radius); void setMinorRadius(double radius);
void sample(SparseGrid<bool>* grid) const override; void sample(SparseGrid<bool>*) const override;
private: private:
double mMinorRadius{ 0.5 }; double mMinorRadius{ 0.5 };

View file

@ -32,7 +32,7 @@ namespace ntk {
return { minX , maxX , minY , maxY }; return { minX , maxX , minY , maxY };
} }
void Rectangle::sample(SparseGrid<bool>* grid) const void Rectangle::sample(SparseGrid<bool>*) const
{ {
} }

View file

@ -23,7 +23,7 @@ public:
void setRadius(double radius); void setRadius(double radius);
void sample(SparseGrid<bool>* grid) const override; void sample(SparseGrid<bool>*) const override;
private: private:
Point mBottomLeft; Point mBottomLeft;

View file

@ -37,6 +37,8 @@ void NetworkManager::runHttpServer(AbstractWebApp* webApp)
server.initialize(); server.initialize();
server.run(); server.run();
#else #else
(void)webApp;
if (!mSocketInterface) if (!mSocketInterface)
{ {
initialize(); initialize();

View file

@ -58,7 +58,7 @@ void AlsaInterface::openDevice(AudioDevice* device)
} }
} }
void AlsaInterface::setAccessType(AudioDevice* device) void AlsaInterface::setAccessType(AudioDevice*)
{ {
if (snd_pcm_hw_params_set_access(mHandle, mHardwareParams, SND_PCM_ACCESS_RW_INTERLEAVED) < 0) if (snd_pcm_hw_params_set_access(mHandle, mHardwareParams, SND_PCM_ACCESS_RW_INTERLEAVED) < 0)
{ {
@ -67,7 +67,7 @@ void AlsaInterface::setAccessType(AudioDevice* device)
} }
} }
bool AlsaInterface::setSampleFormat(AudioDevice* device) bool AlsaInterface::setSampleFormat(AudioDevice*)
{ {
/* Set sample format */ /* Set sample format */
if (snd_pcm_hw_params_set_format(mHandle, mHardwareParams, SND_PCM_FORMAT_S16_LE) < 0) if (snd_pcm_hw_params_set_format(mHandle, mHardwareParams, SND_PCM_FORMAT_S16_LE) < 0)

View file

@ -14,7 +14,7 @@ bool ImageBitStream::isFinished() const
return mByteOffset == static_cast<int>(mImage->getGrid()->getDataSize()); return mByteOffset == static_cast<int>(mImage->getGrid()->getDataSize());
} }
std::vector<unsigned char> ImageBitStream::peekNextNBytes(unsigned n) const std::vector<unsigned char> ImageBitStream::peekNextNBytes(unsigned) const
{ {
return {}; return {};
} }
@ -32,7 +32,7 @@ std::optional<unsigned char> ImageBitStream::readNextByte()
return {}; return {};
} }
void ImageBitStream::writeByte(unsigned char data, bool checkOverflow ) void ImageBitStream::writeByte(unsigned char, bool )
{ {
mByteOffset++; mByteOffset++;

View file

@ -17,7 +17,7 @@ public:
void writeByte(unsigned char data, bool checkOverflow = true) override; void writeByte(unsigned char data, bool checkOverflow = true) override;
void writeBytes(const std::vector<unsigned char> data) override void writeBytes(const std::vector<unsigned char>) override
{ {
} }

View file

@ -34,7 +34,7 @@ IFontEngine* FontsManager::getFontEngine() const
return mFontEngine.get(); return mFontEngine.get();
} }
FontGlyph* FontsManager::getGlyph(const std::string& fontFace, float size, uint32_t c) FontGlyph* FontsManager::getGlyph(const std::string&, float size, uint32_t c)
{ {
auto path = std::filesystem::path("truetype/liberation/LiberationSans-Regular.ttf"); auto path = std::filesystem::path("truetype/liberation/LiberationSans-Regular.ttf");

View file

@ -15,7 +15,7 @@ std::unique_ptr<DrawingSurface> DrawingSurface::Create()
return std::make_unique<DrawingSurface>(); return std::make_unique<DrawingSurface>();
} }
void DrawingSurface::setSize(unsigned width, unsigned height, bool triggerResize) void DrawingSurface::setSize(unsigned width, unsigned height, bool)
{ {
mWidth = width; mWidth = width;
mHeight = height; mHeight = height;

View file

@ -1,6 +1,6 @@
#include "AbstractMesh.h" #include "AbstractMesh.h"
void AbstractMesh::addConstantNodeVectorAttribute(const std::string& tag, const std::vector<double>& values) void AbstractMesh::addConstantNodeVectorAttribute(const std::string&, const std::vector<double>&)
{ {
} }
@ -10,7 +10,7 @@ AbstractMesh::~AbstractMesh()
} }
std::vector<std::vector<double> > AbstractMesh::getNodeVectorAttributes(const std::string& tag) std::vector<std::vector<double> > AbstractMesh::getNodeVectorAttributes(const std::string&)
{ {
std::vector<std::vector<double> > attribs(mNodes.size()); std::vector<std::vector<double> > attribs(mNodes.size());
return attribs; return attribs;

View file

@ -101,7 +101,7 @@ std::unique_ptr<LineMesh> MeshPrimitives::buildCircleAsLineMesh(std::size_t numS
return MeshBuilder::buildLineMesh(locations, edge_ids); return MeshBuilder::buildLineMesh(locations, edge_ids);
} }
std::unique_ptr<TriMesh> MeshPrimitives::buildRoundedRectangleAsTriMesh(double radius, double aspect_ratio, std::size_t num_segments) std::unique_ptr<TriMesh> MeshPrimitives::buildRoundedRectangleAsTriMesh(double radius, double, std::size_t num_segments)
{ {
std::size_t num_fans = 4; std::size_t num_fans = 4;
std::size_t num_nodes_per_fan = num_segments + 2; std::size_t num_nodes_per_fan = num_segments + 2;

View file

@ -29,7 +29,7 @@ std::size_t AbstractVisualNode::getNumSceneItems() const
return mSceneItems.size(); return mSceneItems.size();
} }
void AbstractVisualNode::update(SceneInfo* sceneInfo) void AbstractVisualNode::update(SceneInfo*)
{ {
} }

View file

@ -76,7 +76,7 @@ std::size_t GridNode::getNumSceneItems() const
return 2; return 2;
} }
void GridNode::update(SceneInfo* sceneInfo) void GridNode::update(SceneInfo*)
{ {
if (!mBackgroundModel || mDataDirty) if (!mBackgroundModel || mDataDirty)
{ {

View file

@ -14,7 +14,7 @@ MeshNode::~MeshNode()
} }
SceneItem* MeshNode::getSceneItem(std::size_t idx) const SceneItem* MeshNode::getSceneItem(std::size_t) const
{ {
return mModel.get(); return mModel.get();
} }
@ -55,7 +55,7 @@ void MeshNode::setMesh(AbstractMesh* mesh)
mMeshIsDirty = true; mMeshIsDirty = true;
} }
void MeshNode::update(SceneInfo* sceneInfo) void MeshNode::update(SceneInfo*)
{ {
if (!mModel || mMeshIsDirty) if (!mModel || mMeshIsDirty)
{ {

View file

@ -86,7 +86,7 @@ void Scene::setShowMeshOutline(bool shouldShow)
mSceneInfo->mShowMeshOutline = shouldShow; mSceneInfo->mShowMeshOutline = shouldShow;
} }
void Scene::setSupportsGeometryPrimitives(bool supports) void Scene::setSupportsGeometryPrimitives(bool)
{ {
mSceneInfo->mSupportsGeometryPrimitives = true; mSceneInfo->mSupportsGeometryPrimitives = true;
} }

View file

@ -31,7 +31,7 @@ unsigned SvgNode::getContentHeight() const
return mContentHeight; return mContentHeight;
} }
void SvgNode::createOrUpdateGeometry(SceneInfo* sceneInfo) void SvgNode::createOrUpdateGeometry(SceneInfo*)
{ {
if (!mContent->getRoot()) if (!mContent->getRoot())
{ {

View file

@ -16,7 +16,7 @@ TopBar::TopBar()
fileButton->setMargin(2); fileButton->setMargin(2);
fileButton->setMaxWidth(60); fileButton->setMaxWidth(60);
auto onClick = [this](Widget* self){ auto onClick = [this](Widget*){
auto menu = std::make_unique<TopBarMenu>(); auto menu = std::make_unique<TopBarMenu>();
auto window = getTopLevelWindow(); auto window = getTopLevelWindow();
window->addPopup(std::move(menu)); window->addPopup(std::move(menu));

View file

@ -7,7 +7,7 @@
class TopBarMenu : public Widget class TopBarMenu : public Widget
{ {
public: public:
void popupFrom(Widget* parent) void popupFrom(Widget*)
{ {

View file

@ -10,12 +10,12 @@ std::unique_ptr<Keyboard> Keyboard::Create()
return std::make_unique<Keyboard>(); return std::make_unique<Keyboard>();
} }
std::string Keyboard::getKeyString(KeyCode code) std::string Keyboard::getKeyString(KeyCode)
{ {
return ""; return "";
} }
Keyboard::Function Keyboard::getFunction(KeyCode code) Keyboard::Function Keyboard::getFunction(KeyCode)
{ {
return Function::UNSET; return Function::UNSET;
} }

View file

@ -4,61 +4,61 @@
std::string FontTokens::getFont(Theme::Ref::Typeface::Font font) std::string FontTokens::getFont(Theme::Ref::Typeface::Font font)
{ {
switch (font) switch (font)
{ {
case Theme::Ref::Typeface::Font::Brand: case Theme::Ref::Typeface::Font::Brand:
return "Segoe UI"; return "Segoe UI";
case Theme::Ref::Typeface::Font::Plain: case Theme::Ref::Typeface::Font::Plain:
return "Segoe UI"; return "Segoe UI";
default: default:
return "Segoe UI"; return "Segoe UI";
} }
} }
Theme::Ref::Typeface::Font FontTokens::getFont(Theme::Sys::Typescale typescale) Theme::Ref::Typeface::Font FontTokens::getFont(Theme::Sys::Typescale typescale)
{ {
switch (typescale) switch (typescale)
{ {
case Theme::Sys::Typescale::Label_Large: case Theme::Sys::Typescale::Label_Large:
return Theme::Ref::Typeface::Font::Brand; return Theme::Ref::Typeface::Font::Brand;
default: default:
return Theme::Ref::Typeface::Font::Brand; return Theme::Ref::Typeface::Font::Brand;
} }
} }
unsigned FontTokens::getLineHeight(Theme::Sys::Typescale typescale) unsigned FontTokens::getLineHeight(Theme::Sys::Typescale typescale)
{ {
switch (typescale) switch (typescale)
{ {
case Theme::Sys::Typescale::Label_Large: case Theme::Sys::Typescale::Label_Large:
return 67; return 67;
default: default:
return 67; return 67;
} }
} }
unsigned FontTokens::getSize(Theme::Sys::Typescale typescale) unsigned FontTokens::getSize(Theme::Sys::Typescale typescale)
{ {
switch (typescale) switch (typescale)
{ {
case Theme::Sys::Typescale::Label_Large: case Theme::Sys::Typescale::Label_Large:
return static_cast<unsigned>(57/3.5); return static_cast<unsigned>(57/3.5);
default: default:
return 57; return 57;
} }
} }
unsigned FontTokens::getTracking(Theme::Sys::Typescale typescale) unsigned FontTokens::getTracking(Theme::Sys::Typescale)
{ {
return 0; return 0;
} }
unsigned FontTokens::getWeight(Theme::Ref::Typeface::Font font) unsigned FontTokens::getWeight(Theme::Ref::Typeface::Font)
{ {
return 0; return 0;
} }
Theme::Ref::Typeface::Font FontTokens::getWeight(Theme::Sys::Typescale typescale) Theme::Ref::Typeface::Font FontTokens::getWeight(Theme::Sys::Typescale)
{ {
return Theme::Ref::Typeface::Font::Brand; return Theme::Ref::Typeface::Font::Brand;
} }

View file

@ -243,7 +243,7 @@ bool Widget::onKeyboardEvent(const KeyboardEvent* event)
return true; return true;
} }
bool Widget::onMyKeyboardEvent(const KeyboardEvent* event) bool Widget::onMyKeyboardEvent(const KeyboardEvent*)
{ {
return false; return false;
} }
@ -306,7 +306,7 @@ void Widget::setFocus(bool hasFocus)
} }
} }
void Widget::onMyMouseEvent(const MouseEvent* event) void Widget::onMyMouseEvent(const MouseEvent*)
{ {
} }

View file

@ -17,9 +17,9 @@ public:
void loop() override{}; void loop() override{};
void showWindow(mt::Window* window) override{}; void showWindow(mt::Window*) override{};
void addWindow(mt::Window* window) override{}; void addWindow(mt::Window*) override{};
protected: protected:
void initialize() override{}; void initialize() override{};

View file

@ -73,7 +73,7 @@ bool XcbGlWindowInterface::initialize(xcb_window_t window)
return true; return true;
} }
void XcbGlWindowInterface::resizeViewPort(unsigned width, unsigned height) void XcbGlWindowInterface::resizeViewPort(unsigned, unsigned)
{ {
//glViewport(0, 0, width, height); //glViewport(0, 0, width, height);
//glScissor(0, 0, width, height); //glScissor(0, 0, width, height);

View file

@ -190,7 +190,7 @@ void XcbInterface::onPaint()
mainWindow->doPaint(defaultScreen); mainWindow->doPaint(defaultScreen);
} }
void XcbInterface::onExposeEvent(xcb_expose_event_t* event) void XcbInterface::onExposeEvent(xcb_expose_event_t*)
{ {
//auto window = mWindows[event->window]; //auto window = mWindows[event->window];
//window->SetSize(event->width, event->height); //window->SetSize(event->width, event->height);

View file

@ -30,7 +30,7 @@ XcbWindow::~XcbWindow()
xcb_destroy_window(mConnection, mHandle); xcb_destroy_window(mConnection, mHandle);
} }
void XcbWindow::add(mt::Window* window, xcb_connection_t* connection, mt::Screen* screen, uint32_t eventMask, FontsManager* fontsManager, XcbGlInterface* xcbGlInterface) void XcbWindow::add(mt::Window* window, xcb_connection_t* connection, mt::Screen* screen, uint32_t eventMask, FontsManager*, XcbGlInterface* xcbGlInterface)
{ {
if (!screen) if (!screen)
{ {

View file

@ -15,7 +15,7 @@ public:
return Type::TEXT_RUN; return Type::TEXT_RUN;
} }
std::string toString(unsigned depth = 0, bool keepInline = false) const override std::string toString(unsigned, bool) const override
{ {
return getText(); return getText();

View file

@ -1,6 +1,6 @@
#include "HtmlParagraphElement.h" #include "HtmlParagraphElement.h"
std::string HtmlParagraphElement::toString(unsigned depth, bool keepInline) const std::string HtmlParagraphElement::toString(unsigned depth, bool) const
{ {
const auto prefix = std::string(2*depth, ' '); const auto prefix = std::string(2*depth, ' ');

View file

@ -30,7 +30,7 @@ public:
virtual Type getType() const = 0; virtual Type getType() const = 0;
virtual void doFieldSubstitution(Type elementType, const std::string& searchPhrase, const std::string& replacementPhrase) virtual void doFieldSubstitution(Type, const std::string&, const std::string&)
{ {
} }