[FFmpeg-devel] [PATCH 15/15] vfwcap: Fix some warnings about incompatible pointer type
Michael Niedermayer
michaelni at gmx.at
Mon Jul 30 03:47:17 CEST 2012
On Sun, Jul 29, 2012 at 03:19:17PM -0300, jamal wrote:
> On 27/07/12 2:30 PM, Michael Niedermayer wrote:
> >> They are long, but av_parse_video_size() expects them to be int.
> >
> > i guess adding 2 long variables, using them and copying between them
> > and the int is the most correct way to solve this.
> > the cast would require sizeof(int) == sizeof(long) this may be true
> > for everything supporting vfw, but then it also maybe isnt true for
> > all, i dont know that ...
> >
> On Windows (32 bits and 64 bits) the size of both int and long is 4 bytes, so the cast should be fine: http://software.intel.com/en-us/articles/size-of-long-integer-type-on-different-architecture-and-os/ http://msdn.microsoft.com/en-us/library/aa383751%28v=vs.85%29.aspx
yes i know that but i do not know if all platforms that support vfw
are windows, nor do i know what future windows ABIs will do.
besides the code has undefined behavior due to C aliasing rules
violation probably even if the sizes match.
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120730/57b7ad85/attachment.asc>
More information about the ffmpeg-devel
mailing list