[msvc] Fix warnings, mainly casting to smaller types (#270)

If the checks by GitHub Actions checks are met, then it seems good to go.  Thanks for supporting FOSS4G!
This commit is contained in:
Tadej Novak
2022-04-22 20:40:55 +02:00
committed by GitHub
parent cf41e113f9
commit 32ed70c95d
121 changed files with 645 additions and 459 deletions

View File

@@ -27,12 +27,12 @@ TEST(FreeCameraOptions, SetLocation) {
ASSERT_THAT(options.position.value(), Vec3NearEquals1E7(vec3{{0.0, 0.4282409625, 0.000027532812465}}));
options.setLocation(
{{util::LATITUDE_MAX, 0.0}, util::EARTH_RADIUS_M * M_PI * std::cos(util::LATITUDE_MAX * util::DEG2RAD)});
{{util::LATITUDE_MAX, 0.0}, util::EARTH_RADIUS_M * M_PI * std::cos(util::LATITUDE_MAX * util::DEG2RAD_D)});
ASSERT_TRUE(options.position);
ASSERT_THAT(options.position.value(), Vec3NearEquals1E7(vec3{{0.5, 0.0, 0.5}}));
options.setLocation(
{{-util::LATITUDE_MAX, 0.0}, util::EARTH_RADIUS_M * M_PI * std::cos(-util::LATITUDE_MAX * util::DEG2RAD)});
{{-util::LATITUDE_MAX, 0.0}, util::EARTH_RADIUS_M * M_PI * std::cos(-util::LATITUDE_MAX * util::DEG2RAD_D)});
ASSERT_TRUE(options.position);
ASSERT_THAT(options.position.value(), Vec3NearEquals1E7(vec3{{0.5, 1.0, 0.5}}));
}
@@ -240,8 +240,8 @@ TEST(FreeCameraOptions, SetPitchBearing) {
ASSERT_THAT(up, Vec3NearEquals1E7(vec3{{0.0, 1.0, 0.0}}));
ASSERT_THAT(forward, Vec3NearEquals1E7(vec3{{0.0, 0.0, -1.0}}));
const double cos60 = std::cos(60.0 * util::DEG2RAD);
const double sin60 = std::sin(60.0 * util::DEG2RAD);
const double cos60 = std::cos(60.0 * util::DEG2RAD_D);
const double sin60 = std::sin(60.0 * util::DEG2RAD_D);
options.setPitchBearing(60.0, 0.0);
ASSERT_TRUE(options.orientation);
@@ -256,4 +256,4 @@ TEST(FreeCameraOptions, SetPitchBearing) {
ASSERT_THAT(right, Vec3NearEquals1E7(vec3{{0.0, 1.0, 0.0}}));
ASSERT_THAT(up, Vec3NearEquals1E7(vec3{{cos60, 0.0, sin60}}));
ASSERT_THAT(forward, Vec3NearEquals1E7(vec3{{sin60, 0.0, -cos60}}));
}
}