Merge lp:~amdmi3/stratagus/cxx11-narrowing into lp:stratagus

Proposed by Dmitry Marakasov
Status: Needs review
Proposed branch: lp:~amdmi3/stratagus/cxx11-narrowing
Merge into: lp:stratagus
Diff against target: 12 lines (+1/-1)
1 file modified
src/video/mng.cpp (+1/-1)
To merge this branch: bzr merge lp:~amdmi3/stratagus/cxx11-narrowing
Reviewer Review Type Date Requested Status
Kyran Jackson Pending
Review via email: mp+259063@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Kyran Jackson (erstmap) wrote :

Hell yeah, this was causing strife for me yesterday!

Unmerged revisions

9013. By Dmitry Marakasov

Fix c++11 narrowing error

src/video/mng.cpp:301:20: error: non-constant-expression cannot be narrowed from type 'int' to 'Sint16' (aka 'short') in initializer list [-Wc++11-narrowing]
                    SDL_Rect rect = {x, y, surface->w, surface->h};
                                     ^

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/video/mng.cpp'
2--- src/video/mng.cpp 2013-10-29 13:24:42 +0000
3+++ src/video/mng.cpp 2015-05-14 00:35:42 +0000
4@@ -298,7 +298,7 @@
5 } else
6 #endif
7 {
8- SDL_Rect rect = {x, y, surface->w, surface->h};
9+ SDL_Rect rect = {(Sint16)x, (Sint16)y, (Uint16)surface->w, (Uint16)surface->h};
10 SDL_BlitSurface(surface, NULL, TheScreen, &rect);
11 }
12 }

Subscribers

People subscribed via source and target branches

to status/vote changes: