sw_engine: fix comparison of integer expressions of different signedness 18/269618/1
authorMichal Maciola <m.maciola@samsung.com>
Fri, 14 Jan 2022 13:19:55 +0000 (14:19 +0100)
committerChun <jykeon@samsung.com>
Wed, 19 Jan 2022 07:12:44 +0000 (07:12 +0000)
Some gcc versions and configurations was giving an error:
error: "comparison of integer expressions of different signedness: 'const SwCoord'
{aka 'const long int'} and 'uint32_t' {aka 'unsigned int'} [-Werror=sign-compare]"
This patch should fix the error

Change-Id: Ie683f35220b130b3548d0059ffe130fa4fc53fdc

src/lib/sw_engine/tvgSwRaster.cpp

index 07a8561af037afad3d71047db78ed6e23c48ac81..88be44a4dda0c128db7833f5e23e6f6404218b79 100644 (file)
@@ -1904,7 +1904,7 @@ bool rasterStroke(SwSurface* surface, SwShape* shape, uint8_t r, uint8_t g, uint
 bool rasterImage(SwSurface* surface, SwImage* image, const Matrix* transform, const SwBBox& bbox, uint32_t opacity)
 {
     //Verify Boundary
-    if (bbox.max.x < 0 || bbox.max.y < 0 || bbox.min.x >= surface->w || bbox.min.y >= surface->h) return false;
+    if (bbox.max.x < 0 || bbox.max.y < 0 || bbox.min.x >= static_cast<SwCoord>(surface->w) || bbox.min.y >= static_cast<SwCoord>(surface->h)) return false;
 
     //TOOD: switch (image->format)
     //TODO: case: _rasterRGBImage()