[FFmpeg-cvslog] r18856 - trunk/libavformat/oma.c
Uoti Urpala
uoti.urpala
Sat May 16 18:34:15 CEST 2009
On Sat, 2009-05-16 at 17:09 +0200, mru wrote:
> Author: mru
> Date: Sat May 16 17:09:30 2009
> New Revision: 18856
>
> Log:
> oma: fix build if memcmp() is a macro
>
> Any C library function may be a macro, so compound literals
> passed to memcmp() must be surrounded by parens to avoid being
> split on commas.
> - if (memcmp(buf, (const uint8_t[]){'E', 'A', '3'},3) || buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) {
> + if (memcmp(buf, ((const uint8_t[]){'E', 'A', '3'}),3) || buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) {
Is there any reason not to use the much simpler 'memcmp(buf, "EA3", 3)'?
The terminating 0 of string constants makes no difference here, and the
code doesn't look like it'd work anyway if the representations of char
and uint8_t would differ.
More information about the ffmpeg-cvslog
mailing list