diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-02-25 16:57:03 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-02-25 16:57:03 +0100 |
commit | 7c9468e7165aac2724a8bad19e950ca435f68316 (patch) | |
tree | a1013dea6b1509cdafec3695c310e85f274d4017 /src/ppu/internals.c | |
parent | 755decd17854824ffd792f28abb1b0ac002c4e72 (diff) |
fix compiler warnings from `hh_ppu_vram_valid_address`0.1.0
Diffstat (limited to 'src/ppu/internals.c')
-rw-r--r-- | src/ppu/internals.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ppu/internals.c b/src/ppu/internals.c index 1c95a5a..650ba3e 100644 --- a/src/ppu/internals.c +++ b/src/ppu/internals.c @@ -2,13 +2,17 @@ #include "ppu/types.h" #include "ppu/internals.h" +#include "ppu/consts.h" bool hh_ppu_vram_valid_address(hh_ppu_addr_t addr) { - if (addr >= HH_PPU_VRAM_TMM_OFFSET && addr <= HH_PPU_VRAM_TMM_OFFSET + HH_PPU_VRAM_TMM_SIZE) return true; - if (addr >= HH_PPU_VRAM_BAM_OFFSET && addr <= HH_PPU_VRAM_BAM_OFFSET + HH_PPU_VRAM_BAM_SIZE) return true; - if (addr >= HH_PPU_VRAM_FAM_OFFSET && addr <= HH_PPU_VRAM_FAM_OFFSET + HH_PPU_VRAM_FAM_SIZE) return true; - if (addr >= HH_PPU_VRAM_PAL_OFFSET && addr <= HH_PPU_VRAM_PAL_OFFSET + HH_PPU_VRAM_PAL_SIZE) return true; - if (addr >= HH_PPU_VRAM_AUX_OFFSET && addr <= HH_PPU_VRAM_AUX_OFFSET + HH_PPU_VRAM_AUX_SIZE) return true; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wtype-limits" + if ((addr >= HH_PPU_VRAM_TMM_OFFSET) && (addr < (HH_PPU_VRAM_TMM_OFFSET + HH_PPU_VRAM_TMM_SIZE))) return true; + if ((addr >= HH_PPU_VRAM_BAM_OFFSET) && (addr < (HH_PPU_VRAM_BAM_OFFSET + HH_PPU_VRAM_BAM_SIZE))) return true; + if ((addr >= HH_PPU_VRAM_FAM_OFFSET) && (addr < (HH_PPU_VRAM_FAM_OFFSET + HH_PPU_VRAM_FAM_SIZE))) return true; + if ((addr >= HH_PPU_VRAM_PAL_OFFSET) && (addr < (HH_PPU_VRAM_PAL_OFFSET + HH_PPU_VRAM_PAL_SIZE))) return true; + if ((addr >= HH_PPU_VRAM_AUX_OFFSET) && (addr < (HH_PPU_VRAM_AUX_OFFSET + HH_PPU_VRAM_AUX_SIZE))) return true; +#pragma GCC diagnostic pop return false; } |