From cc89104de081d2a073858cad6fa64bbb22aeb019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 27 Jul 2023 14:50:13 +0300 Subject: [PATCH] Remove some macros from common.h --- src/openrct2/common.h | 20 -------------------- src/openrct2/scenario/ScenarioRepository.cpp | 2 +- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/openrct2/common.h b/src/openrct2/common.h index 962fd38370..74a5eccd37 100644 --- a/src/openrct2/common.h +++ b/src/openrct2/common.h @@ -121,26 +121,6 @@ constexpr int32_t operator"" _mph(long double speedMph) using StringId = uint16_t; -#define SafeFree(x) \ - do \ - { \ - free(x); \ - (x) = nullptr; \ - } while (false) - -#define SafeDelete(x) \ - do \ - { \ - delete (x); \ - (x) = nullptr; \ - } while (false) -#define SafeDeleteArray(x) \ - do \ - { \ - delete[](x); \ - (x) = nullptr; \ - } while (false) - #define abstract = 0 #if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index 1c2934c51b..88be26c914 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -117,7 +117,7 @@ static int32_t ScenarioIndexEntryCompareByIndex(const ScenarioIndexEntry& entryA static void ScenarioHighscoreFree(ScenarioHighscoreEntry* highscore) { - SafeDelete(highscore); + delete highscore; } class ScenarioFileIndex final : public FileIndex