Merge lp:~widelands-dev/widelands/avoid_wraparound into lp:widelands
Proposed by
SirVer
Status: | Merged |
---|---|
Merged at revision: | 7749 |
Proposed branch: | lp:~widelands-dev/widelands/avoid_wraparound |
Merge into: | lp:widelands |
Diff against target: |
489 lines (+81/-88) 12 files modified
src/graphic/rendertarget.cc (+2/-2) src/logic/editor_game_base.cc (+2/-3) src/logic/map_objects/tribes/ship.h (+0/-1) src/ui_basic/box.cc (+14/-14) src/ui_basic/box.h (+7/-7) src/ui_basic/panel.cc (+14/-14) src/ui_basic/panel.h (+18/-18) src/ui_basic/table.cc (+3/-3) src/ui_basic/tabpanel.cc (+4/-7) src/ui_basic/textarea.cc (+2/-2) src/ui_basic/window.cc (+13/-15) src/wui/ware_statistics_menu.cc (+2/-2) |
To merge this branch: | bzr merge lp:~widelands-dev/widelands/avoid_wraparound |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
kaputtnik (community) | Approve | ||
GunChleoc | Approve | ||
Review via email: mp+284067@code.launchpad.net |
Commit message
Switched overzealous uint32_t -> int to avoid underflow errors on minus arithmetic.
Description of the change
Fixes stripes of the port window.
The problem is that we do unsigned d = (unsized(0) - unsized(50)) / 2, which is is a huge number.
later we compare
2 *(d + ~50) < 1000
which is true, because we wrap around the other way again.
The solution is to never use unsigned integers unless absolutely needed. I changed a lot of pixel size to be int instead of uint32_t.
To post a comment you must log in.
Hi, I am bunnybot (https:/ /github. com/widelands/ bunnybot).
I am keeping the source branch lp:~widelands-dev/widelands/avoid_wraparound mirrored to https:/ /github. com/widelands/ widelands/ tree/_widelands _dev_widelands_ avoid_wraparoun d
You can give me commands by starting a line with @bunnybot <command>. I understand:
merge: Merges the source branch into the target branch, closing the merge proposal. I will use the proposed commit message if it is set.