Mercurial > libavformat.hg
comparison oma.c @ 4943:6fd474401f0c libavformat
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.
author | mru |
---|---|
date | Sat, 16 May 2009 15:09:30 +0000 |
parents | 49c1d3b27727 |
children | 33a244b7ca65 |
comparison
equal
deleted
inserted
replaced
4942:02e9151a011e | 4943:6fd474401f0c |
---|---|
87 url_fseek(s->pb, EA3_pos, SEEK_SET); | 87 url_fseek(s->pb, EA3_pos, SEEK_SET); |
88 ret = get_buffer(s->pb, buf, EA3_HEADER_SIZE); | 88 ret = get_buffer(s->pb, buf, EA3_HEADER_SIZE); |
89 if (ret != EA3_HEADER_SIZE) | 89 if (ret != EA3_HEADER_SIZE) |
90 return -1; | 90 return -1; |
91 | 91 |
92 if (memcmp(buf, (const uint8_t[]){'E', 'A', '3'},3) || buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) { | 92 if (memcmp(buf, ((const uint8_t[]){'E', 'A', '3'}),3) || buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) { |
93 av_log(s, AV_LOG_ERROR, "Couldn't find the EA3 header !\n"); | 93 av_log(s, AV_LOG_ERROR, "Couldn't find the EA3 header !\n"); |
94 return -1; | 94 return -1; |
95 } | 95 } |
96 | 96 |
97 eid = AV_RB16(&buf[6]); | 97 eid = AV_RB16(&buf[6]); |
175 return ret; | 175 return ret; |
176 } | 176 } |
177 | 177 |
178 static int oma_read_probe(AVProbeData *p) | 178 static int oma_read_probe(AVProbeData *p) |
179 { | 179 { |
180 if (!memcmp(p->buf, (const uint8_t[]){'e', 'a', '3', 3, 0},5)) | 180 if (!memcmp(p->buf, ((const uint8_t[]){'e', 'a', '3', 3, 0}),5)) |
181 return AVPROBE_SCORE_MAX; | 181 return AVPROBE_SCORE_MAX; |
182 else | 182 else |
183 return 0; | 183 return 0; |
184 } | 184 } |
185 | 185 |