diff --git a/src/clib/Cabinet.h b/src/clib/Cabinet.h index c75db311f..72bbc920a 100644 --- a/src/clib/Cabinet.h +++ b/src/clib/Cabinet.h @@ -134,7 +134,7 @@ public: * to it in the list is replaced by a pointer to the first element * in the list. */ - static void del(int n) { + static void del(size_t n) { dataRef data = getData(); if (n == 0) { return; diff --git a/src/kinetics/importKinetics.cpp b/src/kinetics/importKinetics.cpp index f6bb14f78..e748a3145 100644 --- a/src/kinetics/importKinetics.cpp +++ b/src/kinetics/importKinetics.cpp @@ -756,11 +756,11 @@ bool rxninfo::installReaction(int iRxn, const XML_Node& r, Kinetics& kin, unsigned long int participants = 0; for (size_t nn = 0; nn < rdata.reactants.size(); nn++) { rdata.net_stoich[-1 - int(rdata.reactants[nn])] -= rdata.rstoich[nn]; - participants += rdata.reactants[nn]; + participants += static_cast(rdata.reactants[nn]); } for (size_t nn = 0; nn < rdata.products.size(); nn++) { rdata.net_stoich[int(rdata.products[nn])+1] += rdata.pstoich[nn]; - participants += 1000000 * rdata.products[nn]; + participants += 1000000 * static_cast(rdata.products[nn]); } vector& related = m_participants[participants]; diff --git a/src/thermo/NasaThermo.cpp b/src/thermo/NasaThermo.cpp index 5a3d3e720..fffdacd2a 100644 --- a/src/thermo/NasaThermo.cpp +++ b/src/thermo/NasaThermo.cpp @@ -430,7 +430,7 @@ void NasaThermo::fixDiscontinuities(doublereal Tlow, doublereal Tmid, // First get the desired size of the work array ct_dgelss(nRows, nCols, 1, &M(0,0), nRows, &b[0], nRows, &sigma[0], -1, rank, &work[0], lwork, info); - work.resize(work[0]); + work.resize(static_cast(work[0])); lwork = static_cast(work[0]); ct_dgelss(nRows, nCols, 1, &M(0,0), nRows, &b[0], nRows, &sigma[0], -1, rank, &work[0], lwork, info); diff --git a/src/transport/SolidTransport.cpp b/src/transport/SolidTransport.cpp index 330a13c0c..4505a8890 100644 --- a/src/transport/SolidTransport.cpp +++ b/src/transport/SolidTransport.cpp @@ -142,9 +142,8 @@ doublereal SolidTransport::electricalConductivity() return m_electConductivity->getSpeciesTransProp(); } else { getMobilities(&m_work[0]); - int nsp = m_thermo->nSpecies(); doublereal sum = 0.0; - for (int k = 0; k < nsp; k++) { + for (size_t k = 0; k < m_thermo->nSpecies(); k++) { sum += m_thermo->charge(k) * m_thermo->moleFraction(k) * m_work[k]; } return sum * m_thermo->molarDensity(); diff --git a/src/transport/TransportBase.cpp b/src/transport/TransportBase.cpp index e616aea0e..5660d1c39 100644 --- a/src/transport/TransportBase.cpp +++ b/src/transport/TransportBase.cpp @@ -94,14 +94,14 @@ void Transport::setThermo(thermo_t& thermo) m_thermo = &thermo; m_nsp = m_thermo->nSpecies(); } else { - int newNum = thermo.nSpecies(); - int oldNum = m_thermo->nSpecies(); + size_t newNum = thermo.nSpecies(); + size_t oldNum = m_thermo->nSpecies(); if (newNum != oldNum) { throw CanteraError("Transport::setThermo", "base object cannot be changed after " "the transport manager has been constructed because num species isn't the same."); } - for (int i = 0; i < newNum; i++) { + for (size_t i = 0; i < newNum; i++) { std::string newS0 = thermo.speciesName(i); std::string oldS0 = m_thermo->speciesName(i); if (newNum != oldNum) { diff --git a/src/transport/TransportFactory.cpp b/src/transport/TransportFactory.cpp index 107e5420b..b632a7f2b 100644 --- a/src/transport/TransportFactory.cpp +++ b/src/transport/TransportFactory.cpp @@ -64,7 +64,7 @@ public: * @param linenum inputs the line number * @param msg String message to be sent to the user */ - TransportDBError(int linenum, const std::string& msg) : + TransportDBError(size_t linenum, const std::string& msg) : CanteraError("getTransportData", "error reading transport data: " + msg + "\n") { } }; @@ -580,7 +580,7 @@ void TransportFactory::setupSolidTransport(std::ostream& flog, thermo_t* thermo, // constant mixture attributes trParam.thermo = thermo; trParam.nsp_ = trParam.thermo->nSpecies(); - int nsp = trParam.nsp_; + size_t nsp = trParam.nsp_; trParam.tmin = thermo->minTemp(); trParam.tmax = thermo->maxTemp(); @@ -1118,8 +1118,8 @@ void TransportFactory::getSolidTransportData(const XML_Node& transportNode, { try { - int num = transportNode.nChildren(); - for (int iChild = 0; iChild < num; iChild++) { + size_t num = transportNode.nChildren(); + for (size_t iChild = 0; iChild < num; iChild++) { //tranTypeNode is a type of transport property like viscosity XML_Node& tranTypeNode = transportNode.child(iChild); std::string nodeName = tranTypeNode.name();