diff --git a/Framework/Geometry/src/Objects/Object.cpp b/Framework/Geometry/src/Objects/Object.cpp index d7bccf922d68d8ae460d4ef200e57dec7ee257a5..3c36a5a016b26b84a2055a23a377e902948dfe14 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 30e7042d782ebfe704a9215dd657cadcc6063579..648acf16494f7c8eee73aa1c26f424b8be6becf3 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 170c489ddc9c4402296cd62feb84b35d037320ba..cd307417eb39f21a4a9fb71b2ea13ecb63cb565d 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: