diff options
author | rubidium <rubidium@openttd.org> | 2009-05-24 21:09:00 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-05-24 21:09:00 +0000 |
commit | 168ae6f7e2e87d3050c39bbb03148924751370a3 (patch) | |
tree | f231a8b93fcf344d126a8d3aa3ded9803200ca67 /src/gfx.cpp | |
parent | 0d99b6c71cd096599b4805d230483f3e4e958af1 (diff) | |
download | openttd-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/gfx.cpp')
-rw-r--r-- | src/gfx.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp index 775cd94a5..1648e30b3 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -340,7 +340,7 @@ static int TruncateString(char *str, int maxw) ddd_w = ddd = GetCharacterWidth(size, '.') * 3; - for (ddd_pos = str; (c = Utf8Consume((const char **)&str)) != '\0'; ) { + for (ddd_pos = str; (c = Utf8Consume(const_cast<const char **>(&str))) != '\0'; ) { if (IsPrintable(c)) { w += GetCharacterWidth(size, c); @@ -577,7 +577,7 @@ uint32 FormatStringLinebreaks(char *str, int maxw) int w = 0; for (;;) { - WChar c = Utf8Consume((const char **)&str); + WChar c = Utf8Consume(const_cast<const char **>(&str)); /* whitespace is where we will insert the line-break */ if (IsWhitespace(c)) last_space = str; |