[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec bitstream.h,1.155,1.156

Michel Bardiaux mbardiaux
Thu Sep 22 10:35:46 CEST 2005


Rich Felker wrote:
> On Thu, Sep 22, 2005 at 01:18:54AM +0200, Aurelien Jacobs CVS wrote:
> 
>>Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
>>In directory mail:/var2/tmp/cvs-serv8633/libavcodec
>>
>>Modified Files:
>>	bitstream.h 
>>Log Message:
>>fix some pointer to intger without cast warnings (patch by Michel Bardiaux)
>>
>>Index: bitstream.h
>>===================================================================
>>RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/bitstream.h,v
>>retrieving revision 1.155
>>retrieving revision 1.156
>>diff -u -d -r1.155 -r1.156
>>--- bitstream.h	20 Sep 2005 18:51:12 -0000	1.155
>>+++ bitstream.h	21 Sep 2005 23:18:52 -0000	1.156
>>@@ -53,8 +53,10 @@
>> 
>> static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
>> {
>>-    if(buffer_size < 0)
>>-        buffer= buffer_size= 0;
> 
> 
> Can you explain how either of these involves a pointer to integer
> cast? IMO the old versions were fine.
> 
> Rich
> 
buffer= buffer_size= 0;

means

buffer=(buffer_size=0);

(buffer_size=0) evaluates to an integer expression, which generally may 
not be cast to a pointer without an explicit cast.

Of course, the compiler *could* notice that that expression evaluates to 
a constant which is necessarily zero, which it could cast to NULL then 
to pointer, without warning. But all that means is that one could debate 
whether *suppressing* the warning here is legitimate. Keeping it always 
will be legit.

HaND,
-- 
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux at mediaxim.be

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/





More information about the ffmpeg-cvslog mailing list