HPL1: Further Fix For GCC Memset on Non-Trivial Structure Compiler Warning

This commit is contained in:
D G Turner 2022-10-18 20:51:15 +01:00 committed by Eugene Sandulenko
parent 0fdd6cb20a
commit 6442dc1c23
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
2 changed files with 18 additions and 1 deletions

View File

@ -302,7 +302,7 @@ dgFloat32 NewtonUserJoint::GetRowForce(dgInt32 row) const
void NewtonUserJoint::GetInfo(dgConstraintInfo* const info) const
{
memset(info, 0, sizeof(dgConstraintInfo));
info->clear();
if (m_getInfoCallback)
{
InitInfo(info);

View File

@ -22,6 +22,8 @@
#if !defined(AFX_DGCONSTRAINT_H__F9EC24E0_6E0F_4CD5_909E_A5F5E1AC7C0B__INCLUDED_)
#define AFX_DGCONSTRAINT_H__F9EC24E0_6E0F_4CD5_909E_A5F5E1AC7C0B__INCLUDED_
#define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))
#include "dgBodyMasterList.h"
#define DG_MAX_BOUND dgFloat32 (1.0e15f)
@ -58,6 +60,21 @@ class dgConstraintInfo
dgFloat32 m_extraParameters[16];
dgInt32 m_collideCollisionOn;
char m_discriptionType[16];
void clear()
{
m_attachMatrix_0 = dgGetZeroMatrix();
m_attachMatrix_1 = dgGetZeroMatrix();
for (uint i = 0; i < ARRAYSIZE(m_minLinearDof); i++) m_minLinearDof[i] = dgFloat32(0.0);
for (uint i = 0; i < ARRAYSIZE(m_maxLinearDof); i++) m_maxLinearDof[i] = dgFloat32(0.0);
for (uint i = 0; i < ARRAYSIZE(m_minAngularDof); i++) m_minAngularDof[i] = dgFloat32(0.0);
for (uint i = 0; i < ARRAYSIZE(m_maxAngularDof); i++) m_maxAngularDof[i] = dgFloat32(0.0);
m_attachBody_0 = nullptr;
m_attachBody_1 = nullptr;
for (uint i = 0; i < ARRAYSIZE(m_extraParameters); i++) m_extraParameters[i] = dgFloat32(0.0);
m_collideCollisionOn = dgInt32(0);
for (uint i = 0; i < ARRAYSIZE(m_discriptionType); i++) m_discriptionType[i] = 0;
}
};