From eb5054e6eb0d810f26caff9f09e43dbeee4a69fa Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 28 Sep 2014 11:20:06 -0400 Subject: Fix warnings in video_core --- src/core/hw/gpu.cpp | 4 ++-- src/core/hw/gpu.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/hw') diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index 7afb00d6..9c719231 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp @@ -27,7 +27,7 @@ u64 g_last_frame_ticks = 0; ///< CPU tick count from last frame template inline void Read(T &var, const u32 raw_addr) { u32 addr = raw_addr - 0x1EF00000; - int index = addr / 4; + u32 index = addr / 4; // Reads other than u32 are untested, so I'd rather have them abort than silently fail if (index >= Regs::NumIds() || !std::is_same::value) { @@ -41,7 +41,7 @@ inline void Read(T &var, const u32 raw_addr) { template inline void Write(u32 addr, const T data) { addr -= 0x1EF00000; - int index = addr / 4; + u32 index = addr / 4; // Writes other than u32 are untested, so I'd rather have them abort than silently fail if (index >= Regs::NumIds() || !std::is_same::value) { diff --git a/src/core/hw/gpu.h b/src/core/hw/gpu.h index 7186bfa8..c853429a 100644 --- a/src/core/hw/gpu.h +++ b/src/core/hw/gpu.h @@ -201,7 +201,7 @@ struct Regs { #undef INSERT_PADDING_WORDS_HELPER2 #undef INSERT_PADDING_WORDS - static inline int NumIds() { + static inline size_t NumIds() { return sizeof(Regs) / sizeof(u32); } -- cgit v1.2.3