Fixed memsetting non-trivially-copyable types

Types stl_stats, stl_normal and SurfaceFillParams should not be zeroed by memset
This is not correct and also triggered warnings on gcc
This commit is contained in:
Lukas Matena 2019-09-24 17:09:07 +02:00
parent 7861fa5086
commit b67d8c1614
4 changed files with 43 additions and 43 deletions

View file

@ -246,7 +246,7 @@ static void extract_model_from_archive(
sscanf(normal_buf[2], "%f", &facet.normal(2)) != 1) {
// Normal was mangled. Maybe denormals or "not a number" were stored?
// Just reset the normal and silently ignore it.
memset(&facet.normal, 0, sizeof(facet.normal));
facet.normal = stl_normal::Zero();
}
facets.emplace_back(facet);
}