diff mbox series

[FFmpeg-devel,3/6] avutil/common: put ERROR statements into separate code blocks in GET_UTF8/16

Message ID 20200129233235.3325-3-cus@passwd.hu
State New
Headers show
Series [FFmpeg-devel,1/6] avutil/common: use unsigned int in GET_UTF8
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Marton Balint Jan. 29, 2020, 11:32 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavutil/common.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Paul B Mahol Jan. 30, 2020, 10:42 a.m. UTC | #1
missing rationale explanation.

On 1/30/20, Marton Balint <cus@passwd.hu> wrote:
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  libavutil/common.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libavutil/common.h b/libavutil/common.h
> index 02671190a6..e6f076a13c 100644
> --- a/libavutil/common.h
> +++ b/libavutil/common.h
> @@ -387,11 +387,11 @@ static av_always_inline av_const int
> av_parity_c(uint32_t v)
>      {\
>          uint32_t top = (val & 128) >> 1;\
>          if ((val & 0xc0) == 0x80 || val >= 0xFE)\
> -            ERROR\
> +            {ERROR}\
>          while (val & top) {\
>              unsigned int tmp = (GET_BYTE) - 128;\
>              if(tmp>>6)\
> -                ERROR\
> +                {ERROR}\
>              val= (val<<6) + tmp;\
>              top <<= 5;\
>          }\
> @@ -414,7 +414,7 @@ static av_always_inline av_const int
> av_parity_c(uint32_t v)
>          if (hi < 0x800) {\
>              val = (GET_16BIT) - 0xDC00;\
>              if (val > 0x3FFU || hi > 0x3FFU)\
> -                ERROR\
> +                {ERROR}\
>              val += (hi<<10) + 0x10000;\
>          }\
>      }\
> --
> 2.16.4
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Marton Balint Jan. 30, 2020, 5:03 p.m. UTC | #2
On Thu, 30 Jan 2020, Paul B Mahol wrote:

> missing rationale explanation.

Patch 5 is using two statements as ERROR, without this the second 
statement is executed always and not only if the if condition is true.

>
> On 1/30/20, Marton Balint <cus@passwd.hu> wrote:
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>>  libavutil/common.h | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/libavutil/common.h b/libavutil/common.h
>> index 02671190a6..e6f076a13c 100644
>> --- a/libavutil/common.h
>> +++ b/libavutil/common.h
>> @@ -387,11 +387,11 @@ static av_always_inline av_const int
>> av_parity_c(uint32_t v)
>>      {\
>>          uint32_t top = (val & 128) >> 1;\
>>          if ((val & 0xc0) == 0x80 || val >= 0xFE)\
>> -            ERROR\
>> +            {ERROR}\
>>          while (val & top) {\
>>              unsigned int tmp = (GET_BYTE) - 128;\
>>              if(tmp>>6)\
>> -                ERROR\
>> +                {ERROR}\
>>              val= (val<<6) + tmp;\
>>              top <<= 5;\
>>          }\
>> @@ -414,7 +414,7 @@ static av_always_inline av_const int
>> av_parity_c(uint32_t v)
>>          if (hi < 0x800) {\
>>              val = (GET_16BIT) - 0xDC00;\
>>              if (val > 0x3FFU || hi > 0x3FFU)\
>> -                ERROR\
>> +                {ERROR}\
>>              val += (hi<<10) + 0x10000;\
>>          }\
>>      }\
>> --
>> 2.16.4
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
diff mbox series

Patch

diff --git a/libavutil/common.h b/libavutil/common.h
index 02671190a6..e6f076a13c 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -387,11 +387,11 @@  static av_always_inline av_const int av_parity_c(uint32_t v)
     {\
         uint32_t top = (val & 128) >> 1;\
         if ((val & 0xc0) == 0x80 || val >= 0xFE)\
-            ERROR\
+            {ERROR}\
         while (val & top) {\
             unsigned int tmp = (GET_BYTE) - 128;\
             if(tmp>>6)\
-                ERROR\
+                {ERROR}\
             val= (val<<6) + tmp;\
             top <<= 5;\
         }\
@@ -414,7 +414,7 @@  static av_always_inline av_const int av_parity_c(uint32_t v)
         if (hi < 0x800) {\
             val = (GET_16BIT) - 0xDC00;\
             if (val > 0x3FFU || hi > 0x3FFU)\
-                ERROR\
+                {ERROR}\
             val += (hi<<10) + 0x10000;\
         }\
     }\