]> git.saurik.com Git - wxWidgets.git/commit - include/wx/utils.h
Fix warnings about signed/unsigned comparisons inside wxMax() and friends.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 27 Oct 2010 20:23:55 +0000 (20:23 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 27 Oct 2010 20:23:55 +0000 (20:23 +0000)
commit2a0ca9dbafcdb76d95bca0319d29699ac1fefc64
tree50a90b2a42410f0966882b2eb865b4389bc3cf0e
parentf0f0542da6ba95ffab9b96580aadf5092cecfc71
Fix warnings about signed/unsigned comparisons inside wxMax() and friends.

wxMax, wxMin and wxClip work correctly when called with a mix of signed and
unsigned arguments but give warnings about comparing them when compiled with
g++.

Cast both arguments to the result type, which is defined consistently with
standard C rules for implicit promotion, before comparing them to avoid this.

Also add more tests to check that using these functions in this case doesn't
provoke warnings.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65933 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
include/wx/utils.h
tests/misc/metatest.cpp