[core] Make bool conversions explicit

Implicit bool conversions are bad; they'll be used e.g. for a == b and a != b if those operators are not defined. This was happening at 032c8fba3c/src/mbgl/map/transform.cpp (L132-L132), for example.
This commit is contained in:
John Firebaugh
2016-02-02 23:24:32 -08:00
parent 9beb6629b6
commit 235210c648
2 changed files with 13 additions and 6 deletions

View File

@@ -198,7 +198,6 @@ TEST(Transform, Anchor) {
ASSERT_NEAR(M_PI_4, transform.getAngle(), 0.000001);
ASSERT_NE(anchorLatLng, transform.getLatLng());
ASSERT_DOUBLE_EQ(anchorLatLng, transform.getState().pointToLatLng(anchorPoint));
}
TEST(Transform, Padding) {
@@ -224,7 +223,7 @@ TEST(Transform, Padding) {
EdgeInsets padding;
padding.top = 1000.0 / 2.0;
ASSERT_GT(padding.top, 0);
ASSERT_TRUE(padding);
ASSERT_TRUE(bool(padding));
const LatLng shiftedCenter = transform.getLatLng(padding);
ASSERT_NE(trueCenter.latitude, shiftedCenter.latitude);