fix msvc 2008 warning about downcasting to bool

the compiler doesn't have static_assert yet, so we ran into the path
which was not fixed by 10229ae.

use !!() pattern instead of bool() cast, as the latter throws off macx
(see 95d7abb). the other alternative - a c-style cast - would cause
autotest failures (see 92464fa), and would be ugly anyway.

Change-Id: Idbe9a3b60e17ae1f566f938d9b9be04f0c977492
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
This commit is contained in:
Oswald Buddenhagen 2012-02-07 19:05:27 +01:00 committed by Qt by Nokia
parent 6dc85408cd
commit dd84eab9d8

View File

@ -1031,7 +1031,7 @@ template <> class QStaticAssertFailure<true> {};
#define Q_STATIC_ASSERT_PRIVATE_JOIN(A, B) Q_STATIC_ASSERT_PRIVATE_JOIN_IMPL(A, B)
#define Q_STATIC_ASSERT_PRIVATE_JOIN_IMPL(A, B) A ## B
#define Q_STATIC_ASSERT(Condition) \
enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __LINE__) = sizeof(QStaticAssertFailure<(Condition)>)}
enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __LINE__) = sizeof(QStaticAssertFailure<!!(Condition)>)}
#define Q_STATIC_ASSERT_X(Condition, Message) Q_STATIC_ASSERT(Condition)
#endif