summaryrefslogtreecommitdiff
path: root/src/newgrf_debug_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-12 08:10:22 +0000
committerrubidium <rubidium@openttd.org>2011-11-12 08:10:22 +0000
commitbd64bf6372399bad1a92565ae7d3c243658d241f (patch)
tree7af646337e5ddafe68f0d701711c41ef89d21491 /src/newgrf_debug_gui.cpp
parenta8d33a4d89f11c45b9690481b08df3c800292005 (diff)
downloadopenttd-bd64bf6372399bad1a92565ae7d3c243658d241f.tar.xz
(svn r23193) -Codechange: don't cast away const unneededly
Diffstat (limited to 'src/newgrf_debug_gui.cpp')
-rw-r--r--src/newgrf_debug_gui.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp
index f1d628712..46a885a6f 100644
--- a/src/newgrf_debug_gui.cpp
+++ b/src/newgrf_debug_gui.cpp
@@ -189,7 +189,7 @@ public:
* @param grfid Parameter for the PSA. Only required for items with parameters.
* @return Pointer to the first position of the storage array or NULL if not present.
*/
- virtual int32 *GetPSAFirstPosition(uint index, uint32 grfid) const
+ virtual const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const
{
return NULL;
}
@@ -398,7 +398,7 @@ struct NewGRFInspectWindow : Window {
}
uint psa_size = nih->GetPSASize(index, this->caller_grfid);
- int32 *psa = nih->GetPSAFirstPosition(index, this->caller_grfid);
+ const int32 *psa = nih->GetPSAFirstPosition(index, this->caller_grfid);
if (psa_size != 0 && psa != NULL) {
if (nih->PSAWithParameter()) {
this->DrawString(r, i++, "Persistent storage [%08X]:", BSWAP32(this->caller_grfid));
@@ -414,12 +414,12 @@ struct NewGRFInspectWindow : Window {
if (nif->properties != NULL) {
this->DrawString(r, i++, "Properties:");
for (const NIProperty *nip = nif->properties; nip->name != NULL; nip++) {
- void *ptr = (byte*)base + nip->offset;
+ const void *ptr = (const byte *)base + nip->offset;
uint value;
switch (nip->read_size) {
- case 1: value = *(uint8 *)ptr; break;
- case 2: value = *(uint16 *)ptr; break;
- case 4: value = *(uint32 *)ptr; break;
+ case 1: value = *(const uint8 *)ptr; break;
+ case 2: value = *(const uint16 *)ptr; break;
+ case 4: value = *(const uint32 *)ptr; break;
default: NOT_REACHED();
}
@@ -448,12 +448,12 @@ struct NewGRFInspectWindow : Window {
this->DrawString(r, i++, "Callbacks:");
for (const NICallback *nic = nif->callbacks; nic->name != NULL; nic++) {
if (nic->cb_bit != CBM_NO_BIT) {
- void *ptr = (byte*)base_spec + nic->offset;
+ const void *ptr = (const byte *)base_spec + nic->offset;
uint value;
switch (nic->read_size) {
- case 1: value = *(uint8 *)ptr; break;
- case 2: value = *(uint16 *)ptr; break;
- case 4: value = *(uint32 *)ptr; break;
+ case 1: value = *(const uint8 *)ptr; break;
+ case 2: value = *(const uint16 *)ptr; break;
+ case 4: value = *(const uint32 *)ptr; break;
default: NOT_REACHED();
}