diff --git a/core/hw/aica/aica.cpp b/core/hw/aica/aica.cpp index 79aed644cd..fad07fd28f 100644 --- a/core/hw/aica/aica.cpp +++ b/core/hw/aica/aica.cpp @@ -95,8 +95,8 @@ static int AicaUpdate(int tag, int cycles, int jitter, void *arg) void timeStep() { - for (std::size_t i = 0; i < std::size(timers); i++) - timers[i].StepTimer(1); + for (auto& timer : timers) + timer.StepTimer(1); SCIPD->SAMPLE_DONE = 1; MCIPD->SAMPLE_DONE = 1; diff --git a/core/hw/aica/aica_if.cpp b/core/hw/aica/aica_if.cpp index fcdd0fa0eb..8d6ba1b554 100644 --- a/core/hw/aica/aica_if.cpp +++ b/core/hw/aica/aica_if.cpp @@ -17,7 +17,6 @@ #include "serialize.h" #include "hw/arm7/arm_mem.h" -#include "hw/arm7/arm7.h" #include "dsp.h" #include "sgc_if.h" #include "aica.h" @@ -529,10 +528,10 @@ void serialize(Serializer& ser) dsp::state.serialize(ser); - for (int i = 0 ; i < 3 ; i++) + for (const auto& timer : timers) { - ser << timers[i].c_step; - ser << timers[i].m_step; + ser << timer.c_step; + ser << timer.m_step; } if (!ser.rollback()) diff --git a/core/hw/holly/sb.h b/core/hw/holly/sb.h index a45899b318..1eec402ea9 100644 --- a/core/hw/holly/sb.h +++ b/core/hw/holly/sb.h @@ -5,7 +5,6 @@ #pragma once #include "types.h" #include "hw/hwreg.h" -#include u32 sb_ReadMem(u32 addr); void sb_WriteMem(u32 addr, u32 data); diff --git a/core/hw/maple/maple_devs.cpp b/core/hw/maple/maple_devs.cpp index 508f3f1d0e..41a366c723 100755 --- a/core/hw/maple/maple_devs.cpp +++ b/core/hw/maple/maple_devs.cpp @@ -9,8 +9,8 @@ #include "cfg/option.h" #include "rend/gui.h" #include -#include -#include +#include +#include const char* maple_sega_controller_name = "Dreamcast Controller"; const char* maple_sega_vmu_name = "Visual Memory"; diff --git a/core/hw/maple/maple_devs.h b/core/hw/maple/maple_devs.h index 30cd9661fb..284d11a7c3 100755 --- a/core/hw/maple/maple_devs.h +++ b/core/hw/maple/maple_devs.h @@ -272,7 +272,7 @@ struct maple_naomi_jamma : maple_base, SerialPort u8 eeprom[128]; maple_naomi_jamma(); - ~maple_naomi_jamma(); + ~maple_naomi_jamma() override; MapleDeviceType get_device_type() override { diff --git a/core/hw/naomi/card_reader.cpp b/core/hw/naomi/card_reader.cpp index bb55348aab..b914c39a7d 100644 --- a/core/hw/naomi/card_reader.cpp +++ b/core/hw/naomi/card_reader.cpp @@ -24,7 +24,7 @@ #include "rend/gui.h" #include #include -#include +#include namespace card_reader { @@ -383,7 +383,7 @@ class InitialDCardReader final : public SanwaCRP1231BR SCIFSerialPort::Instance().setPipe(this); } - ~InitialDCardReader() { + ~InitialDCardReader() override { SCIFSerialPort::Instance().setPipe(nullptr); } }; @@ -396,7 +396,7 @@ class DerbyBRCardReader final : public SanwaCRP1231BR getMieDevice()->setPipe(this); } - ~DerbyBRCardReader() { + ~DerbyBRCardReader() override { getMieDevice()->setPipe(nullptr); } }; @@ -408,7 +408,7 @@ class DerbyLRCardReader final : public SanwaCRP1231LR getMieDevice()->setPipe(this); } - ~DerbyLRCardReader() { + ~DerbyLRCardReader() override { getMieDevice()->setPipe(nullptr); } }; @@ -478,7 +478,7 @@ class ClubKartCardReader : public CardReaderWriter, SerialPort::Pipe ClubKartCardReader() { SCIFSerialPort::Instance().setPipe(this); } - ~ClubKartCardReader() { + ~ClubKartCardReader() override { SCIFSerialPort::Instance().setPipe(nullptr); } @@ -685,7 +685,7 @@ class BarcodeReader final : public SerialPort::Pipe SCIFSerialPort::Instance().setPipe(this); } - ~BarcodeReader() { + ~BarcodeReader() override { SCIFSerialPort::Instance().setPipe(nullptr); } diff --git a/core/hw/naomi/hopper.cpp b/core/hw/naomi/hopper.cpp index 3fc057eb43..6d2206d795 100644 --- a/core/hw/naomi/hopper.cpp +++ b/core/hw/naomi/hopper.cpp @@ -17,7 +17,6 @@ along with Flycast. If not, see . */ #include "hopper.h" -#include "network/ggpo.h" #include "input/gamepad.h" #include "hw/maple/maple_cfg.h" #include "hw/sh4/sh4_sched.h" diff --git a/core/hw/naomi/multiboard.cpp b/core/hw/naomi/multiboard.cpp index 39b9a3158a..9ce8f9cfd2 100644 --- a/core/hw/naomi/multiboard.cpp +++ b/core/hw/naomi/multiboard.cpp @@ -33,7 +33,6 @@ static Multiboard *multiboard; #include "naomi_roms.h" #include "cfg/option.h" #include "hw/sh4/sh4_sched.h" -#include #include constexpr int SyncCycles = 500000; diff --git a/core/hw/naomi/naomi_cart.cpp b/core/hw/naomi/naomi_cart.cpp index 4c1ac5e20e..1ef1a12f23 100644 --- a/core/hw/naomi/naomi_cart.cpp +++ b/core/hw/naomi/naomi_cart.cpp @@ -26,7 +26,6 @@ #include "decrypt.h" #include "naomi_roms.h" #include "hw/flashrom/nvmem.h" -#include "hw/holly/holly_intc.h" #include "m1cartridge.h" #include "m4cartridge.h" #include "awcartridge.h" diff --git a/core/hw/naomi/netdimm.h b/core/hw/naomi/netdimm.h index c0329a7c4d..436e592aea 100644 --- a/core/hw/naomi/netdimm.h +++ b/core/hw/naomi/netdimm.h @@ -24,7 +24,7 @@ class NetDimm : public GDCartridge { public: NetDimm(u32 size); - ~NetDimm(); + ~NetDimm() override; void Init(LoadProgress *progress = nullptr, std::vector *digest = nullptr) override; diff --git a/core/hw/naomi/systemsp.cpp b/core/hw/naomi/systemsp.cpp index a37f7d2cf0..68989dc8c4 100644 --- a/core/hw/naomi/systemsp.cpp +++ b/core/hw/naomi/systemsp.cpp @@ -26,7 +26,6 @@ #include "hw/maple/maple_cfg.h" #include "input/gamepad.h" #include "hw/sh4/sh4_sched.h" -#include "hw/mem/addrspace.h" #include "hw/holly/holly_intc.h" #include "hw/holly/sb.h" #include "oslib/storage.h" @@ -35,7 +34,8 @@ #include "card_reader.h" #include "naomi_roms.h" #include "stdclass.h" -#include +#include +#include #ifdef DEBUG_SERIAL #define SERIAL_LOG(...) DEBUG_LOG(NAOMI, __VA_ARGS__) @@ -506,7 +506,7 @@ class Touchscreen : public SerialPort::Pipe schedId = sh4_sched_register(0, schedCallback, this); } - ~Touchscreen() + ~Touchscreen() override { sh4_sched_unregister(schedId); } diff --git a/core/hw/naomi/systemsp.h b/core/hw/naomi/systemsp.h index a23ee5191e..e451b6de1d 100644 --- a/core/hw/naomi/systemsp.h +++ b/core/hw/naomi/systemsp.h @@ -23,8 +23,6 @@ #include "hw/naomi/m4cartridge.h" #include "hw/flashrom/at93cxx.h" #include "serialize.h" -#include -#include #include #include @@ -52,7 +50,7 @@ class SerialPort : public ::SerialPort SerialPort(SystemSpCart *cart, int index) : cart(cart), index(index) { } - ~SerialPort() { + ~SerialPort() override { if (pipe != nullptr) delete pipe; } @@ -147,7 +145,7 @@ class SystemSpCart : public M4Cartridge { public: SystemSpCart(u32 size); - ~SystemSpCart(); + ~SystemSpCart() override; void Init(LoadProgress *progress = nullptr, std::vector *digest = nullptr) override; void setMediaName(const char *mediaName, const char *parentName) { diff --git a/core/hw/naomi/touchscreen.cpp b/core/hw/naomi/touchscreen.cpp index 6a5f183537..d894f878fc 100644 --- a/core/hw/naomi/touchscreen.cpp +++ b/core/hw/naomi/touchscreen.cpp @@ -44,7 +44,7 @@ class TouchscreenPipe final : public SerialPort::Pipe SCIFSerialPort::Instance().setPipe(this); } - ~TouchscreenPipe() + ~TouchscreenPipe() override { SCIFSerialPort::Instance().setPipe(nullptr); sh4_sched_unregister(schedId); diff --git a/core/hw/sh4/dyna/blockmanager.cpp b/core/hw/sh4/dyna/blockmanager.cpp index eb33e0e624..62c0636bdb 100644 --- a/core/hw/sh4/dyna/blockmanager.cpp +++ b/core/hw/sh4/dyna/blockmanager.cpp @@ -360,9 +360,8 @@ void bm_WriteBlockMap(const std::string& file) if (f) { INFO_LOG(DYNAREC, "Writing block map !"); - for (auto& it : blkmap) + for (const auto& [_, block] : blkmap) { - RuntimeBlockInfoPtr& block = it.second; fprintf(f, "block: %d:%08X:%p:%d:%d:%d\n", block->BlockType, block->addr, block->code, block->host_code_size, block->guest_cycles, block->guest_opcodes); for(size_t j = 0; j < block->oplist.size(); j++) fprintf(f,"\top: %zd:%d:%s\n", j, block->oplist[j].guest_offs, block->oplist[j].dissasm().c_str()); @@ -374,9 +373,8 @@ void bm_WriteBlockMap(const std::string& file) void sh4_jitsym(FILE* out) { - for (const auto& it : blkmap) + for (const auto& [_, block] : blkmap) { - const RuntimeBlockInfoPtr& block = it.second; fprintf(out, "%p %d %08X\n", block->code, block->host_code_size, block->addr); } } @@ -548,9 +546,8 @@ void print_blocks() INFO_LOG(DYNAREC, "Writing blocks to %p", f); } - for (auto it : blkmap) + for (const auto& [_, blk] : blkmap) { - RuntimeBlockInfoPtr blk = it.second; if (f) { fprintf(f,"block: %p\n",blk.get()); diff --git a/core/hw/sh4/dyna/blockmanager.h b/core/hw/sh4/dyna/blockmanager.h index 4d1552b04c..3331904894 100644 --- a/core/hw/sh4/dyna/blockmanager.h +++ b/core/hw/sh4/dyna/blockmanager.h @@ -2,6 +2,7 @@ #include "types.h" #include "decoder.h" +#include "shil.h" #include "stdclass.h" #include diff --git a/core/hw/sh4/dyna/decoder.h b/core/hw/sh4/dyna/decoder.h index 3deafea55c..7c8324404e 100644 --- a/core/hw/sh4/dyna/decoder.h +++ b/core/hw/sh4/dyna/decoder.h @@ -1,5 +1,4 @@ #pragma once -#include "shil.h" #include "../sh4_if.h" #define mkbet(c,s,v) ((c<<3)|(s<<1)|v) diff --git a/core/hw/sh4/dyna/driver.cpp b/core/hw/sh4/dyna/driver.cpp index 58ac840763..bec4ed6609 100644 --- a/core/hw/sh4/dyna/driver.cpp +++ b/core/hw/sh4/dyna/driver.cpp @@ -8,8 +8,6 @@ #include "hw/sh4/sh4_mem.h" #include "hw/sh4/modules/mmu.h" -#include - #include "blockmanager.h" #include "ngen.h" #include "decoder.h" diff --git a/core/hw/sh4/modules/fastmmu.cpp b/core/hw/sh4/modules/fastmmu.cpp index b0616f732b..e599d03b56 100644 --- a/core/hw/sh4/modules/fastmmu.cpp +++ b/core/hw/sh4/modules/fastmmu.cpp @@ -18,7 +18,6 @@ */ #include "mmu.h" #include "hw/sh4/sh4_if.h" -#include "hw/sh4/sh4_interrupts.h" #include "hw/sh4/sh4_core.h" #include "types.h" diff --git a/core/hw/sh4/modules/mmu.h b/core/hw/sh4/modules/mmu.h index c594f4dcf9..a7d3206c39 100644 --- a/core/hw/sh4/modules/mmu.h +++ b/core/hw/sh4/modules/mmu.h @@ -1,7 +1,6 @@ #pragma once #include "types.h" #include "hw/sh4/sh4_mmr.h" -#include "cfg/option.h" #include "hw/sh4/dyna/ngen.h" //Translation Types diff --git a/core/hw/sh4/sh4_interpreter.h b/core/hw/sh4/sh4_interpreter.h index 9b9137e15a..80605b04f3 100644 --- a/core/hw/sh4/sh4_interpreter.h +++ b/core/hw/sh4/sh4_interpreter.h @@ -1,6 +1,5 @@ #pragma once #include "types.h" -#include "sh4_if.h" #undef sh4op #define sh4op(str) void DYNACALL str (u32 op) diff --git a/core/hw/sh4/sh4_mem.cpp b/core/hw/sh4/sh4_mem.cpp index ff8ee5e274..d44d309f8a 100644 --- a/core/hw/sh4/sh4_mem.cpp +++ b/core/hw/sh4/sh4_mem.cpp @@ -9,7 +9,6 @@ #include "sh4_mmr.h" #include "hw/pvr/elan.h" #include "hw/pvr/pvr_mem.h" -#include "cfg/option.h" #include "hw/mem/addrspace.h" #include "hw/sh4/modules/mmu.h" diff --git a/core/hw/sh4/sh4_opcode_list.h b/core/hw/sh4/sh4_opcode_list.h index 7f4ce37190..718d611642 100644 --- a/core/hw/sh4/sh4_opcode_list.h +++ b/core/hw/sh4/sh4_opcode_list.h @@ -2,6 +2,8 @@ #include "types.h" #include "sh4_interpreter.h" +#include + extern OpCallFP* OpPtr[0x10000]; typedef void OpDissasmFP(char* out,const char* const FormatString,u32 pc,u16 opcode); diff --git a/core/imgread/chd.cpp b/core/imgread/chd.cpp index 540368f544..757a673aaf 100644 --- a/core/imgread/chd.cpp +++ b/core/imgread/chd.cpp @@ -21,7 +21,7 @@ struct CHDDisc : Disc void tryOpen(const char* file); - ~CHDDisc() + ~CHDDisc() override { delete[] hunk_mem; diff --git a/core/lua/lua.h b/core/lua/lua.h index 4d190057ca..48ef341a0d 100644 --- a/core/lua/lua.h +++ b/core/lua/lua.h @@ -17,7 +17,6 @@ along with Flycast. If not, see . */ #pragma once -#include "build.h" #include namespace lua diff --git a/core/network/alienfnt_modem.cpp b/core/network/alienfnt_modem.cpp index 3db6564681..05cb9157f3 100644 --- a/core/network/alienfnt_modem.cpp +++ b/core/network/alienfnt_modem.cpp @@ -32,7 +32,7 @@ struct ModemEmu : public SerialPort::Pipe schedId = sh4_sched_register(0, schedCallback); } - ~ModemEmu() { + ~ModemEmu() override { sh4_sched_unregister(schedId); stop_pico(); SCIFSerialPort::Instance().setPipe(nullptr); diff --git a/core/network/ggpo.h b/core/network/ggpo.h index 43a8870768..2b9889a15a 100644 --- a/core/network/ggpo.h +++ b/core/network/ggpo.h @@ -17,8 +17,8 @@ along with Flycast. If not, see . */ #pragma once -#include "types.h" #include +#include struct MapleInputState; diff --git a/core/oslib/oslib.h b/core/oslib/oslib.h index 7f0421ae8a..e6ad9c2e33 100644 --- a/core/oslib/oslib.h +++ b/core/oslib/oslib.h @@ -1,6 +1,5 @@ #pragma once #include "types.h" -#include #if defined(__SWITCH__) #include #endif diff --git a/core/rend/boxart/gamesdb.h b/core/rend/boxart/gamesdb.h index 2433681f3f..90e1790749 100644 --- a/core/rend/boxart/gamesdb.h +++ b/core/rend/boxart/gamesdb.h @@ -32,7 +32,7 @@ class TheGamesDb : public Scraper bool initialize(const std::string& saveDirectory) override; void scrape(GameBoxart& item) override; void scrape(std::vector& items) override; - ~TheGamesDb(); + ~TheGamesDb() override; private: void fetchPlatforms(); diff --git a/core/rend/dx11/dx11_driver.h b/core/rend/dx11/dx11_driver.h index 697d7f3736..20bf869996 100644 --- a/core/rend/dx11/dx11_driver.h +++ b/core/rend/dx11/dx11_driver.h @@ -30,7 +30,7 @@ class DX11Driver final : public ImGuiDriver ImGui_ImplDX11_Init(device, deviceContext); } - ~DX11Driver() { + ~DX11Driver() override { ImGui_ImplDX11_Shutdown(); } diff --git a/core/rend/dx11/dx11_renderer.h b/core/rend/dx11/dx11_renderer.h index 2bdd9d3736..e5f067a77c 100644 --- a/core/rend/dx11/dx11_renderer.h +++ b/core/rend/dx11/dx11_renderer.h @@ -127,7 +127,6 @@ struct DX11Renderer : public Renderer bool dithering = false; private: - void readDCFramebuffer(); void prepareRttRenderTarget(u32 texAddress); void setBaseScissor(); void drawStrips(); diff --git a/core/rend/dx9/d3d_overlay.cpp b/core/rend/dx9/d3d_overlay.cpp index fda6e2d5d4..a5b4abd44f 100644 --- a/core/rend/dx9/d3d_overlay.cpp +++ b/core/rend/dx9/d3d_overlay.cpp @@ -20,7 +20,6 @@ #include "rend/osd.h" #include #include -#include void D3DOverlay::drawQuad(const RECT& rect, D3DCOLOR color) { diff --git a/core/rend/dx9/dx9_driver.h b/core/rend/dx9/dx9_driver.h index cfbc5ab62b..20e615c5ad 100644 --- a/core/rend/dx9/dx9_driver.h +++ b/core/rend/dx9/dx9_driver.h @@ -29,7 +29,7 @@ class DX9Driver final : public ImGuiDriver ImGui_ImplDX9_Init(device); } - ~DX9Driver() { + ~DX9Driver() override { ImGui_ImplDX9_Shutdown(); } diff --git a/core/rend/gles/gldraw.cpp b/core/rend/gles/gldraw.cpp index 4ba2eca0fd..16a0693471 100644 --- a/core/rend/gles/gldraw.cpp +++ b/core/rend/gles/gldraw.cpp @@ -4,7 +4,9 @@ #include "rend/osd.h" #include "naomi2.h" #include "rend/transform_matrix.h" +#ifdef LIBRETRO #include "postprocess.h" +#endif #include diff --git a/core/rend/gles/gles.cpp b/core/rend/gles/gles.cpp index cefa9fd81c..8add35f5d1 100644 --- a/core/rend/gles/gles.cpp +++ b/core/rend/gles/gles.cpp @@ -4,6 +4,7 @@ #ifndef LIBRETRO #include "rend/gui.h" #else +#include "rend/gles/postprocess.h" #include "vmu_xhair.h" #endif #include "rend/osd.h" @@ -12,7 +13,6 @@ #include "wsi/gl_context.h" #include "emulator.h" #include "naomi2.h" -#include "rend/gles/postprocess.h" #ifdef TEST_AUTOMATION #include "cfg/cfg.h" diff --git a/core/rend/gui_cheats.cpp b/core/rend/gui_cheats.cpp index 386e4bc7c0..7e55b9321f 100644 --- a/core/rend/gui_cheats.cpp +++ b/core/rend/gui_cheats.cpp @@ -20,7 +20,9 @@ #include "imgui.h" #include "gui_util.h" #include "cheats.h" +#ifdef __ANDROID__ #include "oslib/storage.h" +#endif static bool addingCheat; diff --git a/core/rend/vulkan/buffer.cpp b/core/rend/vulkan/buffer.cpp index 58ca65ccb6..e0f730794b 100644 --- a/core/rend/vulkan/buffer.cpp +++ b/core/rend/vulkan/buffer.cpp @@ -19,7 +19,6 @@ along with Flycast. If not, see . */ #include "buffer.h" -#include "utils.h" #include "vulkan_context.h" BufferData::BufferData(vk::DeviceSize size, vk::BufferUsageFlags usage, vk::MemoryPropertyFlags propertyFlags) diff --git a/core/rend/vulkan/vulkan.h b/core/rend/vulkan/vulkan.h index 177a395ce9..63c8b24e5e 100644 --- a/core/rend/vulkan/vulkan.h +++ b/core/rend/vulkan/vulkan.h @@ -52,7 +52,7 @@ class Deleter : public Deletable { public: Deleter(T *p) : p(p) {} - ~Deleter() { + ~Deleter() override { delete p; } private: diff --git a/core/windows/rawinput.h b/core/windows/rawinput.h index 58c8e6a894..6406e350e3 100644 --- a/core/windows/rawinput.h +++ b/core/windows/rawinput.h @@ -19,7 +19,6 @@ #pragma once #include "build.h" #ifndef TARGET_UWP -#include "input/gamepad_device.h" #include "input/keyboard_device.h" #include "input/mouse.h" #include diff --git a/core/wsi/egl.h b/core/wsi/egl.h index de05ed8ff8..972111c855 100644 --- a/core/wsi/egl.h +++ b/core/wsi/egl.h @@ -27,7 +27,7 @@ class EGLGraphicsContext : public GLGraphicsContext { public: - ~EGLGraphicsContext() { term(); } + ~EGLGraphicsContext() override { term(); } bool init(); void term() override; diff --git a/core/wsi/xgl.h b/core/wsi/xgl.h index a27829148b..101a039ade 100644 --- a/core/wsi/xgl.h +++ b/core/wsi/xgl.h @@ -25,7 +25,7 @@ class XGLGraphicsContext : public GLGraphicsContext { public: - ~XGLGraphicsContext() { term(); XFree(framebufferConfigs); } + ~XGLGraphicsContext() override { term(); XFree(framebufferConfigs); } bool init(); void term() override;