[Ffmpeg-devel] pointers cast to ints
Jacob Meuser
jakemsr
Mon May 9 12:26:09 CEST 2005
gcc gave some warnings about these. I only saw one other use
of intptr_t in FFmpeg sources, so ...
--
<jakemsr at jakemsr.com>
-------------- next part --------------
Index: libavcodec/h264.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/h264.c,v
retrieving revision 1.121
diff -u -r1.121 h264.c
--- libavcodec/h264.c 7 May 2005 11:07:47 -0000 1.121
+++ libavcodec/h264.c 9 May 2005 09:12:05 -0000
@@ -369,7 +369,7 @@
w *= size;
stride *= size;
- assert((((int)vp)&(FFMIN(w, STRIDE_ALIGN)-1)) == 0);
+ assert((((uintptr_t)vp)&(FFMIN(w, STRIDE_ALIGN)-1)) == 0);
//FIXME check what gcc generates for 64 bit on x86 and possibly write a 32 bit ver of it
if(w==2 && h==2){
*(uint16_t*)(p + 0)=
Index: libavcodec/mem.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mem.c,v
retrieving revision 1.12
diff -u -r1.12 mem.c
--- libavcodec/mem.c 24 Feb 2005 19:08:49 -0000 1.12
+++ libavcodec/mem.c 9 May 2005 09:12:05 -0000
@@ -55,7 +55,7 @@
#ifdef MEMALIGN_HACK
ptr = malloc(size+16+1);
- diff= ((-(int)ptr - 1)&15) + 1;
+ diff= ((-(uintptr_t)ptr - 1)&15) + 1;
ptr += diff;
((char*)ptr)[-1]= diff;
#elif defined (HAVE_MEMALIGN)
More information about the ffmpeg-devel
mailing list