Use of deprecated functions generates compiler warnings

This commit is contained in:
Ray Speth 2012-02-27 18:11:39 +00:00
parent f1e807d314
commit 3648bfef39
8 changed files with 21 additions and 20 deletions

View file

@ -26,6 +26,16 @@
#include <string> #include <string>
#include <algorithm> #include <algorithm>
// Warn about deprecated functions at compile time
#ifdef __GNUC__
#define DEPRECATED(func) func __attribute__ ((deprecated))
#elif defined(_MSC_VER)
#define DEPRECATED(func) __declspec(deprecated) func
#else
#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
#define DEPRECATED(func) func
#endif
/** /**
* Namespace for the Cantera kernel. * Namespace for the Cantera kernel.
*/ */

View file

@ -551,7 +551,7 @@ public:
* ThermoPhase objects. * ThermoPhase objects.
* switch to uploadMoleFractionsFromPhases(); * switch to uploadMoleFractionsFromPhases();
*/ */
void updateMoleFractions(); DEPRECATED(void updateMoleFractions());
//! Update the locally-stored composition within this object //! Update the locally-stored composition within this object
//! to match the current compositions of the phase objects. //! to match the current compositions of the phase objects.

View file

@ -144,10 +144,6 @@ public:
/// Default constructor. /// Default constructor.
Kinetics(); Kinetics();
/// This constructor initializes with a starting phase.
/// @deprecated
// Kinetics(thermo_t* thermo);
/// Destructor. /// Destructor.
virtual ~Kinetics(); virtual ~Kinetics();
@ -302,7 +298,7 @@ public:
* *
* @param n Index of the ThermoPhase being sought. * @param n Index of the ThermoPhase being sought.
*/ */
thermo_t& phase(size_t n=0) { DEPRECATED(thermo_t& phase(size_t n=0)) {
deprecatedMethod("Kinetics","phase","thermo"); deprecatedMethod("Kinetics","phase","thermo");
return *m_thermo[n]; return *m_thermo[n];
} }
@ -314,7 +310,7 @@ public:
* *
* @param n Index of the ThermoPhase being sought. * @param n Index of the ThermoPhase being sought.
*/ */
const thermo_t& phase(size_t n=0) const { DEPRECATED(const thermo_t& phase(size_t n=0) const) {
deprecatedMethod("Kinetics","phase","thermo"); deprecatedMethod("Kinetics","phase","thermo");
return *m_thermo[n]; return *m_thermo[n];
} }
@ -1061,7 +1057,6 @@ protected:
*/ */
size_t m_surfphase; size_t m_surfphase;
//! Phase Index where reactions are assumed to be taking place //! Phase Index where reactions are assumed to be taking place
/*! /*!
* We calculate this by assuming that the phase with the lowest dimensionality is the phase where reactions * We calculate this by assuming that the phase with the lowest dimensionality is the phase where reactions

View file

@ -2143,7 +2143,7 @@ public:
* @deprecated * @deprecated
* The getPartialMolarVolumes() expression is more precise. * The getPartialMolarVolumes() expression is more precise.
*/ */
double speciesMolarVolume(int k) const; DEPRECATED(double speciesMolarVolume(int k) const);
//! Value of the Debye Huckel constant as a function of temperature //! Value of the Debye Huckel constant as a function of temperature

View file

@ -470,7 +470,7 @@ public:
* *
* @deprecated * @deprecated
*/ */
void getMolecularWeights(int iwt, doublereal* weights) const; DEPRECATED(void getMolecularWeights(int iwt, doublereal* weights) const);
/** /**
* Copy the vector of molecular weights into array weights. * Copy the vector of molecular weights into array weights.

View file

@ -371,7 +371,7 @@ class SpeciesThermo1 : public SpeciesThermo
public: public:
//! base constructor //! base constructor
SpeciesThermo1(); DEPRECATED(SpeciesThermo1());
//! destructor //! destructor
virtual ~SpeciesThermo1(); virtual ~SpeciesThermo1();

View file

@ -249,23 +249,19 @@ public:
//! Returns an integer index number. //! Returns an integer index number.
/*! /*!
* This is for internal use * @internal This is for internal use
* of Cantera, and may be removed in the future. * of Cantera, and may be removed in the future.
* *
* @return Returns the index number * @return Returns the index number
*
* @deprecated
*/ */
size_t index() const ; size_t index() const;
//! Set an integer index number. //! Set an integer index number.
/*! /*!
* This is for internal use of * @internal This is for internal use of
* Cantera, and may be removed in the future. * Cantera, and may be removed in the future.
* *
* @param i index value * @param i index value
*
* @deprecated
*/ */
void setIndex(size_t i); void setIndex(size_t i);
@ -353,7 +349,7 @@ public:
* *
* @deprecated This doesn't seem to be the essential input; it should just be the mobility. * @deprecated This doesn't seem to be the essential input; it should just be the mobility.
*/ */
virtual void mobilityRatio(double* mobRat) { DEPRECATED(virtual void mobilityRatio(double* mobRat)) {
err("mobilityRatio"); err("mobilityRatio");
} }

View file

@ -248,7 +248,7 @@ void MultiPhase::init()
/// mole fractions stored in the phase objects /// mole fractions stored in the phase objects
m_init = true; m_init = true;
updateMoleFractions(); uploadMoleFractionsFromPhases();
updatePhases(); updatePhases();
} }