diff --git a/src/core/hw/gpu.h b/src/core/hw/gpu.h index 2e3a9f779d17a5f661c24e91474aec0d8fc560ad..9e07016056a982e5027b970ebcdf06ca8fe4685f 100644 --- a/src/core/hw/gpu.h +++ b/src/core/hw/gpu.h @@ -267,13 +267,13 @@ struct Regs { return sizeof(Regs) / sizeof(u32); } - u32& operator [] (int index) const { - u32* content = (u32*)this; + const u32& operator [] (int index) const { + const u32* content = reinterpret_cast<const u32*>(this); return content[index]; } u32& operator [] (int index) { - u32* content = (u32*)this; + u32* content = reinterpret_cast<u32*>(this); return content[index]; } diff --git a/src/core/hw/lcd.h b/src/core/hw/lcd.h index bcce6d8cfb21dac45ca065a4615e62fb039807fd..d8ece4980684603a903267c00043f27556c8b80d 100644 --- a/src/core/hw/lcd.h +++ b/src/core/hw/lcd.h @@ -42,13 +42,13 @@ struct Regs { return sizeof(Regs) / sizeof(u32); } - u32& operator [] (int index) const { - u32* content = (u32*)this; + const u32& operator [] (int index) const { + const u32* content = reinterpret_cast<const u32*>(this); return content[index]; } u32& operator [] (int index) { - u32* content = (u32*)this; + u32* content = reinterpret_cast<u32*>(this); return content[index]; } diff --git a/src/video_core/pica.h b/src/video_core/pica.h index 7fb3aa481e530b1d3a87f18db7f904f22bc8f00b..d66124410aa3f74315b5056f0001a6fcb108bffb 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -1225,13 +1225,13 @@ struct Regs { return sizeof(Regs) / sizeof(u32); } - u32& operator [] (int index) const { - u32* content = (u32*)this; + const u32& operator [] (int index) const { + const u32* content = reinterpret_cast<const u32*>(this); return content[index]; } u32& operator [] (int index) { - u32* content = (u32*)this; + u32* content = reinterpret_cast<u32*>(this); return content[index]; }