static_cast to eliminate warnings from msvc.
This commit is contained in:
parent
b0cf0db1d3
commit
26b08c1892
2 changed files with 5 additions and 4 deletions
|
|
@ -926,7 +926,7 @@ extern "C" {
|
|||
bool stherm = (show_thermo != 0);
|
||||
string s = report(*th(nth), stherm);
|
||||
if (int(s.size()) > ibuf - 1) {
|
||||
return -(s.size() + 1);
|
||||
return -(static_cast<int>(s.size()) + 1);
|
||||
}
|
||||
copy(s.begin(), s.end(), buf);
|
||||
buf[s.size() - 1] = '\0';
|
||||
|
|
@ -940,7 +940,7 @@ extern "C" {
|
|||
string e;
|
||||
e = lastErrorMessage();
|
||||
if (buflen > 0) {
|
||||
int n = min(e.size(), buflen-1);
|
||||
int n = min(static_cast<int>(e.size()), buflen-1);
|
||||
copy(e.begin(), e.begin() + n, buf);
|
||||
buf[min(n, buflen-1)] = '\0';
|
||||
}
|
||||
|
|
@ -956,7 +956,7 @@ extern "C" {
|
|||
string s;
|
||||
writelog("function readlog is deprecated!");
|
||||
//getlog(s);
|
||||
int nlog = s.size();
|
||||
int nlog = static_cast<int>(s.size());
|
||||
if (n < 0) return nlog;
|
||||
int nn = min(n-1, nlog);
|
||||
copy(s.begin(), s.begin() + nn,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#pragma warning(disable:4800)
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -109,7 +110,7 @@ extern "C" {
|
|||
int lout = min(sz, nm.size());
|
||||
copy(nm.c_str(), nm.c_str() + lout, buf);
|
||||
buf[lout] = '\0';
|
||||
return nm.size();
|
||||
return static_cast<int>(nm.size());
|
||||
}
|
||||
catch (CanteraError) { return -1; }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue