]> granicus.if.org Git - libx264/commitdiff
Remove ARRAY_SIZE macro which is identical to ARRAY_ELEMS
authorAnton Mitrofanov <BugMaster@narod.ru>
Wed, 17 Jan 2018 19:03:06 +0000 (22:03 +0300)
committerHenrik Gramner <henrik@gramner.com>
Thu, 18 Jan 2018 20:03:22 +0000 (21:03 +0100)
common/base.h
common/opencl.c
tools/checkasm.c

index cb990ff0f628796382694021dce1a1b7d7856b16..145220ba99701e5997374af63c9266faf703f5db 100644 (file)
@@ -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 )
 
index 50298ab0001b762fc21985e8135a6342cb8711fe..cebf9338740d7d258b70a5457638d4d4274c1430 100644 (file)
@@ -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 )
index 0fed4c8b0fda295b240fc09d99b1d2101f13806d..440e1d23c98c3d021eb9bd2582f972a71ddcdb16 100644 (file)
@@ -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];