[x265] [PATCH 1/3] AArch64: Fix implicit conversion from ptrdiff_t to int

Hari Limaye hari.limaye at arm.com
Tue Aug 20 17:42:00 UTC 2024


In common/aarch64/loopfilter-prim.cpp there is a function call to abs()
with the result of subtracting two pointer types, which results in an
implicit cast from ptrdiff_t to int as abs() is only defined for int
prior to C++11 (and x265 uses gnu++98).

Make conversion from ptrdiff_t to int explicit by using a cast in
common/aarch64/loopfilter-prim.cpp.
---
 source/common/aarch64/loopfilter-prim.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/common/aarch64/loopfilter-prim.cpp b/source/common/aarch64/loopfilter-prim.cpp
index 2b709cf70..8769d53ec 100644
--- a/source/common/aarch64/loopfilter-prim.cpp
+++ b/source/common/aarch64/loopfilter-prim.cpp
@@ -158,7 +158,7 @@ static void processSaoCUE2_neon(pixel *rec, int8_t *bufft, int8_t *buff1, int8_t
 {
     int x;
 
-    if (abs(buff1 - bufft) < 16)
+    if (abs(static_cast<int>(buff1 - bufft)) < 16)
     {
         for (x = 0; x < width; x++)
         {
-- 
2.42.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-AArch64-Fix-implicit-conversion-from-ptrdiff_t-to-in.patch
Type: text/x-patch
Size: 1383 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20240820/3765073d/attachment.bin>


More information about the x265-devel mailing list