diff --git a/src/script/C4PropList.h b/src/script/C4PropList.h index 986a12c33..020811fd0 100644 --- a/src/script/C4PropList.h +++ b/src/script/C4PropList.h @@ -54,8 +54,6 @@ public: C4String * Key{nullptr}; C4Value Value; operator const void * () const { return Key; } - C4Property & operator = (void * p) - { assert(!p); if (Key) Key->DecRef(); Key = nullptr; Value.Set0(); return *this; } bool operator < (const C4Property &cmp) const { return strcmp(GetSafeKey(), cmp.GetSafeKey())<0; } const char *GetSafeKey() const { if (Key && Key->GetCStr()) return Key->GetCStr(); return ""; } // get key as C string; return "" if undefined. never return nullptr }; diff --git a/src/script/C4StringTable.h b/src/script/C4StringTable.h index 4d66db393..602b18412 100644 --- a/src/script/C4StringTable.h +++ b/src/script/C4StringTable.h @@ -2,7 +2,7 @@ * OpenClonk, http://www.openclonk.org * * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/ - * Copyright (c) 2009-2016, The OpenClonk Team and contributors + * Copyright (c) 2009-2019, The OpenClonk Team and contributors * * Distributed under the terms of the ISC license; see accompanying file * "COPYING" for details. @@ -145,7 +145,7 @@ template class C4Set void ClearTable() { for (unsigned int i = 0; i < Capacity; ++i) - Table[i] = nullptr; + Table[i] = T{}; } void MaintainCapacity() { @@ -240,13 +240,13 @@ public: r = &Table[++h % Capacity]; } assert(*r); - *r = nullptr; + *r = T{}; --Size; // Move entries which might have collided with e while (*(r = &Table[++h % Capacity])) { T m = *r; - *r = nullptr; + *r = T{}; AddInternal(std::move(m)); } }