From 80ff8d12ceded4c156f523462a41450cbe9ddc3b Mon Sep 17 00:00:00 2001 From: Martyn Gigg <martyn.gigg@stfc.ac.uk> Date: Fri, 23 Oct 2015 17:00:40 +0100 Subject: [PATCH] Clear more warnings. --- Framework/Geometry/src/Objects/Object.cpp | 2 +- Framework/Geometry/src/Objects/RuleItems.cpp | 12 ++++++------ .../MDAlgorithms/test/ImportMDEventWorkspaceTest.h | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Framework/Geometry/src/Objects/Object.cpp b/Framework/Geometry/src/Objects/Object.cpp index d7bccf922d6..3c36a5a016b 100644 --- a/Framework/Geometry/src/Objects/Object.cpp +++ b/Framework/Geometry/src/Objects/Object.cpp @@ -507,7 +507,7 @@ int Object::createSurfaceList(const int outFlag) { std::vector<const Surface *>::const_iterator vc; for (vc = SurList.begin(); vc != SurList.end(); ++vc) { - std::cerr << "Point == " << reinterpret_cast<long int>(*vc) << std::endl; + std::cerr << "Point == " << *vc << std::endl; std::cerr << (*vc)->getName() << std::endl; } } diff --git a/Framework/Geometry/src/Objects/RuleItems.cpp b/Framework/Geometry/src/Objects/RuleItems.cpp index 30e7042d782..648acf16494 100644 --- a/Framework/Geometry/src/Objects/RuleItems.cpp +++ b/Framework/Geometry/src/Objects/RuleItems.cpp @@ -276,7 +276,7 @@ std::string Intersection::displayAddress() const */ { std::stringstream cx; - cx << " [ " << reinterpret_cast<long>(this); + cx << " [ " << this; if (A && B) cx << " ] (" + A->displayAddress() + " " + B->displayAddress() + ") "; else if (A) @@ -641,7 +641,7 @@ std::string Union::displayAddress() const */ { std::stringstream cx; - cx << " [ " << reinterpret_cast<long int>(this); + cx << " [ " << this; if (A && B) cx << " ] (" + A->displayAddress() + " : " + B->displayAddress() + ") "; @@ -878,7 +878,7 @@ std::string SurfPoint::displayAddress() const */ { std::stringstream cx; - cx << reinterpret_cast<long int>(this); + cx << this; return cx.str(); } @@ -1179,7 +1179,7 @@ std::string CompObj::displayAddress() const */ { std::stringstream cx; - cx << reinterpret_cast<long int>(this); + cx << this; return cx.str(); } @@ -1431,7 +1431,7 @@ std::string BoolValue::displayAddress() const */ { std::stringstream cx; - cx << reinterpret_cast<long int>(this); + cx << this; return cx.str(); } @@ -1640,7 +1640,7 @@ std::string CompGrp::displayAddress() const */ { std::stringstream cx; - cx << "#( [" << reinterpret_cast<long int>(this) << "] "; + cx << "#( [" << this << "] "; if (A) cx << A->displayAddress(); else diff --git a/Framework/MDAlgorithms/test/ImportMDEventWorkspaceTest.h b/Framework/MDAlgorithms/test/ImportMDEventWorkspaceTest.h index 170c489ddc9..cd307417eb3 100644 --- a/Framework/MDAlgorithms/test/ImportMDEventWorkspaceTest.h +++ b/Framework/MDAlgorithms/test/ImportMDEventWorkspaceTest.h @@ -83,7 +83,8 @@ public: ~MDFileObject() { m_file.close(); if (remove(m_filename.c_str()) != 0) - throw std::runtime_error("cannot remove " + m_filename); + // destructors shouldn't throw exceptions so we have to resort to printing an error + std::cerr << "~MDFileObject() - Error deleting file '" << m_filename << "'\n"; } private: -- GitLab