aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPanagiotis Issaris <takis.issaris@uhasselt.be>2006-09-14 13:51:54 +0000
committerPanagiotis Issaris <takis.issaris@uhasselt.be>2006-09-14 13:51:54 +0000
commit66acccf05fe612e873b9ab04358c3b7a742b073d (patch)
tree614c64834f1979a17135ba062748c5e7b82b77fa
parent5894991f947721e4823cce695130d28b8a46bbc8 (diff)
downloadffmpeg-66acccf05fe612e873b9ab04358c3b7a742b073d.tar.gz
Make OFFSET() reuse offsetof
Originally committed as revision 6251 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/utils.c2
-rw-r--r--libavformat/utils.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index d2c09ca93e..3e41bd2962 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -438,7 +438,7 @@ static const char* context_to_name(void* ptr) {
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
diff --git a/libavformat/utils.c b/libavformat/utils.c
index b0171c0fb3..6df8bfd7ed 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -458,7 +458,7 @@ static const char* format_to_name(void* ptr)
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