From 314598f31a01ed9419fcd68c13df28cff1b2fc4b Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Mon, 21 Oct 2019 12:04:19 +0100 Subject: COMPMID-2486: Fix bare arm64-v8.2-a builds Builds were failing due to possible integer overflow Change-Id: I4d2d106118c06596988f57bbad31bdf3567cdb5c Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/2132 Reviewed-by: Michele Di Giorgio Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- tests/validation/reference/ColorConvertHelper.h | 48 ++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/validation/reference/ColorConvertHelper.h b/tests/validation/reference/ColorConvertHelper.h index 8dd961c0f4..62eef82d11 100644 --- a/tests/validation/reference/ColorConvertHelper.h +++ b/tests/validation/reference/ColorConvertHelper.h @@ -437,15 +437,15 @@ inline void colorconvert_rgb_to_nv12(const SimpleTensor src, std::vector utmp(TensorShape{ src.shape().x() / 2, src.shape().y() }, Format::U8); SimpleTensor vtmp(TensorShape{ src.shape().x() / 2, src.shape().y() }, Format::U8); - int utmp_width = utmp.shape().x(); - int utmp_height = utmp.shape().y(); + uint32_t utmp_width = utmp.shape().x(); + uint32_t utmp_height = utmp.shape().y(); - int uvec_coord_x = 0; - int uvec_coord_y = 0; + uint32_t uvec_coord_x = 0; + uint32_t uvec_coord_y = 0; Coordinates uvec_coord{ uvec_coord_x, uvec_coord_y }; - for(int y = 0; y < utmp_height; y++) + for(uint32_t y = 0; y < utmp_height; y++) { - for(int x = 0; x < utmp_width; x++) + for(uint32_t x = 0; x < utmp_width; x++) { Coordinates coord{ x, y }; auto *utmp_pixel = reinterpret_cast(utmp(coord)); @@ -464,15 +464,15 @@ inline void colorconvert_rgb_to_nv12(const SimpleTensor src, std::vector src, std::vector utmp(TensorShape{ src.shape().x() / 2, src.shape().y() }, Format::U8); SimpleTensor vtmp(TensorShape{ src.shape().x() / 2, src.shape().y() }, Format::U8); - int utmp_width = utmp.shape().x(); - int utmp_height = utmp.shape().y(); + uint32_t utmp_width = utmp.shape().x(); + uint32_t utmp_height = utmp.shape().y(); - int uvec_coord_x = 0; - int uvec_coord_y = 0; + uint32_t uvec_coord_x = 0; + uint32_t uvec_coord_y = 0; Coordinates uvec_coord{ uvec_coord_x, uvec_coord_y }; - for(int y = 0; y < utmp_height; y++) + for(uint32_t y = 0; y < utmp_height; y++) { - for(int x = 0; x < utmp_width; x++) + for(uint32_t x = 0; x < utmp_width; x++) { Coordinates coord{ x, y }; auto *utmp_pixel = reinterpret_cast(utmp(coord)); @@ -551,15 +551,15 @@ inline void colorconvert_rgb_to_iyuv(const SimpleTensor src, std::vector