From 46a8b3052f2a1f337738d2d1fca2b8a5a2af7ca8 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 26 Dec 2012 23:56:07 +0000 Subject: [PATCH] Use size_t instead of int in InterfaceKinetics --- include/cantera/kinetics/InterfaceKinetics.h | 6 +++--- src/kinetics/InterfaceKinetics.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/cantera/kinetics/InterfaceKinetics.h b/include/cantera/kinetics/InterfaceKinetics.h index fe51c45c4..331514ca5 100644 --- a/include/cantera/kinetics/InterfaceKinetics.h +++ b/include/cantera/kinetics/InterfaceKinetics.h @@ -573,7 +573,7 @@ public: * @param iphase Index of the phase. This is the order within the internal thermo vector object * @param isStable Flag indicating whether the phase is stable or not */ - void setPhaseStability(const int iphase, const int isStable); + void setPhaseStability(const size_t iphase, const int isStable); //! Gets the phase existence int for the ith phase /*! @@ -582,7 +582,7 @@ public: * @return Returns the int specifying whether the kinetics object thinks the phase exists * or not. If it exists, then species in that phase can be a reactant in reactions. */ - int phaseExistence(const int iphase) const; + int phaseExistence(const size_t iphase) const; //! Gets the phase stability int for the ith phase /*! @@ -593,7 +593,7 @@ public: * If it stable, then the kinetics object will allow for rates of production of * of species in that phase that are positive. */ - int phaseStability(const int iphase) const; + int phaseStability(const size_t iphase) const; protected: diff --git a/src/kinetics/InterfaceKinetics.cpp b/src/kinetics/InterfaceKinetics.cpp index 1fdc0394f..cc49853c0 100644 --- a/src/kinetics/InterfaceKinetics.cpp +++ b/src/kinetics/InterfaceKinetics.cpp @@ -1371,9 +1371,9 @@ void InterfaceKinetics::setPhaseExistence(const size_t iphase, const int exists) * @return Returns the int specifying whether the kinetics object thinks the phase exists * or not. If it exists, then species in that phase can be a reactant in reactions. */ -int InterfaceKinetics::phaseExistence(const int iphase) const +int InterfaceKinetics::phaseExistence(const size_t iphase) const { - if (iphase < 0 || iphase >= (int) m_thermo.size()) { + if (iphase >= m_thermo.size()) { throw CanteraError("InterfaceKinetics:phaseExistence()", "out of bounds"); } return m_phaseExists[iphase]; @@ -1388,18 +1388,18 @@ int InterfaceKinetics::phaseExistence(const int iphase) const * If it stable, then the kinetics object will allow for rates of production of * of species in that phase that are positive. */ -int InterfaceKinetics::phaseStability(const int iphase) const +int InterfaceKinetics::phaseStability(const size_t iphase) const { - if (iphase < 0 || iphase >= (int) m_thermo.size()) { + if (iphase >= m_thermo.size()) { throw CanteraError("InterfaceKinetics:phaseStability()", "out of bounds"); } return m_phaseIsStable[iphase]; } //================================================================================================ -void InterfaceKinetics::setPhaseStability(const int iphase, const int isStable) +void InterfaceKinetics::setPhaseStability(const size_t iphase, const int isStable) { - if (iphase < 0 || iphase >= (int) m_thermo.size()) { + if (iphase >= m_thermo.size()) { throw CanteraError("InterfaceKinetics:setPhaseStability", "out of bounds"); } if (isStable) {