[x264-devel] commit: shut up gcc warning in offsetof (Loren Merritt )

Måns Rullgård mans at mansr.com
Mon Mar 17 10:18:42 CET 2008


git at videolan.org (git version control) writes:

> x264 | branch: master | Loren Merritt <pengvado at akuvian.org> | Mon Mar 17 01:23:35 2008 -0600| [4d9499b41be91645f27a7ca01e4a5a09d041ecbd]
>
> shut up gcc warning in offsetof
>
>> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=4d9499b41be91645f27a7ca01e4a5a09d041ecbd
> ---
>
>  common/common.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/common/common.h b/common/common.h
> index c4925f2..2c905b5 100644
> --- a/common/common.h
> +++ b/common/common.h
> @@ -37,7 +37,7 @@
>  #define FIX8(f) ((int)(f*(1<<8)+.5))
>
>  #ifndef offsetof
> -#define offsetof(T,F) ((unsigned int)((char *)&((T *)0)->F))
> +#define offsetof(T,F) ((unsigned long)((char *)&((T *)0)->F))
>  #endif

That type should be size_t to match the standard offsetof().  BTW,
what system is missing offsetof?  It's been in the C standard for
quite some time.

-- 
Måns Rullgård
mans at mansr.com


More information about the x264-devel mailing list