From f46b61a7404bb16624c15f205899ae16e3711cb1 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 26 Sep 2014 13:45:12 +0000 Subject: [PATCH] Make "string&" arguments "const string&" This way, these functions can accept constant strings, including string literals. --- include/cantera/thermo/SpeciesThermoFactory.h | 4 ++-- src/thermo/SpeciesThermoFactory.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/cantera/thermo/SpeciesThermoFactory.h b/include/cantera/thermo/SpeciesThermoFactory.h index 3846f8fa5..80fb0e05d 100644 --- a/include/cantera/thermo/SpeciesThermoFactory.h +++ b/include/cantera/thermo/SpeciesThermoFactory.h @@ -108,7 +108,7 @@ public: * @return Returns the pointer to the newly malloced species * property manager for the reference state */ - SpeciesThermo* newSpeciesThermoManager(std::string& stype) const; + SpeciesThermo* newSpeciesThermoManager(const std::string& stype) const; //! Create a new species property manager for the reference //! state for a group of species @@ -216,7 +216,7 @@ SpeciesThermo* newSpeciesThermoMgr(int type, SpeciesThermoFactory* f=0); * @param f Pointer to a SpeciesThermoFactory. optional parameter. * Defaults to NULL. */ -SpeciesThermo* newSpeciesThermoMgr(std::string& stype, +SpeciesThermo* newSpeciesThermoMgr(const std::string& stype, SpeciesThermoFactory* f=0); //! Function to return SpeciesThermo manager diff --git a/src/thermo/SpeciesThermoFactory.cpp b/src/thermo/SpeciesThermoFactory.cpp index 15a289eba..5d685950a 100644 --- a/src/thermo/SpeciesThermoFactory.cpp +++ b/src/thermo/SpeciesThermoFactory.cpp @@ -160,7 +160,7 @@ SpeciesThermo* SpeciesThermoFactory::newSpeciesThermo(int type) const } } -SpeciesThermo* SpeciesThermoFactory::newSpeciesThermoManager(std::string& stype) const +SpeciesThermo* SpeciesThermoFactory::newSpeciesThermoManager(const std::string& stype) const { std::string ltype = lowercase(stype); if (ltype == "nasa") { @@ -775,7 +775,7 @@ SpeciesThermo* newSpeciesThermoMgr(int type, SpeciesThermoFactory* f) return f->newSpeciesThermo(type); } -SpeciesThermo* newSpeciesThermoMgr(std::string& stype, +SpeciesThermo* newSpeciesThermoMgr(const std::string& stype, SpeciesThermoFactory* f) { if (f == 0) {