# HG changeset patch # User aurel # Date 1224625224 0 # Node ID fcb9de59245f38c9f542d0056cef0dbafccb9ed1 # Parent f0580597dc48f561814fd5e5abcd579f6d1a23b7 uses FF_ARRAY_ELEMS() where appropriate diff -r f0580597dc48 -r fcb9de59245f img2.c --- a/img2.c Sun Oct 19 01:02:48 2008 +0000 +++ b/img2.c Tue Oct 21 21:40:24 2008 +0000 @@ -88,7 +88,7 @@ { int i; - for(i=0;i= (sizeof(mov_mdhd_language_map)/sizeof(char *))) + if (code >= FF_ARRAY_ELEMS(mov_mdhd_language_map)) return 0; if (!mov_mdhd_language_map[code]) return 0; diff -r f0580597dc48 -r fcb9de59245f matroskadec.c --- a/matroskadec.c Sun Oct 19 01:02:48 2008 +0000 +++ b/matroskadec.c Tue Oct 21 21:40:24 2008 +0000 @@ -226,8 +226,6 @@ EbmlList blocks; } MatroskaCluster; -#define ARRAY_SIZE(x) (sizeof(x)/sizeof(*x)) - static EbmlSyntax ebml_header[] = { { EBML_ID_EBMLREADVERSION, EBML_UINT, 0, offsetof(Ebml,version), {.u=EBML_VERSION} }, { EBML_ID_EBMLMAXSIZELENGTH, EBML_UINT, 0, offsetof(Ebml,max_size), {.u=8} }, @@ -980,7 +978,7 @@ int i, j; for (i=0; i < list->nb_elem; i++) { - for (j=0; j < ARRAY_SIZE(metadata); j++){ + for (j=0; j < FF_ARRAY_ELEMS(metadata); j++){ if (!strcmp(tags[i].name, metadata[j].name)) { int *ptr = (int *)((char *)s + metadata[j].offset); if (*ptr) continue; @@ -1050,7 +1048,7 @@ static const char * const aac_profiles[] = { "MAIN", "LC", "SSR" }; int profile; - for (profile=0; profilepb; int local_tag_number, i = 0; - local_tag_number = sizeof(mxf_local_tag_batch)/sizeof(*mxf_local_tag_batch); + local_tag_number = FF_ARRAY_ELEMS(mxf_local_tag_batch); put_buffer(pb, primer_pack_key, 16); klv_encode_ber_length(pb, local_tag_number * 18 + 8); @@ -754,8 +752,7 @@ { MXFContext *mxf = s->priv_data; int i; - uint8_t present[sizeof(mxf_essence_container_uls)/ - sizeof(*mxf_essence_container_uls)] = {0}; + uint8_t present[FF_ARRAY_ELEMS(mxf_essence_container_uls)] = {0}; for (i = 0; i < s->nb_streams; i++) { AVStream *st = s->streams[i]; diff -r f0580597dc48 -r fcb9de59245f utils.c --- a/utils.c Sun Oct 19 01:02:48 2008 +0000 +++ b/utils.c Tue Oct 21 21:40:24 2008 +0000 @@ -2904,7 +2904,7 @@ q = NULL; if (!duration) { /* parse the year-month-day part */ - for (i = 0; i < sizeof(date_fmt) / sizeof(date_fmt[0]); i++) { + for (i = 0; i < FF_ARRAY_ELEMS(date_fmt); i++) { q = small_strptime(p, date_fmt[i], &dt); if (q) { break; @@ -2928,7 +2928,7 @@ p++; /* parse the hour-minute-second part */ - for (i = 0; i < sizeof(time_fmt) / sizeof(time_fmt[0]); i++) { + for (i = 0; i < FF_ARRAY_ELEMS(time_fmt); i++) { q = small_strptime(p, time_fmt[i], &dt); if (q) { break;