summaryrefslogtreecommitdiff
path: root/src/gfx.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2015-08-10 20:24:13 +0000
committermichi_cc <michi_cc@openttd.org>2015-08-10 20:24:13 +0000
commit2b8bb12d623a64897636234ed3c508517a1a2ba6 (patch)
tree015abed42269cf73bb83b2f92b029084735d82cd /src/gfx.cpp
parent35b77450f80580da2aa7f087aa2a1631b92ebd62 (diff)
downloadopenttd-2b8bb12d623a64897636234ed3c508517a1a2ba6.tar.xz
(svn r27381) -Fix: Warnings due to C++11 requirements for explicit narrowing conversions in initializer lists.
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r--src/gfx.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index bc7f93244..f3a98461d 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -186,7 +186,7 @@ static inline void GfxDoDrawLine(void *video, int x, int y, int x2, int y2, int
int grade_x = x2 - x;
/* Clipping rectangle. Slightly extended so we can ignore the width of the line. */
- uint extra = CeilDiv(3 * width, 4); // not less then "width * sqrt(2) / 2"
+ int extra = (int)CeilDiv(3 * width, 4); // not less then "width * sqrt(2) / 2"
Rect clip = { -extra, -extra, screen_width - 1 + extra, screen_height - 1 + extra };
/* prevent integer overflows. */
@@ -586,7 +586,7 @@ int GetStringLineCount(StringID str, int maxw)
*/
Dimension GetStringMultiLineBoundingBox(StringID str, const Dimension &suggestion)
{
- Dimension box = {suggestion.width, GetStringHeight(str, suggestion.width)};
+ Dimension box = {suggestion.width, (uint)GetStringHeight(str, suggestion.width)};
return box;
}
@@ -598,7 +598,7 @@ Dimension GetStringMultiLineBoundingBox(StringID str, const Dimension &suggestio
*/
Dimension GetStringMultiLineBoundingBox(const char *str, const Dimension &suggestion)
{
- Dimension box = {suggestion.width, GetStringHeight(str, suggestion.width)};
+ Dimension box = {suggestion.width, (uint)GetStringHeight(str, suggestion.width)};
return box;
}