From a36585a0ac2e4ebcca1a6cc040b45687b136b283 Mon Sep 17 00:00:00 2001 From: Kjetil Olsen Lye Date: Fri, 22 Nov 2013 15:53:02 +0100 Subject: [PATCH] Removed warnings. --- examples/fpsviewer/fpsviewer_job.hpp | 10 +++++----- include/tinia/qtcontroller/impl/http_utils.hpp | 4 ++-- src/jobcontroller/ComputeJob.cpp | 2 +- src/modelxml/XMLReader.cpp | 8 ++++---- src/qtcontroller/DoubleSpinBox.cpp | 2 +- src/qtcontroller/LongPollHandler.cpp | 2 +- tutorials/tutorial3/Tutorial3_Job.hpp | 8 ++++---- unittests/modelxml/ExposedModelTest.cpp | 2 +- unittests/renderlist/Simple.cpp | 4 ++-- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/examples/fpsviewer/fpsviewer_job.hpp b/examples/fpsviewer/fpsviewer_job.hpp index e79bbad..bb38549 100644 --- a/examples/fpsviewer/fpsviewer_job.hpp +++ b/examples/fpsviewer/fpsviewer_job.hpp @@ -76,18 +76,18 @@ void DrawCube(float size) { glBegin(GL_QUADS); - glColor3f(0.7, 0.0, 0.0); + glColor3f(0.7f, 0.0f, 0.0f); glVertex3f(-size, -size, -size); glVertex3f( size, -size, -size); glVertex3f( size, size, -size); glVertex3f(-size, size, -size); - glColor3f(0.0, 1.0, 1.0); + glColor3f(0.0f, 1.0f, 1.0f); glVertex3f(-size, -size, size); glVertex3f( size, -size, size); glVertex3f( size, size, size); glVertex3f(-size, size, size); - glColor3f(0.0, 0.0, 0.7); + glColor3f(0.0f, 0.0f, 0.7f); glVertex3f(-size, -size, -size); glVertex3f(-size, -size, size); @@ -100,14 +100,14 @@ void DrawCube(float size) { glVertex3f( size, size, size); glVertex3f( size, size, -size); - glColor3f(0.0, 0.7, 0.0); + glColor3f(0.0f, 0.7f, 0.0f); glVertex3f(-size, -size, -size); glVertex3f(-size, -size, size); glVertex3f( size, -size, size); glVertex3f( size, -size, -size); - glColor3f( 0.25, 0.25, 0.25 ); + glColor3f( 0.25f, 0.25f, 0.25f ); glVertex3f(-size, size, -size); glVertex3f(-size, size, size); glVertex3f( size, size, size); diff --git a/include/tinia/qtcontroller/impl/http_utils.hpp b/include/tinia/qtcontroller/impl/http_utils.hpp index 29747b7..d48dfd1 100644 --- a/include/tinia/qtcontroller/impl/http_utils.hpp +++ b/include/tinia/qtcontroller/impl/http_utils.hpp @@ -41,7 +41,7 @@ void ParseGetHelper<0>::parse(Sequence& seq, const QMap& param try { boost::tuples::get<0>(seq) = boost::lexical_cast::type>(parameters[keys[0]].toStdString()); - } catch(boost::bad_lexical_cast& e) { + } catch(boost::bad_lexical_cast&) { throw std::invalid_argument("Could not parse the value of key " + keys[0].toStdString()); } @@ -59,7 +59,7 @@ void ParseGetHelper::parse(Sequence& seq, const QMap& param try { boost::tuples::get(seq) = boost::lexical_cast::type>(parameters[keys[i]].toStdString()); - } catch(boost::bad_lexical_cast& e) { + } catch(boost::bad_lexical_cast& ) { throw std::invalid_argument("Could not parse the value of key " + keys[i].toStdString()); } diff --git a/src/jobcontroller/ComputeJob.cpp b/src/jobcontroller/ComputeJob.cpp index 4d4f8f0..6003a17 100644 --- a/src/jobcontroller/ComputeJob.cpp +++ b/src/jobcontroller/ComputeJob.cpp @@ -43,7 +43,7 @@ ComputeJob::operator()() run(); m_model->updateElement("status", "finished"); } - catch (Interrupted &e) + catch (Interrupted &) { m_model->updateElement("status", "terminated"); } diff --git a/src/modelxml/XMLReader.cpp b/src/modelxml/XMLReader.cpp index 9669ee8..05d3516 100644 --- a/src/modelxml/XMLReader.cpp +++ b/src/modelxml/XMLReader.cpp @@ -54,12 +54,12 @@ XMLReader::XMLReader() depth = xmlTextReaderDepth(reader); xmlChar *localName = xmlTextReaderLocalName(reader); if (type==1) { - state_begin_found = xmlStrEqual(localName, BAD_CAST name.c_str()); + state_begin_found = (xmlStrEqual(localName, BAD_CAST name.c_str()) != 0); if (state_begin_found) - state_end_found = xmlTextReaderIsEmptyElement(reader); + state_end_found = (xmlTextReaderIsEmptyElement(reader) != 0); } else if (type==15) { - state_end_found = xmlStrEqual(localName, BAD_CAST name.c_str()); + state_end_found = (xmlStrEqual(localName, BAD_CAST name.c_str()) != 0); } xmlFree(localName); r=xmlTextReaderRead(reader); @@ -95,7 +95,7 @@ XMLReader::XMLReader() depth = xmlTextReaderDepth(reader); switch ( xmlTextReaderNodeType( reader ) ) { case 15: - state_end_found = xmlStrEqual(localName, BAD_CAST section_name.c_str()); + state_end_found = (xmlStrEqual(localName, BAD_CAST section_name.c_str()) != 0); break; case 1: r = xmlTextReaderRead(reader); diff --git a/src/qtcontroller/DoubleSpinBox.cpp b/src/qtcontroller/DoubleSpinBox.cpp index 9c34a04..c33cad0 100644 --- a/src/qtcontroller/DoubleSpinBox.cpp +++ b/src/qtcontroller/DoubleSpinBox.cpp @@ -35,7 +35,7 @@ DoubleSpinBox::DoubleSpinBox(std::string key, boost::shared_ptr args = decodeGetParameters(m_request); boost::tuple params = parseGet >(decodeGetParameters(m_request), "revision"); revision = params.get<0>(); - } catch(std::invalid_argument& e) { + } catch(std::invalid_argument&) { // Don't have to do anything; } diff --git a/tutorials/tutorial3/Tutorial3_Job.hpp b/tutorials/tutorial3/Tutorial3_Job.hpp index 0105a55..0765fa1 100644 --- a/tutorials/tutorial3/Tutorial3_Job.hpp +++ b/tutorials/tutorial3/Tutorial3_Job.hpp @@ -195,10 +195,10 @@ bool Tutorial3Job::renderFrame( const std::string &session, /** [renderloop] */ glBegin(GL_TRIANGLES); - glColor3f(1, 0, 0); - glVertex2f(0 - s1, 0); - glVertex2f(1 + s2, 0); - glVertex2f(1 + s2, 1 + s3); + glColor3f(1.f, 0.f, 0.f); + glVertex2f(0.f - s1, 0.f); + glVertex2f(1.f + s2, 0.f); + glVertex2f(1.f + s2, 1.f + s3); glEnd(); /** [renderloop] */ diff --git a/unittests/modelxml/ExposedModelTest.cpp b/unittests/modelxml/ExposedModelTest.cpp index 10e52e6..87909db 100644 --- a/unittests/modelxml/ExposedModelTest.cpp +++ b/unittests/modelxml/ExposedModelTest.cpp @@ -262,7 +262,7 @@ struct AddMatrixFixture : public Fixture { matrixName( "projection" ) { for(int i = 0; i < 16; ++i) { - myMatrix[i] = i + 1; + myMatrix[i] = float(i + 1); } model->addMatrixElement( matrixName, myMatrix.data() ); diff --git a/unittests/renderlist/Simple.cpp b/unittests/renderlist/Simple.cpp index 2052591..42a5317 100644 --- a/unittests/renderlist/Simple.cpp +++ b/unittests/renderlist/Simple.cpp @@ -94,8 +94,8 @@ BOOST_FIXTURE_TEST_CASE( foobar, Fixture ) ->set( temporaryCubeNormArray, sizeof(temporaryCubeNormArray) / sizeof(float)); - float P[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1.0202, -1, 0, 0, -0.121333, 0 }; - float Pi[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -8.24176, 0, 0, -1, 8.40826 }; + float P[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1.0202f, -1, 0, 0, -0.121333f, 0 }; + float Pi[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -8.24176f, 0, 0, -1, 8.40826f }; float cfw[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -3, 1}; float ctw[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 3, 1 }; float lfw[16] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};