[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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user