(svn r16422) -Codechange: use const_cast for removing const and warn when const is (accidentally?) removed using C-style casts.

This commit is contained in:
rubidium
2009-05-24 21:09:00 +00:00
parent 0d99b6c71c
commit 168ae6f7e2
12 changed files with 18 additions and 20 deletions

View File

@@ -1396,7 +1396,7 @@ static SpriteID GetEngineColourMap(EngineID engine_type, CompanyID company, Engi
* map else it's returned as-is. */
if (!HasBit(callback, 14)) {
/* Update cache */
if (v != NULL) ((Vehicle*)v)->colourmap = map;
if (v != NULL) const_cast<Vehicle *>(v)->colourmap = map;
return map;
}
}
@@ -1412,7 +1412,7 @@ static SpriteID GetEngineColourMap(EngineID engine_type, CompanyID company, Engi
if (twocc) map += livery->colour2 * 16;
/* Update cache */
if (v != NULL) ((Vehicle*)v)->colourmap = map;
if (v != NULL) const_cast<Vehicle *>(v)->colourmap = map;
return map;
}