Browse Source

core/video_core: Don't cast away const in subscript operators

Not to say these subscript operators aren't totally ugly as is.
nce_cpp
Lioncash 10 years ago
parent
commit
d04e1ad75c
  1. 6
      src/core/hw/gpu.h
  2. 6
      src/core/hw/lcd.h
  3. 6
      src/video_core/pica.h

6
src/core/hw/gpu.h

@ -267,13 +267,13 @@ struct Regs {
return sizeof(Regs) / sizeof(u32); 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]; return content[index];
} }
u32& operator [] (int index) { u32& operator [] (int index) {
u32* content = (u32*)this;
u32* content = reinterpret_cast<u32*>(this);
return content[index]; return content[index];
} }

6
src/core/hw/lcd.h

@ -42,13 +42,13 @@ struct Regs {
return sizeof(Regs) / sizeof(u32); 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]; return content[index];
} }
u32& operator [] (int index) { u32& operator [] (int index) {
u32* content = (u32*)this;
u32* content = reinterpret_cast<u32*>(this);
return content[index]; return content[index];
} }

6
src/video_core/pica.h

@ -1225,13 +1225,13 @@ struct Regs {
return sizeof(Regs) / sizeof(u32); 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]; return content[index];
} }
u32& operator [] (int index) { u32& operator [] (int index) {
u32* content = (u32*)this;
u32* content = reinterpret_cast<u32*>(this);
return content[index]; return content[index];
} }

Loading…
Cancel
Save