From 771a9c21cc2f401cb9fd653cefcfe9da78b8f1a7 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 29 Sep 2020 16:19:37 -0300 Subject: common/wall_clock: Add virtual destructors From -fsanitize=address, this code wasn't calling the proper destructor. Adding virtual destructors for each inherited class and the base class fixes this bug. While we are at it, mark the functions as final. --- src/common/wall_clock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common/wall_clock.cpp') diff --git a/src/common/wall_clock.cpp b/src/common/wall_clock.cpp index 3afbdb898..7a20e95b7 100644 --- a/src/common/wall_clock.cpp +++ b/src/common/wall_clock.cpp @@ -15,7 +15,7 @@ namespace Common { using base_timer = std::chrono::steady_clock; using base_time_point = std::chrono::time_point; -class StandardWallClock : public WallClock { +class StandardWallClock final : public WallClock { public: StandardWallClock(u64 emulated_cpu_frequency, u64 emulated_clock_frequency) : WallClock(emulated_cpu_frequency, emulated_clock_frequency, false) { -- cgit v1.2.3 From 4a4b685a0420b0ac7c026cd2370c23d54f469976 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 30 Oct 2020 15:02:02 -0400 Subject: common: Enable warnings as errors Cleans up common so that we can enable warnings as errors. --- src/common/wall_clock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common/wall_clock.cpp') diff --git a/src/common/wall_clock.cpp b/src/common/wall_clock.cpp index 7a20e95b7..452a2837e 100644 --- a/src/common/wall_clock.cpp +++ b/src/common/wall_clock.cpp @@ -53,7 +53,7 @@ public: return Common::Divide128On32(temporary, 1000000000).first; } - void Pause(bool is_paused) override { + void Pause([[maybe_unused]] bool is_paused) override { // Do nothing in this clock type. } -- cgit v1.2.3 From 1ea6bdef058a789e2771511f741bffcca73c3525 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 25 Nov 2020 15:21:03 -0500 Subject: audio_core: Make shadowing and unused parameters errors Moves the audio code closer to enabling warnings as errors in general. --- src/common/wall_clock.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/wall_clock.cpp') diff --git a/src/common/wall_clock.cpp b/src/common/wall_clock.cpp index 452a2837e..a8c143f85 100644 --- a/src/common/wall_clock.cpp +++ b/src/common/wall_clock.cpp @@ -17,8 +17,8 @@ using base_time_point = std::chrono::time_point; class StandardWallClock final : public WallClock { public: - StandardWallClock(u64 emulated_cpu_frequency, u64 emulated_clock_frequency) - : WallClock(emulated_cpu_frequency, emulated_clock_frequency, false) { + explicit StandardWallClock(u64 emulated_cpu_frequency_, u64 emulated_clock_frequency_) + : WallClock(emulated_cpu_frequency_, emulated_clock_frequency_, false) { start_time = base_timer::now(); } -- cgit v1.2.3