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

Loren Merritt lorenm at u.washington.edu
Mon Mar 17 22:50:54 CET 2008


On Mon, 17 Mar 2008, Måns Rullgård wrote:
> 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]
>>
>> --- 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.

Huh, I just pasted it from ffmpeg without looking for a standard include.

--Loren Merritt


More information about the x264-devel mailing list