[Scummvm-git-logs] scummvm master -> c02a7c6901fa4c29a308a856c2f6e7e4280ef039
digitall
noreply at scummvm.org
Tue Feb 21 02:58:49 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c02a7c6901 HPL1: Further Fix of Memset of Non-Trivial Structure GCC Compiler Warnings
Commit: c02a7c6901fa4c29a308a856c2f6e7e4280ef039
https://github.com/scummvm/scummvm/commit/c02a7c6901fa4c29a308a856c2f6e7e4280ef039
Author: D G Turner (digitall at scummvm.org)
Date: 2023-02-21T02:57:45Z
Commit Message:
HPL1: Further Fix of Memset of Non-Trivial Structure GCC Compiler Warnings
Changed paths:
engines/hpl1/engine/libraries/newton/physics/dgContact.cpp
engines/hpl1/engine/libraries/newton/physics/dgMeshEffect.cpp
engines/hpl1/engine/libraries/newton/physics/dgMeshEffect.h
engines/hpl1/engine/libraries/newton/physics/dgMeshEffect3.cpp
diff --git a/engines/hpl1/engine/libraries/newton/physics/dgContact.cpp b/engines/hpl1/engine/libraries/newton/physics/dgContact.cpp
index d63101bdec8..901684cb361 100644
--- a/engines/hpl1/engine/libraries/newton/physics/dgContact.cpp
+++ b/engines/hpl1/engine/libraries/newton/physics/dgContact.cpp
@@ -80,7 +80,7 @@ inline dgContact::~dgContact() {
}
void dgContact::GetInfo(dgConstraintInfo *const info) const {
- memset(info, 0, sizeof(dgConstraintInfo));
+ info->clear();
InitInfo(info);
info->m_collideCollisionOn = GetCount();
strncpy(info->m_discriptionType, "contact", 7);
diff --git a/engines/hpl1/engine/libraries/newton/physics/dgMeshEffect.cpp b/engines/hpl1/engine/libraries/newton/physics/dgMeshEffect.cpp
index 2620114372f..890b915c101 100644
--- a/engines/hpl1/engine/libraries/newton/physics/dgMeshEffect.cpp
+++ b/engines/hpl1/engine/libraries/newton/physics/dgMeshEffect.cpp
@@ -2649,7 +2649,7 @@ dgMeshEffect::dgVertexAtribute dgMeshEffect::InterpolateVertex(
const dgBigVector point(srcPoint);
dgVertexAtribute attribute;
- memset(&attribute, 0, sizeof(attribute));
+ attribute.clear();
dgFloat64 tol = dgFloat32(1.0e-4f);
for (dgInt32 i = 0; i < 4; i++) {
dgEdge *ptr = face;
diff --git a/engines/hpl1/engine/libraries/newton/physics/dgMeshEffect.h b/engines/hpl1/engine/libraries/newton/physics/dgMeshEffect.h
index 54170631be4..c810f7e1657 100644
--- a/engines/hpl1/engine/libraries/newton/physics/dgMeshEffect.h
+++ b/engines/hpl1/engine/libraries/newton/physics/dgMeshEffect.h
@@ -88,6 +88,18 @@ public:
dgFloat64 m_u1;
dgFloat64 m_v1;
dgFloat64 m_material;
+
+ void clear() {
+ m_vertex = dgBigVector(0.0f, 0.0f, 0.0f, 0.0f);
+ m_normal_x = 0.0f;
+ m_normal_y = 0.0f;
+ m_normal_z = 0.0f;
+ m_u0 = 0.0f;
+ m_v0 = 0.0f;
+ m_u1 = 0.0f;
+ m_v1 = 0.0f;
+ m_material = 0.0f;
+ }
};
class dgIndexArray {
diff --git a/engines/hpl1/engine/libraries/newton/physics/dgMeshEffect3.cpp b/engines/hpl1/engine/libraries/newton/physics/dgMeshEffect3.cpp
index ab19c58d7ec..1a048079064 100644
--- a/engines/hpl1/engine/libraries/newton/physics/dgMeshEffect3.cpp
+++ b/engines/hpl1/engine/libraries/newton/physics/dgMeshEffect3.cpp
@@ -551,7 +551,7 @@ dgMeshEffect::dgMeshEffect(const dgMeshEffect &source, dgFloat32 absoluteconcavi
dgFloat32 layer = dgFloat32(0.0f);
dgVertexAtribute polygon[256];
- memset(polygon, 0, sizeof(polygon));
+ for (uint i = 0; i < ARRAYSIZE(polygon); i++) polygon[i].clear();
dgArray<dgBigVector> convexVertexBuffer(1024, GetAllocator());
for (dgInt32 i = 0; i < faceCount; i++) {
dgClusterList &clusterList = clusters[i];
More information about the Scummvm-git-logs
mailing list