Skip to content

Commit e154955

Browse files
author
Bart Roossien
committed
[ZH] Fixing warnings related to narrowing conversions (TheSuperHackers#534)
1 parent bd7de7f commit e154955

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

GeneralsMD/Code/GameEngine/Include/Common/BorderColors.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ struct BorderColor
2828

2929
const BorderColor BORDER_COLORS[] =
3030
{
31-
{ "Orange", 0xFFFF8700, },
32-
{ "Green", 0xFF00FF00, },
33-
{ "Blue", 0xFF0000FF, },
34-
{ "Cyan", 0xFF00FFFF, },
35-
{ "Magenta", 0xFFFF00FF, },
36-
{ "Yellow", 0xFFFFFF00, },
37-
{ "Purple", 0xFF9E00FF, },
38-
{ "Pink", 0xFFFF8670, },
31+
{ "Orange", 0xFFFF8700L, },
32+
{ "Green", 0xFF00FF00L, },
33+
{ "Blue", 0xFF0000FFL, },
34+
{ "Cyan", 0xFF00FFFFL, },
35+
{ "Magenta", 0xFFFF00FFL, },
36+
{ "Yellow", 0xFFFFFF00L, },
37+
{ "Purple", 0xFF9E00FFL, },
38+
{ "Pink", 0xFFFF8670L, },
3939
};
4040

4141
const long BORDER_COLORS_SIZE = sizeof(BORDER_COLORS) / sizeof (BORDER_COLORS[0]);

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp

+15-15
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,19 @@ void W3DMainMenuDraw( GameWindow *window, WinInstanceData *instData )
172172
IRegion2D topHorizontal1 ={pos.x, pos.y, pos.x + size.x, pos.y };
173173
IRegion2D topHorizontal1drop ={pos.x, pos.y+1, pos.x + size.x, pos.y+1 };
174174

175-
IRegion2D topHorizontal2 ={pos.x, pos.y + (size.y * .1) , pos.x + size.x, pos.y + (size.y * .1) };
176-
IRegion2D topHorizontal2drop ={pos.x, pos.y + (size.y * .12) , pos.x + size.x, pos.y + (size.y * .12) };
175+
IRegion2D topHorizontal2 ={pos.x, pos.y + static_cast<int>(size.y * .1) , pos.x + size.x, pos.y + static_cast<int>(size.y * .1) };
176+
IRegion2D topHorizontal2drop ={pos.x, pos.y + static_cast<int>(size.y * .12) , pos.x + size.x, pos.y + static_cast<int>(size.y * .12) };
177177

178-
IRegion2D bottomHorizontal1={pos.x, pos.y + (size.y * .9), pos.x + size.x, pos.y + (size.y * .9) };
179-
IRegion2D bottomHorizontal1drop={pos.x, pos.y + (size.y * .92), pos.x + size.x, pos.y + (size.y * .92) };
178+
IRegion2D bottomHorizontal1={pos.x, pos.y + static_cast<int>(size.y * .9), pos.x + size.x, pos.y + static_cast<int>(size.y * .9) };
179+
IRegion2D bottomHorizontal1drop={pos.x, pos.y + static_cast<int>(size.y * .92), pos.x + size.x, pos.y + static_cast<int>(size.y * .92) };
180180

181181
IRegion2D bottomHorizontal2= {pos.x, pos.y + size.y, pos.x + size.x, pos.y + size.y };
182182
IRegion2D bottomHorizontal2drop= {pos.x, pos.y + size.y + 1, pos.x + size.x, pos.y + size.y + 1 };
183183

184-
IRegion2D verticle1 ={pos.x + (size.x * .225), pos.y , pos.x + (size.x * .225), height };
185-
IRegion2D verticle2 ={pos.x + (size.x * .445), pos.y, pos.x + (size.x * .445), height };
186-
IRegion2D verticle3 ={pos.x + (size.x * .6662), pos.y, pos.x + (size.x * .6662), height };
187-
IRegion2D verticle4 ={pos.x + (size.x * .885), pos.y , pos.x + (size.x * .885), height };
184+
IRegion2D verticle1 ={pos.x + static_cast<int>(size.x * .225), pos.y , pos.x + static_cast<int>(size.x * .225), height };
185+
IRegion2D verticle2 ={pos.x + static_cast<int>(size.x * .445), pos.y, pos.x + static_cast<int>(size.x * .445), height };
186+
IRegion2D verticle3 ={pos.x + static_cast<int>(size.x * .6662), pos.y, pos.x + static_cast<int>(size.x * .6662), height };
187+
IRegion2D verticle4 ={pos.x + static_cast<int>(size.x * .885), pos.y , pos.x + static_cast<int>(size.x * .885), height };
188188
// static IRegion2D verticle5 ={pos.x + (size.x * .7250), pos.y + (size.y * .12), pos.x + (size.x * .7250), pos.y + (size.y * .86) };
189189
// static IRegion2D verticle6 ={pos.x + (size.x * .9062), pos.y + (size.y * .12), pos.x + (size.x * .9062), pos.y + (size.y * .86) };
190190

@@ -236,19 +236,19 @@ void W3DMainMenuFourDraw( GameWindow *window, WinInstanceData *instData )
236236
IRegion2D topHorizontal1 ={pos.x, pos.y, pos.x + size.x, pos.y };
237237
IRegion2D topHorizontal1drop ={pos.x, pos.y+1, pos.x + size.x, pos.y+1 };
238238

239-
IRegion2D topHorizontal2 ={pos.x, pos.y + (size.y * .1) , pos.x + size.x, pos.y + (size.y * .1) };
240-
IRegion2D topHorizontal2drop ={pos.x, pos.y + (size.y * .12) , pos.x + size.x, pos.y + (size.y * .12) };
239+
IRegion2D topHorizontal2 ={pos.x, pos.y + static_cast<int>(size.y * .1) , pos.x + size.x, pos.y + static_cast<int>(size.y * .1) };
240+
IRegion2D topHorizontal2drop ={pos.x, pos.y + static_cast<int>(size.y * .12) , pos.x + size.x, pos.y + static_cast<int>(size.y * .12) };
241241

242-
IRegion2D bottomHorizontal1={pos.x, pos.y + (size.y * .9), pos.x + size.x, pos.y + (size.y * .9) };
243-
IRegion2D bottomHorizontal1drop={pos.x, pos.y + (size.y * .92), pos.x + size.x, pos.y + (size.y * .92) };
242+
IRegion2D bottomHorizontal1={pos.x, pos.y + static_cast<int>(size.y * .9), pos.x + size.x, pos.y + static_cast<int>(size.y * .9) };
243+
IRegion2D bottomHorizontal1drop={pos.x, pos.y + static_cast<int>(size.y * .92), pos.x + size.x, pos.y + static_cast<int>(size.y * .92) };
244244

245245
IRegion2D bottomHorizontal2= {pos.x, pos.y + size.y, pos.x + size.x, pos.y + size.y };
246246
IRegion2D bottomHorizontal2drop= {pos.x, pos.y + size.y + 1, pos.x + size.x, pos.y + size.y + 1 };
247247

248-
IRegion2D verticle1 ={pos.x + (size.x * .295), pos.y , pos.x + (size.x * .295), height };
249-
IRegion2D verticle2 ={pos.x + (size.x * .59), pos.y, pos.x + (size.x * .59), height };
248+
IRegion2D verticle1 ={pos.x + static_cast<int>(size.x * .295), pos.y , pos.x + static_cast<int>(size.x * .295), height };
249+
IRegion2D verticle2 ={pos.x + static_cast<int>(size.x * .59), pos.y, pos.x + static_cast<int>(size.x * .59), height };
250250
//IRegion2D verticle3 ={pos.x + (size.x * .6662), pos.y, pos.x + (size.x * .6662), height };
251-
IRegion2D verticle4 ={pos.x + (size.x * .885), pos.y , pos.x + (size.x * .885), height };
251+
IRegion2D verticle4 ={pos.x + static_cast<int>(size.x * .885), pos.y , pos.x + static_cast<int>(size.x * .885), height };
252252
// static IRegion2D verticle5 ={pos.x + (size.x * .7250), pos.y + (size.y * .12), pos.x + (size.x * .7250), pos.y + (size.y * .86) };
253253
// static IRegion2D verticle6 ={pos.x + (size.x * .9062), pos.y + (size.y * .12), pos.x + (size.x * .9062), pos.y + (size.y * .86) };
254254

0 commit comments

Comments
 (0)