Base/App: fix warnings from code analysers:
* convert old-style-casts to explicit C++ casts where possible * make some implicit conversions explicit
This commit is contained in:
@@ -235,18 +235,18 @@ QString UnitsSchemaImperialBuilding::schemaTranslate(const Quantity &quant, doub
|
||||
minden = quant.getFormat().getDenominator();
|
||||
|
||||
// Compute and round the total number of fractional units
|
||||
ntot = (int)std::round(totalInches * (double)minden);
|
||||
ntot = static_cast<int>(std::round(totalInches * static_cast<double>(minden)));
|
||||
|
||||
// If this is zero, nothing to do but return
|
||||
if( ntot==0 )
|
||||
return QString::fromLatin1("0");
|
||||
|
||||
// Compute the whole number of feet and remaining units
|
||||
feet = (int)std::floor(ntot / (12*minden));
|
||||
feet = static_cast<int>(std::floor(ntot / (12*minden)));
|
||||
ntot = ntot - 12*minden*feet;
|
||||
|
||||
// Compute the remaining number of whole inches
|
||||
inches = (int)std::floor(ntot/minden);
|
||||
inches = static_cast<int>(std::floor(ntot/minden));
|
||||
|
||||
// Lastly the fractional quantities
|
||||
num = ntot - inches*minden;
|
||||
@@ -387,9 +387,9 @@ QString UnitsSchemaImperialCivil::schemaTranslate(const Base::Quantity& quant, d
|
||||
// double wholeSeconds = std::floor(rawSeconds);
|
||||
// double remainSeconds = rawSeconds - wholeSeconds;
|
||||
|
||||
int outDeg = (int) wholeDegrees;
|
||||
int outMin = (int) wholeMinutes;
|
||||
int outSec = (int) std::round(rawSeconds);
|
||||
int outDeg = static_cast<int>(wholeDegrees);
|
||||
int outMin = static_cast<int>(wholeMinutes);
|
||||
int outSec = static_cast<int>(std::round(rawSeconds));
|
||||
|
||||
std::stringstream output;
|
||||
output << outDeg << degreeString.toUtf8().constData();
|
||||
|
||||
Reference in New Issue
Block a user