[Ffmpeg-cvslog] r6251 - in trunk: libavcodec/utils.c libavformat/utils.c

takis subversion
Thu Sep 14 15:51:55 CEST 2006


Author: takis
Date: Thu Sep 14 15:51:54 2006
New Revision: 6251

Modified:
   trunk/libavcodec/utils.c
   trunk/libavformat/utils.c

Log:
Make OFFSET() reuse offsetof


Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c	(original)
+++ trunk/libavcodec/utils.c	Thu Sep 14 15:51:54 2006
@@ -438,7 +438,7 @@
         return "NULL";
 }
 
-#define OFFSET(x) (int)&((AVCodecContext*)0)->x
+#define OFFSET(x) offsetof(AVCodecContext,x)
 #define DEFAULT 0 //should be NAN but it doesnt work as its not a constant in glibc as required by ANSI/ISO C
 //these names are too long to be readable
 #define V AV_OPT_FLAG_VIDEO_PARAM

Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	(original)
+++ trunk/libavformat/utils.c	Thu Sep 14 15:51:54 2006
@@ -458,7 +458,7 @@
     else return "NULL";
 }
 
-#define OFFSET(x) (int)&((AVFormatContext*)0)->x
+#define OFFSET(x) offsetof(AVFormatContext,x)
 #define DEFAULT 0 //should be NAN but it doesnt work as its not a constant in glibc as required by ANSI/ISO C
 //these names are too long to be readable
 #define E AV_OPT_FLAG_ENCODING_PARAM




More information about the ffmpeg-cvslog mailing list