Skip to content

Commit

Permalink
Fixed Minor MSVC Compiler Warnings (#1041)
Browse files Browse the repository at this point in the history
* Fixed Minor Warnings from MSVC

Minor type mis-matches, etc.

* Replace int(...) with static_cast<int>(...)
  • Loading branch information
henningjp authored and ibell committed May 1, 2016
1 parent 4fe950a commit 2c45ba5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Backends/Helmholtz/PhaseEnvelopeRoutines.cpp
Expand Up @@ -453,8 +453,8 @@ double PhaseEnvelopeRoutines::evaluate(const PhaseEnvelopeData &env, parameters
case iSmolar: x = &(env.smolar_vap); break;
default: throw ValueError("Pointer to vector x is unset in is_inside");
}
if ( _i + 2 >= y->size() ){ _i--; }
if ( _i + 1 >= y->size() ){ _i--; }
if ( _i + 2 >= static_cast<int>(y->size()) ){ _i--; }
if ( _i + 1 >= static_cast<int>(y->size()) ){ _i--; }
if ( _i - 1 < 0 ){ _i++; }

double outval = CubicInterp(*x, *y, _i - 1, _i, _i + 1, _i + 2, inval);
Expand Down
4 changes: 2 additions & 2 deletions src/Backends/Helmholtz/VLERoutines.h
Expand Up @@ -216,7 +216,7 @@ namespace SaturationSolvers
if (input_type == imposed_T && (std::abs(beta) < 1e-12 || std::abs(beta-1) < 1e-12)){
const std::vector<double> z = HEOS.get_mole_fractions_ref();
bool beta0 = std::abs(beta) < 1e-12; // True is beta is approx. zero
for (int i = 0; i < z.size(); ++i)
for (int i = 0; i < static_cast<int>(z.size()); ++i)
{
double pci = HEOS.get_fluid_constant(i,iP_critical);
double Tci = HEOS.get_fluid_constant(i,iT_critical);
Expand All @@ -232,7 +232,7 @@ namespace SaturationSolvers
out = 1/out; // summation is for 1/p, take reciprocal to get p
}
std::vector<CoolPropDbl> &K = HEOS.get_K();
for (int i = 0; i < z.size(); ++i)
for (int i = 0; i < static_cast<int>(z.size()); ++i)
{
double pci = HEOS.get_fluid_constant(i,iP_critical);
double Tci = HEOS.get_fluid_constant(i,iT_critical);
Expand Down
2 changes: 1 addition & 1 deletion src/Backends/REFPROP/REFPROPMixtureBackend.cpp
Expand Up @@ -366,7 +366,7 @@ void REFPROPMixtureBackend::set_REFPROP_fluids(const std::vector<std::string> &f
if (strlen(_components_joined) > 10000) { throw ValueError(format("components_joined (%s) is too long", _components_joined)); }
strcpy(component_string, _components_joined);
// Pad the fluid string all the way to 10k characters with spaces to deal with string parsing bug in REFPROP in SETUPdll
for (int i = components_joined.size(); i < 10000; ++i){
for (int i = static_cast<int>(components_joined.size()); i < 10000; ++i){
component_string[i] = ' ';
}

Expand Down

0 comments on commit 2c45ba5

Please sign in to comment.