diff mbox series

[FFmpeg-devel,7/7] avutil/integer: Use '|' instead of '+' where it is more natural

Message ID AS8P250MB0744CDA3AB6D01572B08613A8F2D9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Headers show
Series [FFmpeg-devel,1/7] avcodec/snow_dwt: Fix left shifts of negative numbers | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 21, 2022, 6:59 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavutil/integer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavutil/integer.c b/libavutil/integer.c
index a692c3783c..d0a0f62c9a 100644
--- a/libavutil/integer.c
+++ b/libavutil/integer.c
@@ -104,7 +104,7 @@  AVInteger av_shr_i(AVInteger a, int s){
         unsigned int index= i + (s>>4);
         unsigned int v=0;
         if (index + 1 < AV_INTEGER_SIZE) v  = a.v[index + 1] * (1U << 16);
-        if(index  <AV_INTEGER_SIZE) v+= a.v[index  ];
+        if (index     < AV_INTEGER_SIZE) v |= a.v[index];
         out.v[i]= v >> (s&15);
     }
     return out;
@@ -161,6 +161,6 @@  int64_t av_i2int(AVInteger a){
     uint64_t out = 0;
 
     for (int i = 3; i >= 0; i--)
-        out = (out<<16) + a.v[i];
+        out = (out << 16) | a.v[i];
     return out;
 }