shithub: libsamplerate

Download patch

ref: 401489195c8eae5f6897ec69df5d5b36840f39a8
parent: ef823b1fe6179b919281f32e96712dfb559d1091
author: Erik de Castro Lopo <erikd@miles>
date: Sun Jul 4 21:39:49 EDT 2004

Use ARRAY_LEN macro in sinc_set_converter().

--- a/src/src_sinc.c
+++ b/src/src_sinc.c
@@ -173,26 +173,26 @@
 	switch (src_enum)
 	{	case SRC_SINC_BEST_QUALITY :
 				temp_filter.coeffs = high_qual_coeffs ;
-				temp_filter.coeff_half_len = (sizeof (high_qual_coeffs) / sizeof (coeff_t)) - 1 ;
+				temp_filter.coeff_half_len = ARRAY_LEN (high_qual_coeffs) - 1 ;
 				temp_filter.index_inc = 128 ;
 				temp_filter.has_diffs = SRC_FALSE ;
-				temp_filter.coeff_len = sizeof (high_qual_coeffs) / sizeof (coeff_t) ;
+				temp_filter.coeff_len = ARRAY_LEN (high_qual_coeffs) ;
 				break ;
 
 		case SRC_SINC_MEDIUM_QUALITY :
 				temp_filter.coeffs = mid_qual_coeffs ;
-				temp_filter.coeff_half_len = (sizeof (mid_qual_coeffs) / sizeof (coeff_t)) - 1 ;
+				temp_filter.coeff_half_len = ARRAY_LEN (mid_qual_coeffs) - 1 ;
 				temp_filter.index_inc = 128 ;
 				temp_filter.has_diffs = SRC_FALSE ;
-				temp_filter.coeff_len = sizeof (mid_qual_coeffs) / sizeof (coeff_t) ;
+				temp_filter.coeff_len = ARRAY_LEN (mid_qual_coeffs) ;
 				break ;
 
 		case SRC_SINC_FASTEST :
 				temp_filter.coeffs = fastest_coeffs ;
-				temp_filter.coeff_half_len = (sizeof (fastest_coeffs) / sizeof (coeff_t)) - 1 ;
+				temp_filter.coeff_half_len = ARRAY_LEN (fastest_coeffs) - 1 ;
 				temp_filter.index_inc = 128 ;
 				temp_filter.has_diffs = SRC_FALSE ;
-				temp_filter.coeff_len = sizeof (fastest_coeffs) / sizeof (coeff_t) ;
+				temp_filter.coeff_len = ARRAY_LEN (fastest_coeffs) ;
 				break ;
 
 		default :