Fix compiler error due to memset on type with non-trivial constructors

Fix #446
This commit is contained in:
Jakob Botsch Nielsen 2020-10-30 10:40:09 +01:00
parent e679507845
commit 8db2f62d7a
2 changed files with 6 additions and 4 deletions

View File

@ -34,6 +34,10 @@ class TestCase
{
Test() :
type(),
spos(),
epos(),
nspos(),
nepos(),
radius(0),
includeFlags(0),
excludeFlags(0),

View File

@ -154,8 +154,7 @@ bool TestCase::load(const std::string& filePath)
else if (row[0] == 'p' && row[1] == 'f')
{
// Pathfind test.
Test* test = new Test;
memset(test, 0, sizeof(Test));
Test* test = new Test();
test->type = TEST_PATHFIND;
test->expand = false;
test->next = m_tests;
@ -168,8 +167,7 @@ bool TestCase::load(const std::string& filePath)
else if (row[0] == 'r' && row[1] == 'c')
{
// Pathfind test.
Test* test = new Test;
memset(test, 0, sizeof(Test));
Test* test = new Test();
test->type = TEST_RAYCAST;
test->expand = false;
test->next = m_tests;