diff --git a/Mapper.cpp b/Mapper.cpp index 3eb90d0..f94fb24 100644 --- a/Mapper.cpp +++ b/Mapper.cpp @@ -19,6 +19,7 @@ */ #include "Mapper.h" +#include "unused.h" Mapper::Mapper(Mapping::ptr mapping) : _mapping(mapping) @@ -169,6 +170,7 @@ void ColorMapper::draw(QPainter* painter) void ColorMapper::drawControls(QPainter* painter) { + UNUSED(painter); } MeshColorMapper::MeshColorMapper(Mapping::ptr mapping) @@ -293,6 +295,7 @@ void TextureMapper::updateShape(Shape* shape) void TextureMapper::draw(QPainter* painter) { + UNUSED(painter); painter->beginNativePainting(); // Only works for similar shapes. @@ -324,7 +327,7 @@ void TextureMapper::draw(QPainter* painter) void TextureMapper::drawInput(QPainter* painter) { - + UNUSED(painter); } void TextureMapper::drawControls(QPainter* painter) @@ -344,6 +347,7 @@ TriangleTextureMapper::TriangleTextureMapper(std::tr1::shared_ptrnVertices(); i++) @@ -399,6 +403,8 @@ void MeshTextureMapper::drawControls(QPainter* painter) void MeshTextureMapper::drawInputControls(QPainter* painter) { + UNUSED(painter); + std::tr1::shared_ptr inputMesh = std::tr1::static_pointer_cast(inputShape); QVector inputQuads = inputMesh->getQuads(); for (QVector::const_iterator it = inputQuads.begin(); it != inputQuads.end(); ++it) @@ -409,6 +415,7 @@ void MeshTextureMapper::drawInputControls(QPainter* painter) void MeshTextureMapper::_doDraw(QPainter* painter) { + UNUSED(painter); std::tr1::shared_ptr outputMesh = std::tr1::static_pointer_cast(outputShape); std::tr1::shared_ptr inputMesh = std::tr1::static_pointer_cast(inputShape); QVector > outputQuads = outputMesh->getQuads2d(); @@ -436,16 +443,17 @@ EllipseTextureMapper::EllipseTextureMapper(std::tr1::shared_ptr void EllipseTextureMapper::_doDraw(QPainter* painter) { + UNUSED(painter); // Get input and output ellipses. std::tr1::shared_ptr inputEllipse = std::tr1::static_pointer_cast(inputShape); std::tr1::shared_ptr outputEllipse = std::tr1::static_pointer_cast(outputShape); // Start / end angle. - const float startAngle = 0; - const float endAngle = 2*M_PI; + //const float startAngle = 0; + //const float endAngle = 2*M_PI; // - float angle; + //float angle; QPointF currentInputPoint; QPointF prevInputPoint(0, 0); QPointF currentOutputPoint; diff --git a/Util.cpp b/Util.cpp index 343943a..902f1ca 100644 --- a/Util.cpp +++ b/Util.cpp @@ -19,6 +19,7 @@ */ #include "Util.h" +#include "unused.h" #include namespace Util { @@ -72,6 +73,9 @@ int map_int(int value, int istart, int istop, int ostart, int ostop) Mesh* createMeshForTexture(Texture* texture, int frameWidth, int frameHeight) { + UNUSED(frameHeight); + UNUSED(frameWidth); + return new Mesh( QPointF(texture->getX(), texture->getY()), QPointF(texture->getX() + texture->getWidth(), texture->getY()), @@ -82,6 +86,9 @@ Mesh* createMeshForTexture(Texture* texture, int frameWidth, int frameHeight) Triangle* createTriangleForTexture(Texture* texture, int frameWidth, int frameHeight) { + UNUSED(frameHeight); + UNUSED(frameWidth); + return new Triangle( QPointF(texture->getX(), texture->getY() + texture->getHeight()), QPointF(texture->getX() + texture->getWidth(), texture->getY() + texture->getHeight()), @@ -92,6 +99,9 @@ Triangle* createTriangleForTexture(Texture* texture, int frameWidth, int frameHe Ellipse* createEllipseForTexture(Texture* texture, int frameWidth, int frameHeight) { + UNUSED(frameHeight); + UNUSED(frameWidth); + qreal halfWidth = texture->getWidth() / 2; qreal halfHeight = texture->getHeight() / 2; diff --git a/mapmap.pro b/mapmap.pro index 610837b..86d79c9 100644 --- a/mapmap.pro +++ b/mapmap.pro @@ -17,7 +17,8 @@ HEADERS = \ Shape.h \ SourceGLCanvas.h \ UidAllocator.h \ - Util.h + Util.h \ + unused.h \ SOURCES = \ # Controller.cpp \ @@ -56,4 +57,5 @@ macx:QMAKE_CXXFLAGS += -D__MACOSX_CORE__ # not mac !macx:LIBS += -lglut -lGLU +!macx:QMAKE_CXXFLAGS += -Wno-unused-result -Wfatal-errors diff --git a/unused.h b/unused.h new file mode 100644 index 0000000..ba88459 --- /dev/null +++ b/unused.h @@ -0,0 +1,7 @@ +#ifndef __mapmap_unused_h__ +#define __mapmap_unused_h__ + +#define UNUSED(x) (void)(x) + +#endif // ifndef +