[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

@@ -49,7 +49,7 @@ Values makeValues(const bool isText,
std::array<float, 2> extrudeScale;
if (values.pitchAlignment == AlignmentType::Map) {
extrudeScale.fill(tile.id.pixelsToTileUnits(1, state.getZoom()));
extrudeScale.fill(tile.id.pixelsToTileUnits(1.f, static_cast<float>(state.getZoom())));
} else {
extrudeScale = {{
pixelsToGLUnits[0] * state.getCameraToCenterDistance(),
@@ -57,7 +57,7 @@ Values makeValues(const bool isText,
}};
}
const float pixelsToTileUnits = tile.id.pixelsToTileUnits(1.0, state.getZoom());
const float pixelsToTileUnits = tile.id.pixelsToTileUnits(1.f, static_cast<float>(state.getZoom()));
const bool pitchWithMap = values.pitchAlignment == style::AlignmentType::Map;
const bool rotateWithMap = values.rotationAlignment == style::AlignmentType::Map;
@@ -137,8 +137,8 @@ SymbolSDFProgram<Name, PaintProperties>::layoutUniformValues(const bool isText,
const float symbolFadeChange,
const SymbolSDFPart part) {
const float gammaScale = (values.pitchAlignment == AlignmentType::Map
? std::cos(state.getPitch()) * state.getCameraToCenterDistance()
: 1.0);
? static_cast<float>(std::cos(state.getPitch())) * state.getCameraToCenterDistance()
: 1.0f);
return makeValues<SymbolSDFProgram<Name, PaintProperties>::LayoutUniformValues>(
isText,