summaryrefslogtreecommitdiff
path: root/src/misc_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-27 21:41:00 +0000
committerrubidium <rubidium@openttd.org>2008-05-27 21:41:00 +0000
commit5c5ee7eb579d0ee6655e0b81f6169dca7632ab97 (patch)
tree086ec523744482fc8374da46db2a402e4b5c5d0a /src/misc_gui.cpp
parent49a0bd7f90f3c48f81e9ad0bcabe87a77cf36e0f (diff)
downloadopenttd-5c5ee7eb579d0ee6655e0b81f6169dca7632ab97.tar.xz
(svn r13301) -Fix [FS#1997]: resolve more MSVC 9 x64 warnings.
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r--src/misc_gui.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index e9a084bce..9cf128662 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -751,7 +751,7 @@ static void DelChar(Textbuf *tb, bool backspace)
if (backspace) s = Utf8PrevChar(s);
- size_t len = Utf8Decode(&c, s);
+ uint16 len = (uint16)Utf8Decode(&c, s);
uint width = GetCharacterWidth(FS_NORMAL, c);
tb->width -= width;
@@ -807,7 +807,7 @@ void DeleteTextBufferAll(Textbuf *tb)
bool InsertTextBufferChar(Textbuf *tb, WChar key)
{
const byte charwidth = GetCharacterWidth(FS_NORMAL, key);
- size_t len = Utf8CharLen(key);
+ uint16 len = (uint16)Utf8CharLen(key);
if (tb->length < (tb->maxlength - len) && (tb->maxwidth == 0 || tb->width + charwidth <= tb->maxwidth)) {
memmove(tb->buf + tb->caretpos + len, tb->buf + tb->caretpos, tb->length - tb->caretpos + 1);
Utf8Encode(tb->buf + tb->caretpos, key);
@@ -847,7 +847,7 @@ bool MoveTextBufferPos(Textbuf *tb, int navmode)
if (tb->caretpos < tb->length) {
WChar c;
- tb->caretpos += Utf8Decode(&c, tb->buf + tb->caretpos);
+ tb->caretpos += (uint16)Utf8Decode(&c, tb->buf + tb->caretpos);
tb->caretxoffs += GetCharacterWidth(FS_NORMAL, c);
return true;