From 9c5621bd63dc1731fe6fb634cc34bd14c67b4517 Mon Sep 17 00:00:00 2001 From: Janik Zikovsky <zikovskyjl@ornl.gov> Date: Fri, 8 Jul 2011 17:42:28 +0000 Subject: [PATCH] Refs #3302: Fix several warnings. --- Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h | 2 +- Code/Mantid/Framework/Algorithms/src/FFTDerivative.cpp | 4 ++-- Code/Mantid/Framework/Algorithms/src/Integration.cpp | 2 +- Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp | 2 +- Code/Mantid/Framework/DataHandling/src/MaskDetectors.cpp | 2 -- Code/Mantid/Framework/DataObjects/test/Workspace2DTest.h | 2 +- Code/Mantid/Framework/Nexus/src/MuonNexusReader.cpp | 2 +- Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp | 4 ++-- .../MantidPlot/src/Mantid/InstrumentWidget/ColorMapWidget.cpp | 2 +- .../MantidPlot/src/Mantid/InstrumentWidget/Projection3D.cpp | 4 ++-- Code/Mantid/MantidPlot/src/Mantid/MantidTable.cpp | 2 +- 11 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h b/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h index ea38ebab36b..d2f7532e2cb 100644 --- a/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h +++ b/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h @@ -283,7 +283,7 @@ public: { boost::shared_ptr<MatrixWorkspace> ws(new WorkspaceTester()); ws->initialize(4,1,1); - ISpectrum * spec; + ISpectrum * spec = NULL; TS_ASSERT_THROWS_NOTHING( spec = ws->getSpectrum(0) ); TS_ASSERT(spec); TS_ASSERT_THROWS_NOTHING( spec = ws->getSpectrum(3) ); diff --git a/Code/Mantid/Framework/Algorithms/src/FFTDerivative.cpp b/Code/Mantid/Framework/Algorithms/src/FFTDerivative.cpp index 11ab198aa18..cd5a361216c 100644 --- a/Code/Mantid/Framework/Algorithms/src/FFTDerivative.cpp +++ b/Code/Mantid/Framework/Algorithms/src/FFTDerivative.cpp @@ -149,8 +149,8 @@ void FFTDerivative::execComplexFFT() transWS = fft->getProperty("OutputWorkspace"); size_t m2 = transWS->readY(0).size() / 2; - size_t my = m2 + (transWS->readY(0).size() % 2 ? 1 : 0); - size_t mx = my + (transWS->isHistogramData() ? 1 : 0); + //size_t my = m2 + (transWS->readY(0).size() % 2 ? 1 : 0); + //size_t mx = my + (transWS->isHistogramData() ? 1 : 0); if (!outWS) { diff --git a/Code/Mantid/Framework/Algorithms/src/Integration.cpp b/Code/Mantid/Framework/Algorithms/src/Integration.cpp index cdf4f2659a6..d9e09ec9beb 100644 --- a/Code/Mantid/Framework/Algorithms/src/Integration.cpp +++ b/Code/Mantid/Framework/Algorithms/src/Integration.cpp @@ -249,7 +249,7 @@ void Integration::execEvent() outputWS = boost::dynamic_pointer_cast<EventWorkspace>( API::WorkspaceFactory::Instance().create("EventWorkspace", m_MaxSpec-m_MinSpec+1, 2, 1)); //Copy geometry over. - bool differentSize = (m_MaxSpec-m_MinSpec+1) != inputEventWS->getNumberHistograms(); + bool differentSize = (m_MaxSpec-m_MinSpec+1) != static_cast<int>(inputEventWS->getNumberHistograms()); API::WorkspaceFactory::Instance().initializeFromParent(inputEventWS, outputWS, differentSize); //You need to copy over the data as well. // -- we copy only a range, if specified. diff --git a/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp b/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp index 483b0a4fef5..5fcbf96ff67 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp @@ -292,7 +292,7 @@ API::MatrixWorkspace_sptr LoadNexusProcessed::loadEventEntry(NXData & wksp_cls, /** * Load a table */ -API::Workspace_sptr LoadNexusProcessed::loadTableEntry(NXEntry & entry) +API::Workspace_sptr LoadNexusProcessed::loadTableEntry(NXEntry & /*entry*/) { // Get workspace characteristics //NXData wksp_cls = mtd_entry.openNXData("table_workspace"); diff --git a/Code/Mantid/Framework/DataHandling/src/MaskDetectors.cpp b/Code/Mantid/Framework/DataHandling/src/MaskDetectors.cpp index 4870f117cf2..f548b9e0191 100644 --- a/Code/Mantid/Framework/DataHandling/src/MaskDetectors.cpp +++ b/Code/Mantid/Framework/DataHandling/src/MaskDetectors.cpp @@ -60,8 +60,6 @@ void MaskDetectors::exec() { // Get the input workspace const MatrixWorkspace_sptr WS = getProperty("Workspace"); - // Get the size of the vectors - const size_t vectorSize = WS->blocksize(); //Is it an event workspace? EventWorkspace_sptr eventWS = boost::dynamic_pointer_cast<EventWorkspace>(WS); diff --git a/Code/Mantid/Framework/DataObjects/test/Workspace2DTest.h b/Code/Mantid/Framework/DataObjects/test/Workspace2DTest.h index c06f3373387..514973470fe 100644 --- a/Code/Mantid/Framework/DataObjects/test/Workspace2DTest.h +++ b/Code/Mantid/Framework/DataObjects/test/Workspace2DTest.h @@ -204,7 +204,7 @@ public: { boost::shared_ptr<MatrixWorkspace> ws(new Workspace2D()); ws->initialize(4,1,1); - ISpectrum * spec; + ISpectrum * spec = NULL; TS_ASSERT_THROWS_NOTHING( spec = ws->getSpectrum(0) ); TS_ASSERT(spec); TS_ASSERT_THROWS_NOTHING( spec = ws->getSpectrum(3) ); diff --git a/Code/Mantid/Framework/Nexus/src/MuonNexusReader.cpp b/Code/Mantid/Framework/Nexus/src/MuonNexusReader.cpp index 39804bf98ee..bc40517d337 100644 --- a/Code/Mantid/Framework/Nexus/src/MuonNexusReader.cpp +++ b/Code/Mantid/Framework/Nexus/src/MuonNexusReader.cpp @@ -352,7 +352,7 @@ void MuonNexusReader::getLogStringValues(const int& logNumber, const int& logSeq double time=logTimes[logNumber][logSequence]; logTime=static_cast<std::time_t>(time)+startTime_time_t; std::vector<std::string>& strings = logStringValues[logNumber]; - if (logSequence < strings.size()) + if (logSequence < int(strings.size())) { value = strings[logSequence]; } diff --git a/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp b/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp index d24f188f817..59ab0866349 100644 --- a/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp +++ b/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp @@ -706,7 +706,7 @@ using namespace DataObjects; int NexusFileIO::writeNexusTableWorkspace( const API::ITableWorkspace_const_sptr& itableworkspace, const char * group_name) const { - NXstatus status; + NXstatus status = 0; boost::shared_ptr<const TableWorkspace> tableworkspace = boost::dynamic_pointer_cast<const TableWorkspace>(itableworkspace); @@ -736,7 +736,7 @@ using namespace DataObjects; std::string str = "column_" + boost::lexical_cast<std::string>(i+1); std::string bob = col->get_type_info().name(); - if ( col->get_type_info().name() == "double" ) + if ( col->get_type_info().name() == std::string("double") ) { double * toNexus = new double[nRows]; for (int ii = 0; ii < nRows; ii++) diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ColorMapWidget.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ColorMapWidget.cpp index 789f3764d46..34b45428363 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ColorMapWidget.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ColorMapWidget.cpp @@ -190,7 +190,7 @@ void ColorMapWidget::mouseMoveEvent(QMouseEvent* e) } } -void ColorMapWidget::mouseReleaseEvent(QMouseEvent* e) +void ColorMapWidget::mouseReleaseEvent(QMouseEvent* /*e*/) { if (!m_dragging) return; if (m_dtype == Bottom) diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/Projection3D.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/Projection3D.cpp index 7ab60098299..a85826bed76 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/Projection3D.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/Projection3D.cpp @@ -417,8 +417,8 @@ void Projection3D::componentSelected(Mantid::Geometry::ComponentID id) //std::cerr << minBounds << maxBounds << std::endl; // cannot get it right - double znear = minBounds.Z(); - double zfar = maxBounds.Z(); +// double znear = minBounds.Z(); +// double zfar = maxBounds.Z(); //if (znear > zfar) //{ // std::swap(znear,zfar); diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidTable.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidTable.cpp index 6c3a5588f9f..d785fc30d64 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidTable.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/MantidTable.cpp @@ -21,7 +21,7 @@ using namespace MantidQt::API; * @return the MantidTable created */ MantidTable::MantidTable(ScriptingEnv *env, Mantid::API::ITableWorkspace_sptr ws, const QString &label, - ApplicationWindow* parent, const QString& name, Qt::WFlags f): + ApplicationWindow* parent, const QString& /*name*/, Qt::WFlags f): Table(env,ws->rowCount(),ws->columnCount(),label,parent,"",f), m_ws(ws), m_wsName(ws->getName()) -- GitLab