From: Anton Mitrofanov Date: Wed, 17 Jan 2018 19:03:06 +0000 (+0300) Subject: Remove ARRAY_SIZE macro which is identical to ARRAY_ELEMS X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d0ff22e8c96de126be9d3de4952edd6d1b75a8c;p=libx264 Remove ARRAY_SIZE macro which is identical to ARRAY_ELEMS --- diff --git a/common/base.h b/common/base.h index cb990ff0..145220ba 100644 --- a/common/base.h +++ b/common/base.h @@ -55,7 +55,6 @@ #define XCHG(type,a,b) do { type t = a; a = b; b = t; } while( 0 ) #define FIX8(f) ((int)(f*(1<<8)+.5)) #define ARRAY_ELEMS(a) ((sizeof(a))/(sizeof(a[0]))) -#define ARRAY_SIZE(array) (sizeof(array)/sizeof(array[0])) #define ALIGN(x,a) (((x)+((a)-1))&~((a)-1)) #define IS_DISPOSABLE(type) ( type == X264_TYPE_B ) diff --git a/common/opencl.c b/common/opencl.c index 50298ab0..cebf9338 100644 --- a/common/opencl.c +++ b/common/opencl.c @@ -364,7 +364,7 @@ static int opencl_lookahead_alloc( x264_t *h ) if( !h->opencl.lookahead_program ) goto fail; - for( int i = 0; i < ARRAY_SIZE(kernelnames); i++ ) + for( int i = 0; i < ARRAY_ELEMS(kernelnames); i++ ) { *kernels[i] = ocl->clCreateKernel( h->opencl.lookahead_program, kernelnames[i], &status ); if( status != CL_SUCCESS ) diff --git a/tools/checkasm.c b/tools/checkasm.c index 0fed4c8b..440e1d23 100644 --- a/tools/checkasm.c +++ b/tools/checkasm.c @@ -1808,7 +1808,7 @@ static int check_mc( int cpu_ref, int cpu_new ) float *fix8_src = (float*)(buf3 + 0x800); uint16_t *dstc = (uint16_t*)buf3; uint16_t *dsta = (uint16_t*)buf4; - for( int i = 0; i < ARRAY_SIZE(mbtree_fix8_counts); i++ ) + for( int i = 0; i < ARRAY_ELEMS(mbtree_fix8_counts); i++ ) { int count = mbtree_fix8_counts[i]; @@ -1835,7 +1835,7 @@ static int check_mc( int cpu_ref, int cpu_new ) uint16_t *fix8_src = (uint16_t*)(buf3 + 0x800); float *dstc = (float*)buf3; float *dsta = (float*)buf4; - for( int i = 0; i < ARRAY_SIZE(mbtree_fix8_counts); i++ ) + for( int i = 0; i < ARRAY_ELEMS(mbtree_fix8_counts); i++ ) { int count = mbtree_fix8_counts[i];