mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
refs #800 Replaced some C-style casts.
This commit is contained in:
committed by
Klaus Basan
parent
1f54bbc0d5
commit
ced70c4612
@@ -35,7 +35,7 @@ namespace BlackMisc
|
||||
double CMathUtils::cubicRootReal(double x)
|
||||
{
|
||||
double result;
|
||||
result = std::pow(qAbs(x), (double)1.0 / 3.0);
|
||||
result = std::pow(qAbs(x), 1.0 / 3.0);
|
||||
return x < 0 ? -result : result;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace BlackMisc
|
||||
if (fractpart == 0) return value; // do not mess any "integers" to the worse
|
||||
double m = pow(10.0, digits);
|
||||
qint64 ri = qRound64(value * m); // do not loose any range here
|
||||
double rv = double(ri) / m;
|
||||
double rv = static_cast<double>(ri) / m;
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace BlackMisc
|
||||
fractpart = modf(value, &intpart);
|
||||
if (fractpart == 0) return value; // do not mess any "integers" to the worse
|
||||
qint64 ri = qRound(value / epsilon);
|
||||
double rv = double(ri) * epsilon; // do not loose any range here
|
||||
double rv = static_cast<double>(ri) * epsilon; // do not loose any range here
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
@@ -204,10 +204,11 @@ namespace BlackWxPlugin
|
||||
// Search next grib field
|
||||
g2int lskip = 0;
|
||||
g2int lgrib = 0;
|
||||
findNextGribMessage((unsigned char*)gribData.data(), gribData.size(), iseek, &lskip, &lgrib);
|
||||
auto constData = reinterpret_cast<unsigned char*>(const_cast<char*>(gribData.data()));
|
||||
findNextGribMessage(constData, gribData.size(), iseek, &lskip, &lgrib);
|
||||
if (lgrib == 0) { break; }
|
||||
|
||||
unsigned char *readPtr = (unsigned char*)gribData.data() + lskip;
|
||||
unsigned char *readPtr = constData + lskip;
|
||||
iseek=lskip + lgrib;
|
||||
|
||||
g2int sec0[3];
|
||||
|
||||
Reference in New Issue
Block a user