Commit a2faeda2 authored by Samuel Jackson's avatar Samuel Jackson
Browse files

Update all clang & gcc warnings to macros

parent 6aeec190
......@@ -10,7 +10,7 @@
namespace Mantid {
namespace DataObjects {
GCC_DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
class MockPeakShapeFactory : public PeakShapeFactory {
public:
......@@ -37,6 +37,6 @@ public:
}
}
GCC_DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
#endif /* MOCKOBJECTS_H_ */
......@@ -34,17 +34,17 @@
#endif
#include "MantidKernel/WarningSuppressions.h"
GCC_DIAG_OFF(conversion)
// clang-format off
GCC_DIAG_OFF(cast-qual)
DIAG_OFF(conversion)
DIAG_OFF(cast-qual)
// clang-format on
#include <TopoDS_Shape.hxx>
#include <BRepAlgoAPI_Common.hxx>
#include <BRepAlgoAPI_Fuse.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
GCC_DIAG_ON(conversion)
// clang-format off
GCC_DIAG_ON(cast-qual)
DIAG_ON(conversion)
DIAG_ON(cast-qual)
// clang-format on
#endif
......
......@@ -23,9 +23,9 @@
#endif
#endif
GCC_DIAG_OFF(conversion)
// clang-format off
GCC_DIAG_OFF(cast-qual)
DIAG_OFF(conversion)
DIAG_OFF(cast-qual)
// clang-format on
#include <gp_Trsf.hxx>
#include <gp_Pnt.hxx>
......@@ -39,9 +39,9 @@ GCC_DIAG_OFF(cast-qual)
#include <BRepBuilderAPI_Transform.hxx>
#include <BRep_Tool.hxx>
#include <Poly_Triangulation.hxx>
GCC_DIAG_ON(conversion)
// clang-format off
GCC_DIAG_ON(cast-qual)
DIAG_ON(conversion)
DIAG_ON(cast-qual)
// clang-format on
#ifdef __INTEL_COMPILER
......
......@@ -28,9 +28,9 @@
#endif
#endif
GCC_DIAG_OFF(conversion)
// clang-format off
GCC_DIAG_OFF(cast-qual)
DIAG_OFF(conversion)
DIAG_OFF(cast-qual)
// clang-format on
#include <gp_Pnt.hxx>
#include <TopoDS.hxx>
......@@ -41,9 +41,9 @@ GCC_DIAG_OFF(cast-qual)
#include <Poly_Array1OfTriangle.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <Poly_Triangulation.hxx>
GCC_DIAG_ON(conversion)
// clang-format off
GCC_DIAG_ON(cast-qual)
DIAG_ON(conversion)
DIAG_ON(cast-qual)
// clang-format on
#ifdef __INTEL_COMPILER
......
......@@ -30,14 +30,14 @@
#endif
#include "MantidKernel/WarningSuppressions.h"
GCC_DIAG_OFF(conversion)
// clang-format off
GCC_DIAG_OFF(cast-qual)
DIAG_OFF(conversion)
DIAG_OFF(cast-qual)
// clang-format on
#include <BRepPrimAPI_MakeCone.hxx>
GCC_DIAG_ON(conversion)
// clang-format off
GCC_DIAG_ON(cast-qual)
DIAG_ON(conversion)
DIAG_ON(cast-qual)
// clang-format on
#endif
......
......@@ -16,14 +16,14 @@
#endif
#include "MantidKernel/WarningSuppressions.h"
GCC_DIAG_OFF(conversion)
// clang-format off
GCC_DIAG_OFF(cast-qual)
DIAG_OFF(conversion)
DIAG_OFF(cast-qual)
// clang-format on
#include <BRepPrimAPI_MakeCylinder.hxx>
GCC_DIAG_ON(conversion)
// clang-format off
GCC_DIAG_ON(cast-qual)
DIAG_ON(conversion)
DIAG_ON(cast-qual)
// clang-format on
#endif
......
......@@ -17,18 +17,18 @@
#endif
#include "MantidKernel/WarningSuppressions.h"
GCC_DIAG_OFF(conversion)
// clang-format off
GCC_DIAG_OFF(cast-qual)
DIAG_OFF(conversion)
DIAG_OFF(cast-qual)
// clang-format on
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepPrimAPI_MakeHalfSpace.hxx>
#include <BRepAlgoAPI_Common.hxx>
#include <gp_Pln.hxx>
GCC_DIAG_ON(conversion)
// clang-format off
GCC_DIAG_ON(cast-qual)
DIAG_ON(conversion)
DIAG_ON(cast-qual)
// clang-format on
#endif
......
......@@ -14,14 +14,14 @@
#endif
#include "MantidKernel/WarningSuppressions.h"
GCC_DIAG_OFF(conversion)
// clang-format off
GCC_DIAG_OFF(cast-qual)
DIAG_OFF(conversion)
DIAG_OFF(cast-qual)
// clang-format on
#include <BRepPrimAPI_MakeSphere.hxx>
GCC_DIAG_ON(conversion)
// clang-format off
GCC_DIAG_ON(cast-qual)
DIAG_ON(conversion)
DIAG_ON(cast-qual)
// clang-format on
#endif
......
......@@ -29,14 +29,14 @@
#endif
#include "MantidKernel/WarningSuppressions.h"
GCC_DIAG_OFF(conversion)
// clang-format off
GCC_DIAG_OFF(cast-qual)
DIAG_OFF(conversion)
DIAG_OFF(cast-qual)
// clang-format on
#include <TopoDS_Shape.hxx>
GCC_DIAG_ON(conversion)
// clang-format off
GCC_DIAG_ON(cast-qual)
DIAG_ON(conversion)
DIAG_ON(cast-qual)
// clang-format on
#endif
......
......@@ -29,14 +29,14 @@
#endif
#include "MantidKernel/WarningSuppressions.h"
GCC_DIAG_OFF(conversion)
// clang-format off
GCC_DIAG_OFF(cast-qual)
DIAG_OFF(conversion)
DIAG_OFF(cast-qual)
// clang-format on
#include <TopoDS_Shape.hxx>
GCC_DIAG_ON(conversion)
// clang-format off
GCC_DIAG_ON(cast-qual)
DIAG_ON(conversion)
DIAG_ON(cast-qual)
// clang-format on
#endif
......
......@@ -136,7 +136,7 @@ public:
TS_ASSERT(Mock::VerifyAndClearExpectations(mock.get()))
}
GCC_DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
private:
class MockStructureFactorCalculator : public StructureFactorCalculator {
public:
......@@ -144,5 +144,5 @@ private:
MOCK_CONST_METHOD1(getFSquared, double(const V3D &));
};
};
GCC_DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
#endif /* MANTID_GEOMETRY_BASICHKLFILTERSTEST_H_ */
......@@ -56,10 +56,10 @@ private:
~MockScatterer() override {}
std::string name() const override { return "MockScatterer"; }
GCC_DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_CONST_METHOD0(clone, BraggScatterer_sptr());
MOCK_CONST_METHOD1(calculateStructureFactor, StructureFactor(const V3D &));
GCC_DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
};
};
......
......@@ -112,12 +112,12 @@ private:
public:
MockBraggScatterer() : BraggScattererInCrystalStructure() {}
~MockBraggScatterer() override {}
GCC_DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_CONST_METHOD0(name, std::string());
MOCK_CONST_METHOD0(clone, BraggScatterer_sptr());
MOCK_CONST_METHOD1(calculateStructureFactor, StructureFactor(const V3D &));
MOCK_METHOD1(afterScattererPropertySet, void(const std::string &));
GCC_DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
};
};
......
......@@ -43,12 +43,12 @@ private:
class MockBraggScatterer : public BraggScatterer {
public:
GCC_DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_CONST_METHOD0(name, std::string());
MOCK_CONST_METHOD0(clone, BraggScatterer_sptr());
MOCK_CONST_METHOD1(calculateStructureFactor, StructureFactor(const V3D &));
MOCK_METHOD1(afterScattererPropertySet, void(const std::string &));
GCC_DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
};
};
......
......@@ -45,7 +45,7 @@ namespace {
// -----------------------------------------------------------------------------
class MockRNG final : public Mantid::Kernel::PseudoRandomNumberGenerator {
public:
GCC_DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_METHOD0(nextValue, double());
MOCK_METHOD2(nextValue, double(double, double));
MOCK_METHOD2(nextInt, int(int, int));
......@@ -56,7 +56,7 @@ public:
MOCK_METHOD2(setRange, void(const double, const double));
MOCK_CONST_METHOD0(min, double());
MOCK_CONST_METHOD0(max, double());
GCC_DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
};
}
......
......@@ -18,11 +18,11 @@ private:
// composite.
class MockImplicitFunction : public Mantid::Geometry::MDImplicitFunction {
public:
GCC_DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_CONST_METHOD0(toXMLString, std::string());
MOCK_CONST_METHOD0(getName, std::string());
MOCK_METHOD1(isPointContained, bool(const Mantid::coord_t *coords));
GCC_DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
bool isPointContained(const std::vector<Mantid::coord_t> &) override {
return true;
}
......
......@@ -3,10 +3,11 @@
#include <cxxtest/TestSuite.h>
#include "MantidKernel/V3D.h"
#include "MantidGeometry/Crystal/Group.h"
#include "MantidGeometry/Crystal/SymmetryOperationFactory.h"
#include "MantidGeometry/Crystal/UnitCell.h"
#include "MantidKernel/V3D.h"
#include "MantidKernel/WarningSuppressions.h"
#include <boost/make_shared.hpp>
using namespace Mantid::Geometry;
......@@ -367,16 +368,15 @@ public:
Group_const_sptr null;
TS_ASSERT_THROWS(null * null, std::invalid_argument);
// AppleClang gives a warning if we don't use the result
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-comparison"
#endif
// clang gives a warning if we don't use the result
// clang-format off
DIAG_OFF(unused-comparison)
// clang-format on
TS_ASSERT_THROWS(null == null, std::invalid_argument);
TS_ASSERT_THROWS(null != null, std::invalid_argument);
#if __clang__
#pragma clang diagnostic pop
#endif
// clang-format off
DIAG_ON(unused-comparison)
// clang-format on
TS_ASSERT_THROWS(three * null, std::invalid_argument);
TS_ASSERT_THROWS(null * three, std::invalid_argument);
......
......@@ -184,7 +184,7 @@ public:
TS_ASSERT_EQUALS(orFilterCasted->getLHS(), lhs);
TS_ASSERT_EQUALS(orFilterCasted->getRHS(), rhs);
}
GCC_DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
private:
class MockHKLFilter : public HKLFilter {
public:
......@@ -212,5 +212,5 @@ private:
MOCK_CONST_METHOD1(isAllowed, bool(const V3D &));
};
};
GCC_DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
#endif /* MANTID_GEOMETRY_HKLFILTERTEST_H_ */
......@@ -22,7 +22,7 @@ using namespace testing;
using ScopedFileHelper::ScopedFile;
class InstrumentDefinitionParserTest : public CxxTest::TestSuite {
GCC_DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
private:
/// Mock Type to act as IDF files.
class MockIDFObject : public Mantid::Geometry::IDFObject {
......@@ -40,7 +40,7 @@ private:
MOCK_CONST_METHOD0(exists, bool());
MOCK_CONST_METHOD0(getParentDirectory, const Poco::Path());
};
GCC_DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
/**
Helper type to pass around related IDF environment information in a
collection.
......
......@@ -34,7 +34,7 @@ private:
/// dependency.
class MockIMDDimension : public Mantid::Geometry::IMDDimension {
public:
GCC_DIAG_OFF_SUGGEST_OVERRIDE
DIAG_OFF_SUGGEST_OVERRIDE
MOCK_CONST_METHOD0(getName, std::string());
MOCK_CONST_METHOD0(getUnits, const Mantid::Kernel::UnitLabel());
MOCK_CONST_METHOD0(getDimensionId, const std::string &());
......@@ -48,7 +48,7 @@ private:
MOCK_METHOD3(setRange, void(size_t nBins, coord_t min, coord_t max));
MOCK_CONST_METHOD0(getMDUnits, const Kernel::MDUnit &());
MOCK_CONST_METHOD0(getMDFrame, const Geometry::MDFrame &());
GCC_DIAG_ON_SUGGEST_OVERRIDE
DIAG_ON_SUGGEST_OVERRIDE
};
static std::string createDimensionXMLString(unsigned int nbins, int min,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment