From 9892d70c965678381d2a70a1c9002d1cf136ee78 Mon Sep 17 00:00:00 2001 From: Wan-Teh Chang Date: Wed, 3 Aug 2022 10:04:43 -0700 Subject: Fix MSVC warnings by adding casts Fix the following MSVC warnings: src\source\row_win.cc(117): warning C4309: 'argument': truncation of constant value src\source\row_win.cc(136): warning C4309: 'argument': truncation of constant value src\source\row_win.cc(155): warning C4309: 'argument': truncation of constant value src\source\row_win.cc(174): warning C4309: 'argument': truncation of constant value src\source\row_common.cc(1712): warning C4244: 'initializing': conversion from 'uint16_t' to 'int8_t', possible loss of data src\source\row_common.cc(1731): warning C4244: 'initializing': conversion from 'int16_t' to 'int8_t', possible loss of data src\source\row_common.cc(1786): warning C4244: 'initializing': conversion from 'uint16_t' to 'int8_t', possible loss of data src\source\row_common.cc(1805): warning C4244: 'initializing': conversion from 'uint16_t' to 'int8_t', possible loss of data Bug: libyuv:939 Change-Id: Ie87ba6e716732d1ff1ae5c236dfd9cfdac13439d Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3807105 Commit-Queue: Frank Barchard Reviewed-by: Frank Barchard --- source/row_common.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/row_common.cc') diff --git a/source/row_common.cc b/source/row_common.cc index f4e98762..83442496 100644 --- a/source/row_common.cc +++ b/source/row_common.cc @@ -1654,8 +1654,8 @@ MAKEYUVCONSTANTS(V2020, YG, YB, UB, UG, VG, VR) #define CALC_RGB16 \ int32_t y1 = ((uint32_t)(y32 * yg) >> 16) + yb; \ - int8_t ui = u; \ - int8_t vi = v; \ + int8_t ui = (int8_t)u; \ + int8_t vi = (int8_t)v; \ ui -= 0x80; \ vi -= 0x80; \ int b16 = y1 + (ui * ub); \ -- cgit v1.2.3