From 1f429577556ee31211d1ee1544c312dd97161619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Fri, 11 Sep 2015 13:37:31 +0200 Subject: [PATCH] Silence some unused argument warnings. --- opm/material/common/MathToolbox.hpp | 2 +- opm/material/common/Valgrind.hpp | 12 +++++++++++ opm/material/components/Component.hpp | 30 +++++++++++++-------------- opm/material/components/Unit.hpp | 26 +++++++++++------------ tests/test_2dtables.cpp | 4 ++-- 5 files changed, 43 insertions(+), 31 deletions(-) diff --git a/opm/material/common/MathToolbox.hpp b/opm/material/common/MathToolbox.hpp index 6c4b8098d..36194ede1 100644 --- a/opm/material/common/MathToolbox.hpp +++ b/opm/material/common/MathToolbox.hpp @@ -112,7 +112,7 @@ public: * regard to x. For scalar evaluations (which do not consider derivatives), this * method does nothing. */ - static Scalar createVariable(Scalar value, int varIdx) + static Scalar createVariable(Scalar value, int /* varIdx */) { return value; } /*! diff --git a/opm/material/common/Valgrind.hpp b/opm/material/common/Valgrind.hpp index 3466dc1ee..b1b5060f4 100644 --- a/opm/material/common/Valgrind.hpp +++ b/opm/material/common/Valgrind.hpp @@ -77,6 +77,7 @@ inline bool CheckDefined(const T &value) auto tmp = VALGRIND_CHECK_MEM_IS_DEFINED(&value, sizeof(T)); return tmp == 0; #else + static_cast(value); return true; #endif } @@ -113,6 +114,8 @@ inline bool CheckDefined(const T *value, int size) auto tmp = VALGRIND_CHECK_MEM_IS_DEFINED(value, size*sizeof(T)); return tmp == 0; #else + static_cast(value); + static_cast(size); return true; #endif } @@ -140,6 +143,7 @@ inline void SetUndefined(const T &value) #if !defined NDEBUG && HAVE_VALGRIND auto OPM_UNUSED result = VALGRIND_MAKE_MEM_UNDEFINED(&value, sizeof(T)); #endif + static_cast(value); } /*! @@ -166,6 +170,8 @@ inline void SetUndefined(const T *value, int size) #if !defined NDEBUG && HAVE_VALGRIND auto OPM_UNUSED result = VALGRIND_MAKE_MEM_UNDEFINED(value, size*sizeof(T)); #endif + static_cast(value); + static_cast(size); } /*! @@ -190,6 +196,7 @@ inline void SetDefined(const T &value) #if !defined NDEBUG && HAVE_VALGRIND auto OPM_UNUSED result = VALGRIND_MAKE_MEM_DEFINED(&value, sizeof(T)); #endif + static_cast(value); } /*! @@ -216,6 +223,8 @@ inline void SetDefined(const T *value, int n) #if !defined NDEBUG && HAVE_VALGRIND auto OPM_UNUSED result = VALGRIND_MAKE_MEM_DEFINED(value, n*sizeof(T)); #endif + static_cast(value); + static_cast(n); } /*! @@ -240,6 +249,7 @@ inline void SetNoAccess(const T &value) #if !defined NDEBUG && HAVE_VALGRIND auto OPM_UNUSED result = VALGRIND_MAKE_MEM_NOACCESS(&value, sizeof(T)); #endif + static_cast(value); } /*! @@ -264,6 +274,8 @@ inline void SetNoAccess(const T *value, int size) #if !defined NDEBUG && HAVE_VALGRIND auto OPM_UNUSED result = VALGRIND_MAKE_MEM_NOACCESS(value, size*sizeof(T)); #endif + static_cast(value); + static_cast(size); } } // namespace Valgrind diff --git a/opm/material/components/Component.hpp b/opm/material/components/Component.hpp index 8fe5a301d..28d4a6bf5 100644 --- a/opm/material/components/Component.hpp +++ b/opm/material/components/Component.hpp @@ -58,8 +58,8 @@ public: * * This function throws a warning when called: "No init routine defined - make sure that this is not necessary!" */ - static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, - Scalar pressMin, Scalar pressMax, unsigned nPress) + static void init(Scalar /* tempMin */, Scalar /* tempMax */, unsigned /* nTemp */, + Scalar /* pressMin */, Scalar /* pressMax */, unsigned /* nPress */) { } /*! @@ -123,7 +123,7 @@ public: * \param temperature temperature of the component in \f$\mathrm{[K]}\f$ */ template - static Evaluation vaporPressure(const Evaluation& temperature) + static Evaluation vaporPressure(const Evaluation& /* temperature */) { OPM_THROW(std::runtime_error, "Not implemented: Component::vaporPressure()"); } /*! @@ -133,7 +133,7 @@ public: * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ template - static Evaluation gasDensity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation gasDensity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { OPM_THROW(std::runtime_error, "Not implemented: Component::gasDensity()"); } /*! @@ -143,7 +143,7 @@ public: * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ template - static Evaluation liquidDensity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation liquidDensity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { OPM_THROW(std::runtime_error, "Not implemented: Component::liquidDensity()"); } /*! @@ -153,7 +153,7 @@ public: * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ template - static Evaluation gasEnthalpy(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation gasEnthalpy(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { OPM_THROW(std::runtime_error, "Not implemented: Component::gasEnthalpy()"); } /*! @@ -163,7 +163,7 @@ public: * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ template - static Evaluation liquidEnthalpy(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation liquidEnthalpy(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { OPM_THROW(std::runtime_error, "Not implemented: Component::liquidEnthalpy()"); } /*! @@ -173,7 +173,7 @@ public: * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ template - static Evaluation gasInternalEnergy(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation gasInternalEnergy(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { OPM_THROW(std::runtime_error, "Not implemented: Component::gasInternalEnergy()"); } /*! @@ -183,7 +183,7 @@ public: * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ template - static Evaluation liquidInternalEnergy(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation liquidInternalEnergy(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { OPM_THROW(std::runtime_error, "Not implemented: Component::liquidInternalEnergy()"); } /*! @@ -194,7 +194,7 @@ public: * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ template - static Evaluation gasViscosity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation gasViscosity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { OPM_THROW(std::runtime_error, "Not implemented: Component::gasViscosity()"); } /*! @@ -204,35 +204,35 @@ public: * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ template - static Evaluation liquidViscosity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation liquidViscosity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { OPM_THROW(std::runtime_error, "Not implemented: Component::liquidViscosity()"); } /*! * \brief Thermal conductivity of the component [W/(m^2 K/m)] as a gas. */ template - static Evaluation gasThermalConductivity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation gasThermalConductivity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { OPM_THROW(std::runtime_error, "Not implemented: Component::gasThermalConductivity()"); } /*! * \brief Thermal conductivity of the component [W/(m^2 K/m)] as a liquid. */ template - static Evaluation liquidThermalConductivity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation liquidThermalConductivity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { OPM_THROW(std::runtime_error, "Not implemented: Component::liquidThermalConductivity()"); } /*! * \brief Specific isobaric heat capacity of the component [J/kg] as a gas. */ template - static Evaluation gasHeatCapacity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation gasHeatCapacity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { OPM_THROW(std::runtime_error, "Not implemented: Component::gasHeatCapacity()"); } /*! * \brief Specific isobaric heat capacity of the component [J/kg] as a liquid. */ template - static Evaluation liquidHeatCapacity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation liquidHeatCapacity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { OPM_THROW(std::runtime_error, "Not implemented: Component::liquidHeatCapacity()"); } }; diff --git a/opm/material/components/Unit.hpp b/opm/material/components/Unit.hpp index 23e2f1d35..f0caeaff1 100644 --- a/opm/material/components/Unit.hpp +++ b/opm/material/components/Unit.hpp @@ -84,7 +84,7 @@ public: * \copydoc Component::vaporPressure */ template - static Evaluation vaporPressure(const Evaluation& T) + static Evaluation vaporPressure(const Evaluation& /* temperature */) { return 1.0; } /*! @@ -109,28 +109,28 @@ public: * \copydoc Component::liquidDensity */ template - static Evaluation liquidDensity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation liquidDensity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { return 1.0; } /*! * \copydoc Component::liquidViscosity */ template - static Evaluation liquidViscosity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation liquidViscosity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { return 1.0; } /*! * \copydoc Component::gasDensity */ template - static Evaluation gasDensity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation gasDensity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { return 1.0; } /*! * \copydoc Component::gasViscosity */ template - static Evaluation gasViscosity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation gasViscosity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { return 1.0; } @@ -138,56 +138,56 @@ public: * \copydoc Component::gasEnthalpy */ template - static Evaluation gasEnthalpy(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation gasEnthalpy(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { return 1.0; } /*! * \copydoc Component::liquidEnthalpy */ template - static Evaluation liquidEnthalpy(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation liquidEnthalpy(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { return 1.0; } /*! * \copydoc Component::gasInternalEnergy */ template - static Evaluation gasInternalEnergy(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation gasInternalEnergy(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { return 1.0; } /*! * \copydoc Component::liquidInternalEnergy */ template - static Evaluation liquidInternalEnergy(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation liquidInternalEnergy(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { return 1.0; } /*! * \copydoc Component::gasThermalConductivity */ template - static Evaluation gasThermalConductivity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation gasThermalConductivity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { return 1.0; } /*! * \copydoc Component::liquidThermalConductivity */ template - static Evaluation liquidThermalConductivity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation liquidThermalConductivity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { return 1.0; } /*! * \copydoc Component::gasHeatCapacity */ template - static Evaluation gasHeatCapacity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation gasHeatCapacity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { return 1.0; } /*! * \copydoc Component::liquidHeatCapacity */ template - static Evaluation liquidHeatCapacity(const Evaluation& temperature, const Evaluation& pressure) + static Evaluation liquidHeatCapacity(const Evaluation& /* temperature */, const Evaluation& /* pressure */) { return 1.0; } }; diff --git a/tests/test_2dtables.cpp b/tests/test_2dtables.cpp index bb2804e80..93bd582aa 100644 --- a/tests/test_2dtables.cpp +++ b/tests/test_2dtables.cpp @@ -36,10 +36,10 @@ typedef double Scalar; -Scalar testFn1(Scalar x, Scalar y) +Scalar testFn1(Scalar x, Scalar /* y */) { return x; } -Scalar testFn2(Scalar x, Scalar y) +Scalar testFn2(Scalar /* x */, Scalar y) { return y; } Scalar testFn3(Scalar x, Scalar y)