Make it silent MSVC's trivial compilation warnings.

@Issue: https://github.com/thorvg/thorvg/issues/1381
This commit is contained in:
Hermet Park 2023-04-20 15:05:51 +09:00
parent eadca4ec9b
commit aa915ee1c4
5 changed files with 7 additions and 7 deletions

View file

@ -112,7 +112,7 @@ public:
"To avoid the heap overflow, the conversion to the PNG file made in " << WIDTH_8K << " x " << HEIGHT_8K << " resolution." << endl;
}
} else {
picture->size(w, h);
picture->size(static_cast<float>(w), static_cast<float>(h));
}
//Buffer
@ -134,7 +134,7 @@ public:
uint8_t b = (uint8_t)((bgColor & 0x0000ff));
auto shape = tvg::Shape::gen();
shape->appendRect(0, 0, w, h, 0, 0);
shape->appendRect(0, 0, static_cast<float>(w), static_cast<float>(h), 0, 0);
shape->fill(r, g, b, 255);
if (canvas->push(move(shape)) != tvg::Result::Success) return 1;

View file

@ -388,8 +388,8 @@ static void _lineTo(SwStroke& stroke, const SwPoint& to)
The scale needs to be reverted since the stroke width has not been scaled.
An alternative option is to scale the width of the stroke properly by
calculating the mixture of the sx/sy rating on the stroke direction. */
delta.x /= stroke.sx;
delta.y /= stroke.sy;
delta.x = static_cast<SwCoord>(delta.x / stroke.sx);
delta.y = static_cast<SwCoord>(delta.y / stroke.sy);
auto lineLength = mathLength(delta);
delta = {static_cast<SwCoord>(stroke.width), 0};

View file

@ -135,7 +135,7 @@ unique_ptr<Surface> JpgLoader::bitmap(uint32_t colorSpace)
if (!image) return nullptr;
if (this->colorSpace != colorSpace) {
this->colorSpace = colorSpace;
_changeColorSpace(reinterpret_cast<uint32_t*>(image), w, h);
_changeColorSpace(reinterpret_cast<uint32_t*>(image), static_cast<uint32_t>(w), static_cast<uint32_t>(h));
}
auto surface = static_cast<Surface*>(malloc(sizeof(Surface)));

View file

@ -192,7 +192,7 @@ unique_ptr<Surface> PngLoader::bitmap(uint32_t colorSpace)
if (!image) return nullptr;
if (this->colorSpace != colorSpace) {
this->colorSpace = colorSpace;
_changeColorSpace(reinterpret_cast<uint32_t*>(image), w, h);
_changeColorSpace(reinterpret_cast<uint32_t*>(image), static_cast<uint32_t>(w), static_cast<uint32_t>(h));
}
auto surface = static_cast<Surface*>(malloc(sizeof(Surface)));

View file

@ -95,7 +95,7 @@ unique_ptr<Surface> RawLoader::bitmap(uint32_t colorSpace)
if (!content) return nullptr;
if (this->colorSpace != colorSpace) {
this->colorSpace = colorSpace;
_changeColorSpace(content, w, h);
_changeColorSpace(content, static_cast<uint32_t>(w), static_cast<uint32_t>(h));
}
auto surface = static_cast<Surface*>(malloc(sizeof(Surface)));