static_cast to eliminate VC++ warnings.

This commit is contained in:
Harry Moffat 2004-07-02 15:26:01 +00:00
parent 4b5fc228a2
commit abb33063d2
3 changed files with 13 additions and 13 deletions

View file

@ -69,7 +69,7 @@ namespace Cantera {
}
MultiNewton::~MultiNewton() {
int n = m_workarrays.size();
int n = static_cast<int>(m_workarrays.size());
int i;
for (i = 0; i < n; i++) {
delete[] m_workarrays[i];
@ -81,7 +81,7 @@ namespace Cantera {
*/
void MultiNewton::resize(int sz) {
m_n = sz;
int n = m_workarrays.size();
int n = static_cast<int>(m_workarrays.size());
int i;
for (i = 0; i < n; i++) {
delete[] m_workarrays[i];

View file

@ -55,8 +55,8 @@ namespace Cantera {
* @param value the value.
*/
void Sim1D::setValue(int dom, int comp, int localPoint, doublereal value) {
int iloc = domain(dom).loc() + domain(dom).index(comp, localPoint);
m_x[iloc] = value;
size_t iloc = domain(dom).loc() + domain(dom).index(comp, localPoint);
m_x[static_cast<int>(iloc)] = value;
}
@ -67,13 +67,13 @@ namespace Cantera {
* the leftmost grid point in the domain.
*/
doublereal Sim1D::value(int dom, int comp, int localPoint) const {
int iloc = domain(dom).loc() + domain(dom).index(comp, localPoint);
return m_x[iloc];
size_t iloc = domain(dom).loc() + domain(dom).index(comp, localPoint);
return m_x[static_cast<int>(iloc)];
}
doublereal Sim1D::workValue(int dom, int comp, int localPoint) const {
int iloc = domain(dom).loc() + domain(dom).index(comp, localPoint);
return m_xnew[iloc];
size_t iloc = domain(dom).loc() + domain(dom).index(comp, localPoint);
return m_xnew[static_cast<int>(iloc)];
}

View file

@ -22,7 +22,7 @@
#include "StFlow.h"
#include "../ArrayViewer.h"
#include "ctml.h"
#include "../ctml.h"
#include "MultiJac.h"
using namespace ctml;
@ -758,7 +758,7 @@ namespace Cantera {
vector<XML_Node*> str;
dom.getChildren("string",str);
int nstr = str.size();
int nstr = static_cast<int>(str.size());
for (int istr = 0; istr < nstr; istr++) {
const XML_Node& nd = *str[istr];
writelog(nd["title"]+": "+nd.value()+"\n");
@ -772,7 +772,7 @@ namespace Cantera {
vector<XML_Node*> d;
dom.child("grid_data").getChildren("floatArray",d);
int nd = d.size();
int nd = static_cast<int>(d.size());
vector_fp x;
int n, np = 0, j, ks, k;
@ -866,7 +866,7 @@ namespace Cantera {
if (ignored.size() != 0) {
writelog("\n\n");
writelog("Ignoring datasets:\n");
int nn = ignored.size();
int nn = static_cast<int>(ignored.size());
for (int n = 0; n < nn; n++) {
writelog(ignored[n]+" ");
}
@ -905,7 +905,7 @@ namespace Cantera {
addFloat(flow, "pressure", m_press, "Pa", "pressure");
addFloatArray(gv,"z",m_z.size(),m_z.begin(),
"m","length");
vector_fp x(soln.nColumns());
vector_fp x(static_cast<ctvector_fp::size_t>(soln.nColumns()));
soln.getRow(0,x.begin());
addFloatArray(gv,"u",x.size(),x.begin(),"m/s","velocity");