[vlc-devel] [PATCH] codec: cea708: fix warning
Rémi Denis-Courmont
remi at remlab.net
Mon Jan 21 09:20:07 CET 2019
What value of c is treated differently? I cannot find such from a quick look. In fact, it looks to me that there are still some tautologies left in the code.
Le 21 janvier 2019 09:38:24 GMT+02:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>On 18/01/2019 17:51, Johan Gunnarsson wrote:
>> codec/cea708.c:1649:18: warning: variable 'i_ret' is used
>uninitialized whenever 'if' condition is false
>[-Wsometimes-uninitialized]
>> else if( c > 0x9F )
>> ^~~~~~~~
>> codec/cea708.c:1652:13: note: uninitialized use occurs here
>> if( i_ret & CEA708_STATUS_OUTPUT )
>> ^~~~~
>> codec/cea708.c:1649:14: note: remove the 'if' if its condition is
>always true
>> else if( c > 0x9F )
>> ^~~~~~~~~~~~~~
>> codec/cea708.c:1640:18: note: initialize the variable 'i_ret' to
>silence this warning
>> int i_ret;
>> ^
>> = 0
>> 1 warning generated.
>> ---
>> modules/codec/cea708.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/modules/codec/cea708.c b/modules/codec/cea708.c
>> index c0cea476f7..e56b8779ed 100644
>> --- a/modules/codec/cea708.c
>> +++ b/modules/codec/cea708.c
>> @@ -1642,11 +1642,11 @@ static void CEA708_Decode_ServiceBuffer(
>cea708_t *h )
>>
>> if( c < 0x20 )
>> i_ret = CEA708_Decode_C0( c, h );
>> - else if( c >= 0x20 && c <=0x7F )
>> + else if( c >= 0x20 && c <= 0x7F )
>> i_ret = CEA708_Decode_G0( c, h );
>> else if( c >= 0x80 && c <= 0x9F )
>> i_ret = CEA708_Decode_C1( c, h );
>> - else if( c > 0x9F )
>> + else
>> i_ret = CEA708_Decode_G1( c, h );
>
>This is not fixing a benign warning, it's changing the behavior of the
>code as well. If c is neither of these values maybe i_ret should have
>an
>error value.
>
>>
>> if( i_ret & CEA708_STATUS_OUTPUT )
>> --
>> 2.17.1
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel
--
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190121/a061aafa/attachment.html>
More information about the vlc-devel
mailing list