summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-24 21:09:00 +0000
committerrubidium <rubidium@openttd.org>2009-05-24 21:09:00 +0000
commit168ae6f7e2e87d3050c39bbb03148924751370a3 (patch)
treef231a8b93fcf344d126a8d3aa3ded9803200ca67 /src/newgrf.cpp
parent0d99b6c71cd096599b4805d230483f3e4e958af1 (diff)
downloadopenttd-168ae6f7e2e87d3050c39bbb03148924751370a3.tar.xz
(svn r16422) -Codechange: use const_cast for removing const and warn when const is (accidentally?) removed using C-style casts.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index a510f2daa..2171a4850 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -1158,11 +1158,9 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, byte
MapSpriteMappingRecolour(&dts->ground);
while (buf < *bufp + len) {
- DrawTileSeqStruct *dtss;
-
/* no relative bounding box support */
- dts->seq = ReallocT((DrawTileSeqStruct*)dts->seq, ++seq_count);
- dtss = (DrawTileSeqStruct*) &dts->seq[seq_count - 1];
+ dts->seq = ReallocT(const_cast<DrawTileSeqStruct *>(dts->seq), ++seq_count);
+ DrawTileSeqStruct *dtss = const_cast<DrawTileSeqStruct *>(&dts->seq[seq_count - 1]);
dtss->delta_x = grf_load_byte(&buf);
if ((byte) dtss->delta_x == 0x80) break;
@@ -2907,7 +2905,7 @@ static void NewSpriteGroup(byte *buf, size_t len)
group->dts->seq = CallocT<DrawTileSeqStruct>(num_sprites + 1);
for (i = 0; i < num_sprites; i++) {
- DrawTileSeqStruct *seq = (DrawTileSeqStruct*)&group->dts->seq[i];
+ DrawTileSeqStruct *seq = const_cast<DrawTileSeqStruct*>(&group->dts->seq[i]);
seq->image.sprite = grf_load_word(&buf);
seq->image.pal = grf_load_word(&buf);
@@ -2935,7 +2933,7 @@ static void NewSpriteGroup(byte *buf, size_t len)
}
/* Set the terminator value. */
- ((DrawTileSeqStruct*)group->dts->seq)[i].delta_x = (int8)0x80;
+ const_cast<DrawTileSeqStruct *>(group->dts->seq)[i].delta_x = (int8)0x80;
break;
}