diff --git a/src/blackmisc/math/mathutils.cpp b/src/blackmisc/math/mathutils.cpp index 8f2e165f5..c1e01acc6 100644 --- a/src/blackmisc/math/mathutils.cpp +++ b/src/blackmisc/math/mathutils.cpp @@ -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(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(ri) * epsilon; // do not loose any range here return rv; } diff --git a/src/plugins/weatherdata/gfs/weatherdatagfs.cpp b/src/plugins/weatherdata/gfs/weatherdatagfs.cpp index 5a1fa7f3c..e794dc867 100644 --- a/src/plugins/weatherdata/gfs/weatherdatagfs.cpp +++ b/src/plugins/weatherdata/gfs/weatherdatagfs.cpp @@ -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(const_cast(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];