use c++ casts

quells static analyzer warnings
This commit is contained in:
Arne Morten Kvarving 2024-08-16 14:31:55 +02:00
parent d8ecc8be90
commit ba62b95b7d

View File

@ -726,10 +726,10 @@ IMPL_FUNC(void, loadMaterialsFromRocklist(const std::string& file,
if (Escale > 0) {
Emin=1e10;
for (size_t i=0;i<cache.size();++i)
Emin = std::min(Emin,((Isotropic*)cache[i].get())->getE());
Emin = std::min(Emin,static_cast<Isotropic*>(cache[i].get())->getE());
for (size_t i=0;i<cache.size();++i) {
double lE = ((Isotropic*)cache[i].get())->getE();
((Isotropic*)cache[i].get())->setE(lE*Escale/Emin);
double lE = static_cast<Isotropic*>(cache[i].get())->getE();
static_cast<Isotropic*>(cache[i].get())->setE(lE*Escale/Emin);
}
}
std::vector<double> volume;