diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 06ff2ec076..594477890c 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -1692,7 +1692,6 @@ F76C838E1EC4E7CC00FA49E2 /* Nullable.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Nullable.hpp; sourceTree = ""; }; F76C838F1EC4E7CC00FA49E2 /* Path.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Path.cpp; sourceTree = ""; }; F76C83901EC4E7CC00FA49E2 /* Path.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Path.hpp; sourceTree = ""; }; - F76C83911EC4E7CC00FA49E2 /* Registration.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Registration.hpp; sourceTree = ""; }; F76C83921EC4E7CC00FA49E2 /* String.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = String.cpp; sourceTree = ""; }; F76C83931EC4E7CC00FA49E2 /* String.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = String.hpp; sourceTree = ""; }; F76C83941EC4E7CC00FA49E2 /* StringBuilder.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = StringBuilder.hpp; sourceTree = ""; }; @@ -2838,7 +2837,6 @@ F76C838F1EC4E7CC00FA49E2 /* Path.cpp */, F76C83901EC4E7CC00FA49E2 /* Path.hpp */, 2ADE2F21224418B1002598AF /* Random.hpp */, - F76C83911EC4E7CC00FA49E2 /* Registration.hpp */, F76C83921EC4E7CC00FA49E2 /* String.cpp */, F76C83931EC4E7CC00FA49E2 /* String.hpp */, F76C83941EC4E7CC00FA49E2 /* StringBuilder.hpp */, diff --git a/src/openrct2-ui/input/KeyboardShortcuts.h b/src/openrct2-ui/input/KeyboardShortcuts.h index b4a46cf66b..386bce0eef 100644 --- a/src/openrct2-ui/input/KeyboardShortcuts.h +++ b/src/openrct2-ui/input/KeyboardShortcuts.h @@ -167,6 +167,5 @@ void keyboard_shortcuts_format_string(char* buffer, size_t bufferSize, int32_t s void keyboard_shortcut_handle(int32_t key); void keyboard_shortcut_handle_command(OpenRCT2::Input::Shortcut shortcut); -void keyboard_shortcut_format_string(char* buffer, size_t size, uint16_t shortcutKey); ScreenCoordsXY get_keyboard_map_scroll(const uint8_t* keysState); diff --git a/src/openrct2/Context.h b/src/openrct2/Context.h index d575ef4b12..60730a8906 100644 --- a/src/openrct2/Context.h +++ b/src/openrct2/Context.h @@ -259,7 +259,6 @@ void context_force_close_window_by_class(rct_windowclass wc); void context_update_map_tooltip(); void context_handle_input(); void context_input_handle_keyboard(bool isTitle); -bool context_read_bmp(void** outPixels, uint32_t* outWidth, uint32_t* outHeight, const utf8* path); void context_quit(); const utf8* context_get_path_legacy(int32_t pathId); bool context_load_park_from_file(const utf8* path); diff --git a/src/openrct2/config/IniReader.cpp b/src/openrct2/config/IniReader.cpp index fd34c6f0c0..cfdab415c8 100644 --- a/src/openrct2/config/IniReader.cpp +++ b/src/openrct2/config/IniReader.cpp @@ -437,12 +437,12 @@ utf8* IIniReader::GetCString(const std::string& name, const utf8* defaultValue) return String::Duplicate(szValue.c_str()); } -IIniReader* CreateIniReader(OpenRCT2::IStream* stream) +std::unique_ptr CreateIniReader(OpenRCT2::IStream* stream) { - return new IniReader(stream); + return std::make_unique(stream); } -IIniReader* CreateDefaultIniReader() +std::unique_ptr CreateDefaultIniReader() { - return new DefaultIniReader(); + return std::make_unique(); } diff --git a/src/openrct2/config/IniReader.hpp b/src/openrct2/config/IniReader.hpp index 741c090525..23329091cf 100644 --- a/src/openrct2/config/IniReader.hpp +++ b/src/openrct2/config/IniReader.hpp @@ -11,6 +11,7 @@ #include "../common.h" +#include #include namespace OpenRCT2 @@ -47,5 +48,5 @@ struct IIniReader utf8* GetCString(const std::string& name, const utf8* defaultValue) const; }; -IIniReader* CreateIniReader(OpenRCT2::IStream* stream); -IIniReader* CreateDefaultIniReader(); +std::unique_ptr CreateIniReader(OpenRCT2::IStream* stream); +std::unique_ptr CreateDefaultIniReader(); diff --git a/src/openrct2/config/IniWriter.cpp b/src/openrct2/config/IniWriter.cpp index c649c2b947..d539c02160 100644 --- a/src/openrct2/config/IniWriter.cpp +++ b/src/openrct2/config/IniWriter.cpp @@ -103,7 +103,7 @@ void IIniWriter::WriteString(const std::string& name, const utf8* value) WriteString(name, String::ToStd(value)); } -IIniWriter* CreateIniWriter(OpenRCT2::IStream* stream) +std::unique_ptr CreateIniWriter(OpenRCT2::IStream* stream) { - return new IniWriter(stream); + return std::make_unique(stream); } diff --git a/src/openrct2/config/IniWriter.hpp b/src/openrct2/config/IniWriter.hpp index e87f111f51..ab5cd6f501 100644 --- a/src/openrct2/config/IniWriter.hpp +++ b/src/openrct2/config/IniWriter.hpp @@ -11,6 +11,7 @@ #include "../common.h" +#include #include namespace OpenRCT2 @@ -51,4 +52,4 @@ struct IIniWriter void WriteString(const std::string& name, const utf8* value); }; -IIniWriter* CreateIniWriter(OpenRCT2::IStream* stream); +std::unique_ptr CreateIniWriter(OpenRCT2::IStream* stream); diff --git a/src/openrct2/core/Registration.hpp b/src/openrct2/core/Registration.hpp deleted file mode 100644 index d43967db41..0000000000 --- a/src/openrct2/core/Registration.hpp +++ /dev/null @@ -1,58 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014-2020 OpenRCT2 developers - * - * For a complete list of all authors, please refer to contributors.md - * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 - * - * OpenRCT2 is licensed under the GNU General Public License version 3. - *****************************************************************************/ - -#pragma once - -#include "../common.h" - -namespace OpenRCT2 -{ - /** - * Represents a registration of some service which when deleted will be - * unregistered. - */ - struct IRegistration - { - virtual ~IRegistration() = default; - }; - - class Registration - { - private: - /** - * Class which can wrap a function in an IRegistration. - */ - template struct CallbackRegistration : public IRegistration - { - private: - T _callback; - - public: - CallbackRegistration(T callback) - : _callback(callback) - { - } - - virtual ~CallbackRegistration() override - { - _callback(); - } - }; - - public: - /** - * Creates a new IRegistration which when deleted, calls the given - * function. - */ - template static IRegistration* Create(T unregisterCallback) - { - return new CallbackRegistration(unregisterCallback); - } - }; -} // namespace OpenRCT2 diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index dd2b045f3a..4f4a15b34c 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -175,7 +175,6 @@ - @@ -771,4 +770,4 @@ - + \ No newline at end of file diff --git a/src/openrct2/management/NewsItem.h b/src/openrct2/management/NewsItem.h index ed034a5fbe..7fadc0e162 100644 --- a/src/openrct2/management/NewsItem.h +++ b/src/openrct2/management/NewsItem.h @@ -246,8 +246,6 @@ namespace News uint16_t IncrementTicks(); News::Item& Current(); const News::Item& Current() const; - News::Item& Oldest(); - const News::Item& Oldest() const; bool CurrentShouldBeArchived() const; void ArchiveCurrent(); News::Item* FirstOpenOrNewSlot(); @@ -278,7 +276,6 @@ namespace News private: int32_t RemoveTime() const; - void AppendToArchive(News::Item& item); News::ItemQueue Recent; News::ItemQueue Archived; diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 64f1cb6ea9..de6aa673b3 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -1046,8 +1046,6 @@ void peep_applause(); void peep_thought_set_format_args(const rct_peep_thought* thought, Formatter& ft); int32_t get_peep_face_sprite_small(Peep* peep); int32_t get_peep_face_sprite_large(Peep* peep); -void game_command_pickup_guest( - int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp); void peep_sprite_remove(Peep* peep); void peep_window_state_update(Peep* peep); @@ -1056,7 +1054,6 @@ void peep_decrement_num_riders(Peep* peep); void peep_set_map_tooltip(Peep* peep); int32_t peep_compare(const uint16_t sprite_index_a, const uint16_t sprite_index_b); -void SwitchToSpecialSprite(Peep* peep, uint8_t special_sprite_id); void peep_update_names(bool realNames); void guest_set_name(uint16_t spriteIndex, const char* name); diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 8b2e09f663..1ea8be85df 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -1036,7 +1036,6 @@ ride_id_t GetNextFreeRideId(); Ride* GetOrAllocateRide(ride_id_t index); rct_ride_entry* get_ride_entry(ObjectEntryIndex index); std::string_view get_ride_entry_name(ObjectEntryIndex index); -RideMeasurement* get_ride_measurement(int32_t index); extern money16 gTotalRideValueForMoney; @@ -1083,7 +1082,6 @@ extern bool gGotoStartPlacementMode; extern uint8_t gLastEntranceStyle; -ride_id_t ride_get_empty_slot(); int32_t ride_get_count(); void ride_init_all(); void reset_all_ride_build_dates(); diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index ca214a8b4c..3c0890c21d 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -452,15 +452,7 @@ bool scenario_create_ducks(); const random_engine_t::state_type& scenario_rand_state(); void scenario_rand_seed(random_engine_t::result_type s0, random_engine_t::result_type s1); -#ifdef DEBUG_DESYNC -uint32_t dbg_scenario_rand(const char* file, const char* function, const uint32_t line, const void* data); -# define scenario_rand() dbg_scenario_rand(__FILE__, __FUNCTION__, __LINE__, NULL) -# define scenario_rand_data(data) dbg_scenario_rand(__FILE__, __FUNCTION__, __LINE__, data) -void dbg_report_desync(uint32_t tick, uint32_t srand0, uint32_t server_srand0, const char* clientHash, const char* serverHash); -#else random_engine_t::result_type scenario_rand(); -#endif - uint32_t scenario_rand_max(uint32_t max); bool scenario_prepare_for_save(); diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 9d041503e1..6a033139cb 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -178,8 +178,6 @@ extern const CoordsXY BinUseOffsets[NumOrthogonalDirections]; extern const CoordsXY BenchUseOffsets[NumOrthogonalDirections * 2]; TileElement* map_get_footpath_element(const CoordsXYZ& coords); -struct PathElement; -PathElement* map_get_footpath_element_slope(const CoordsXYZ& footpathPos, int32_t slope); void footpath_interrupt_peeps(const CoordsXYZ& footpathPos); money32 footpath_remove(const CoordsXYZ& footpathLoc, int32_t flags); money32 footpath_provisional_set(int32_t type, const CoordsXYZ& footpathLoc, int32_t slope); diff --git a/src/openrct2/world/MapGen.h b/src/openrct2/world/MapGen.h index b0929ee74b..ed4d3a932f 100644 --- a/src/openrct2/world/MapGen.h +++ b/src/openrct2/world/MapGen.h @@ -38,7 +38,6 @@ struct mapgen_settings void mapgen_generate_blank(mapgen_settings* settings); void mapgen_generate(mapgen_settings* settings); -void mapgen_generate_custom_simplex(mapgen_settings* settings); bool mapgen_load_heightmap(const utf8* path); void mapgen_unload_heightmap(); void mapgen_generate_from_heightmap(mapgen_settings* settings); diff --git a/src/openrct2/world/Sprite.h b/src/openrct2/world/Sprite.h index 9240cc0a9b..416fdbf667 100644 --- a/src/openrct2/world/Sprite.h +++ b/src/openrct2/world/Sprite.h @@ -255,7 +255,6 @@ void balloon_update(Balloon* balloon); // Duck /////////////////////////////////////////////////////////////// void create_duck(const CoordsXY& pos); -void duck_update(Duck* duck); void duck_press(Duck* duck); void duck_remove_all(); @@ -263,9 +262,7 @@ void duck_remove_all(); // Crash particles /////////////////////////////////////////////////////////////// void crashed_vehicle_particle_create(rct_vehicle_colour colours, const CoordsXYZ& vehiclePos); -void crashed_vehicle_particle_update(VehicleCrashParticle* particle); void crash_splash_create(const CoordsXYZ& splashPos); -void crash_splash_update(CrashSplashParticle* splash); rct_sprite_checksum sprite_checksum(); diff --git a/test/tests/IniReaderTest.cpp b/test/tests/IniReaderTest.cpp index 0eebf9e50a..62eb5fd09d 100644 --- a/test/tests/IniReaderTest.cpp +++ b/test/tests/IniReaderTest.cpp @@ -32,7 +32,7 @@ TEST_F(IniReaderTest, create_empty) OpenRCT2::MemoryStream ms(0); ASSERT_EQ(ms.CanRead(), true); ASSERT_EQ(ms.CanWrite(), true); - IIniReader* ir = CreateIniReader(&ms); + auto ir = CreateIniReader(&ms); ASSERT_NE(ir, nullptr); ASSERT_EQ(ir->GetBoolean("nobody", true), true); ASSERT_EQ(ir->GetCString("expects", nullptr), nullptr); @@ -41,7 +41,6 @@ TEST_F(IniReaderTest, create_empty) ASSERT_EQ(ir->GetInt32("universal_answer", 42), 42); ASSERT_EQ( ir->GetInt64("heat_death_of_the_universe", std::numeric_limits::max()), std::numeric_limits::max()); - delete ir; } TEST_F(IniReaderTest, read_prepared) @@ -49,7 +48,7 @@ TEST_F(IniReaderTest, read_prepared) OpenRCT2::MemoryStream ms(predefined.c_str(), predefined.size()); ASSERT_EQ(ms.CanRead(), true); ASSERT_EQ(ms.CanWrite(), false); - IIniReader* ir = CreateIniReader(&ms); + auto ir = CreateIniReader(&ms); ASSERT_NE(ir, nullptr); ASSERT_EQ(ir->ReadSection("doesnt_exist"), false); ASSERT_EQ(ir->ReadSection("bool"), true); @@ -71,7 +70,6 @@ TEST_F(IniReaderTest, read_prepared) // go back a section ASSERT_EQ(ir->ReadSection("int"), true); ASSERT_EQ(ir->GetInt32("one", 42), 1); - delete ir; } TEST_F(IniReaderTest, read_duplicate) @@ -79,7 +77,7 @@ TEST_F(IniReaderTest, read_duplicate) OpenRCT2::MemoryStream ms(duplicate.c_str(), duplicate.size()); ASSERT_EQ(ms.CanRead(), true); ASSERT_EQ(ms.CanWrite(), false); - IIniReader* ir = CreateIniReader(&ms); + auto ir = CreateIniReader(&ms); ASSERT_NE(ir, nullptr); // there should only be data from the last section ASSERT_EQ(ir->ReadSection("section"), true); @@ -97,7 +95,6 @@ TEST_F(IniReaderTest, read_duplicate) ASSERT_EQ(ir->ReadSection("section"), true); // test 4 times, there are only 3 sections ASSERT_EQ(ir->ReadSection("section"), true); - delete ir; } TEST_F(IniReaderTest, read_untrimmed) @@ -105,7 +102,7 @@ TEST_F(IniReaderTest, read_untrimmed) OpenRCT2::MemoryStream ms(untrimmed.c_str(), untrimmed.size()); ASSERT_EQ(ms.CanRead(), true); ASSERT_EQ(ms.CanWrite(), false); - IIniReader* ir = CreateIniReader(&ms); + auto ir = CreateIniReader(&ms); ASSERT_NE(ir, nullptr); // there should only be data from the last section ASSERT_EQ(ir->ReadSection("section"), true); @@ -115,7 +112,6 @@ TEST_F(IniReaderTest, read_untrimmed) Memory::Free(str); ASSERT_EQ(ir->GetString("str", "yyy"), " xxx "); ASSERT_EQ(ir->GetString("nosuchthing", " yyy "), " yyy "); - delete ir; } TEST_F(IniReaderTest, read_case_insensitive) @@ -123,12 +119,11 @@ TEST_F(IniReaderTest, read_case_insensitive) OpenRCT2::MemoryStream ms(caseInsensitive.c_str(), caseInsensitive.size()); ASSERT_EQ(ms.CanRead(), true); ASSERT_EQ(ms.CanWrite(), false); - IIniReader* ir = CreateIniReader(&ms); + auto ir = CreateIniReader(&ms); ASSERT_NE(ir, nullptr); ASSERT_EQ(ir->ReadSection("section"), true); ASSERT_EQ(ir->GetString("foo", "yyy"), "bar"); ASSERT_EQ(ir->ReadSection("SeCtIoN"), true); - delete ir; } const std::string IniReaderTest::predefined = "[bool]\n" diff --git a/test/tests/IniWriterTest.cpp b/test/tests/IniWriterTest.cpp index 87e5b1a08b..a50988f9f2 100644 --- a/test/tests/IniWriterTest.cpp +++ b/test/tests/IniWriterTest.cpp @@ -29,15 +29,14 @@ TEST_F(IniWriterTest, create_empty) OpenRCT2::MemoryStream ms(0); ASSERT_EQ(ms.CanRead(), true); ASSERT_EQ(ms.CanWrite(), true); - IIniWriter* iw = CreateIniWriter(&ms); + auto iw = CreateIniWriter(&ms); ASSERT_NE(iw, nullptr); - delete iw; } TEST_F(IniWriterTest, create_one_section) { OpenRCT2::MemoryStream ms(1000); - IIniWriter* iw = CreateIniWriter(&ms); + auto iw = CreateIniWriter(&ms); ASSERT_NE(iw, nullptr); iw->WriteSection("OpenRCT2"); uint8_t null_terminator = 0; @@ -49,13 +48,12 @@ TEST_F(IniWriterTest, create_one_section) const char* ini = reinterpret_cast(ms.ReadString()); ASSERT_STREQ(ini, "[OpenRCT2]" PLATFORM_NEWLINE); Memory::Free(ini); - delete iw; } TEST_F(IniWriterTest, create_multiple_sections) { OpenRCT2::MemoryStream ms(1000); - IIniWriter* iw = CreateIniWriter(&ms); + auto iw = CreateIniWriter(&ms); ASSERT_NE(iw, nullptr); iw->WriteSection("OpenRCT1"); iw->WriteSection("OpenRCT2"); @@ -73,13 +71,12 @@ TEST_F(IniWriterTest, create_multiple_sections) "[OpenRCT1]" PLATFORM_NEWLINE PLATFORM_NEWLINE "[OpenRCT2]" PLATFORM_NEWLINE PLATFORM_NEWLINE "[OpenRCT3]" PLATFORM_NEWLINE PLATFORM_NEWLINE "[OpenRCT4]" PLATFORM_NEWLINE); Memory::Free(ini); - delete iw; } TEST_F(IniWriterTest, create_loose_bool_entry) { OpenRCT2::MemoryStream ms(1000); - IIniWriter* iw = CreateIniWriter(&ms); + auto iw = CreateIniWriter(&ms); ASSERT_NE(iw, nullptr); iw->WriteBoolean("boolval", true); uint8_t null_terminator = 0; @@ -91,13 +88,12 @@ TEST_F(IniWriterTest, create_loose_bool_entry) const char* ini = reinterpret_cast(ms.ReadString()); ASSERT_STREQ(ini, "boolval = true" PLATFORM_NEWLINE); Memory::Free(ini); - delete iw; } TEST_F(IniWriterTest, create_loose_enum_entry) { OpenRCT2::MemoryStream ms(1000); - IIniWriter* iw = CreateIniWriter(&ms); + auto iw = CreateIniWriter(&ms); ASSERT_NE(iw, nullptr); iw->WriteEnum("by_string", "stringval"); iw->WriteEnum("int32_t", 0, Enum_Currency); @@ -110,13 +106,12 @@ TEST_F(IniWriterTest, create_loose_enum_entry) const char* ini = reinterpret_cast(ms.ReadString()); ASSERT_STREQ(ini, "by_string = stringval" PLATFORM_NEWLINE "int32_t = 0" PLATFORM_NEWLINE); Memory::Free(ini); - delete iw; } TEST_F(IniWriterTest, create_loose_float_entry) { OpenRCT2::MemoryStream ms(1000); - IIniWriter* iw = CreateIniWriter(&ms); + auto iw = CreateIniWriter(&ms); ASSERT_NE(iw, nullptr); iw->WriteFloat("one", 1.); uint8_t null_terminator = 0; @@ -129,13 +124,12 @@ TEST_F(IniWriterTest, create_loose_float_entry) // This will be non-fatal due to float. EXPECT_STREQ(ini, "one = 1.000000" PLATFORM_NEWLINE); Memory::Free(ini); - delete iw; } TEST_F(IniWriterTest, create_loose_int32_t_entry) { OpenRCT2::MemoryStream ms(1000); - IIniWriter* iw = CreateIniWriter(&ms); + auto iw = CreateIniWriter(&ms); ASSERT_NE(iw, nullptr); iw->WriteInt32("one", 1); iw->WriteInt32("zero", 0); @@ -154,13 +148,12 @@ TEST_F(IniWriterTest, create_loose_int32_t_entry) "one = 1" PLATFORM_NEWLINE "zero = 0" PLATFORM_NEWLINE "minusone = -1" PLATFORM_NEWLINE "intmin = -2147483648" PLATFORM_NEWLINE "intmax = 2147483647" PLATFORM_NEWLINE); Memory::Free(ini); - delete iw; } TEST_F(IniWriterTest, create_loose_string_entry) { OpenRCT2::MemoryStream ms(1000); - IIniWriter* iw = CreateIniWriter(&ms); + auto iw = CreateIniWriter(&ms); ASSERT_NE(iw, nullptr); iw->WriteString("path", u8"C:'\\some/dir\\here/神鷹暢遊"); uint8_t null_terminator = 0; @@ -172,13 +165,12 @@ TEST_F(IniWriterTest, create_loose_string_entry) const char* ini = reinterpret_cast(ms.ReadString()); ASSERT_STREQ(ini, "path = \"C:'\\\\some/dir\\\\here/\xE7\xA5\x9E\xE9\xB7\xB9\xE6\x9A\xA2\xE9\x81\x8A\"" PLATFORM_NEWLINE); Memory::Free(ini); - delete iw; } TEST_F(IniWriterTest, create_multiple_section_with_values) { OpenRCT2::MemoryStream ms(1000); - IIniWriter* iw = CreateIniWriter(&ms); + auto iw = CreateIniWriter(&ms); ASSERT_NE(iw, nullptr); iw->WriteSection("bool"); iw->WriteBoolean("boolval", true); @@ -200,13 +192,12 @@ TEST_F(IniWriterTest, create_multiple_section_with_values) "one = 1" PLATFORM_NEWLINE "zero = 0" PLATFORM_NEWLINE PLATFORM_NEWLINE "[string]" PLATFORM_NEWLINE "path = " "\"C:'\\\\some/dir\\\\here/\xE7\xA5\x9E\xE9\xB7\xB9\xE6\x9A\xA2\xE9\x81\x8A\"" PLATFORM_NEWLINE); Memory::Free(ini); - delete iw; } TEST_F(IniWriterTest, create_duplicate_sections) { OpenRCT2::MemoryStream ms(1000); - IIniWriter* iw = CreateIniWriter(&ms); + auto iw = CreateIniWriter(&ms); ASSERT_NE(iw, nullptr); iw->WriteSection("section"); iw->WriteSection("section"); @@ -223,5 +214,4 @@ TEST_F(IniWriterTest, create_duplicate_sections) "[section]" PLATFORM_NEWLINE PLATFORM_NEWLINE "[section]" PLATFORM_NEWLINE PLATFORM_NEWLINE "[section]" PLATFORM_NEWLINE); Memory::Free(ini); - delete iw; }