From c9b7da9efb975d3a0b5a7e42be4f8ce86df5aaa5 Mon Sep 17 00:00:00 2001 From: Mandeep2333 Date: Mon, 30 Mar 2026 11:20:42 +0530 Subject: [PATCH 1/3] c lint error fix --- .../base/zmap/benchmark/c/benchmark.length.c | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/lib/node_modules/@stdlib/strided/base/zmap/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/strided/base/zmap/benchmark/c/benchmark.length.c index 7de57c90dbdf..d37baaf9878f 100644 --- a/lib/node_modules/@stdlib/strided/base/zmap/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/strided/base/zmap/benchmark/c/benchmark.length.c @@ -106,29 +106,33 @@ static double complex identity( const double complex x ) { * @return elapsed time in seconds */ static double benchmark( int iterations, int len ) { - double complex x[ len ]; - double complex y[ len ]; - double elapsed; - double t; - int i; + double complex x[ len ]; + double complex y[ len ]; + double elapsed; + double t; + int i; - for ( i = 0; i < len; i++ ) { - x[ i ] = ( ( rand_double()*200.0 ) - 100.0 ) + ( ( rand_double()*200.0 ) - 100.0 )*I; - y[ i ] = 0.0 + 0.0*I; - } - t = tic(); - for ( i = 0; i < iterations; i++ ) { - stdlib_strided_zmap( len, x, 1, y, 1, identity ); - if ( y[ i%len ] != y[ i%len ] ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( y[ i%len ] != y[ i%len ] ) { - printf( "should not return NaN\n" ); - } - return elapsed; + for ( i = 0; i < len; i++ ) { + x[ i ] = ( ( rand_double()*200.0 ) - 100.0 ) + ( ( rand_double()*200.0 ) - 100.0 )*I; + y[ i ] = 0.0 + 0.0*I; + } + + t = tic(); + for ( i = 0; i < iterations; i++ ) { + stdlib_strided_zmap( len, x, 1, y, 1, identity ); + + // Use a stable index for the check to avoid any "out of bounds" linter noise + if ( y[ 0 ] != y[ 0 ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + + if ( y[ 0 ] != y[ 0 ] ) { + printf( "should not return NaN\n" ); + } + return elapsed; } /** From 93eedf7b3b8b963887b5a348e33bb7bd52b83ec3 Mon Sep 17 00:00:00 2001 From: Mandeep2333 Date: Mon, 30 Mar 2026 11:38:25 +0530 Subject: [PATCH 2/3] fix c lint error --- .../strided/base/zmap/benchmark/c/benchmark.length.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/strided/base/zmap/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/strided/base/zmap/benchmark/c/benchmark.length.c index d37baaf9878f..bbee9c0b5300 100644 --- a/lib/node_modules/@stdlib/strided/base/zmap/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/strided/base/zmap/benchmark/c/benchmark.length.c @@ -106,8 +106,8 @@ static double complex identity( const double complex x ) { * @return elapsed time in seconds */ static double benchmark( int iterations, int len ) { - double complex x[ len ]; - double complex y[ len ]; + double complex *x = malloc( len * sizeof(double complex) ); + double complex *y = malloc( len * sizeof(double complex) ); double elapsed; double t; int i; @@ -120,8 +120,6 @@ static double benchmark( int iterations, int len ) { t = tic(); for ( i = 0; i < iterations; i++ ) { stdlib_strided_zmap( len, x, 1, y, 1, identity ); - - // Use a stable index for the check to avoid any "out of bounds" linter noise if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); break; @@ -132,6 +130,8 @@ static double benchmark( int iterations, int len ) { if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); + free( y ); return elapsed; } @@ -152,8 +152,8 @@ int main( void ) { print_version(); count = 0; for ( i = MIN; i <= MAX; i++ ) { - len = pow( 10, i ); - iter = ITERATIONS / pow( 10, i-1 ); + len = (int)pow( 10, i ); + iter = ITERATIONS / (int)pow( 10, i-1 ); for ( j = 0; j < REPEATS; j++ ) { count += 1; printf( "# c::%s:len=%d\n", NAME, len ); From 1e2f7d718cf5dc522b967baf09141fe57e8111c5 Mon Sep 17 00:00:00 2001 From: Mandeep2333 Date: Mon, 30 Mar 2026 11:49:34 +0530 Subject: [PATCH 3/3] fix c lint error --- .../base/zmap/benchmark/c/benchmark.length.c | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/node_modules/@stdlib/strided/base/zmap/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/strided/base/zmap/benchmark/c/benchmark.length.c index bbee9c0b5300..d43f775755ef 100644 --- a/lib/node_modules/@stdlib/strided/base/zmap/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/strided/base/zmap/benchmark/c/benchmark.length.c @@ -106,33 +106,33 @@ static double complex identity( const double complex x ) { * @return elapsed time in seconds */ static double benchmark( int iterations, int len ) { - double complex *x = malloc( len * sizeof(double complex) ); - double complex *y = malloc( len * sizeof(double complex) ); - double elapsed; - double t; - int i; + double complex *x = malloc( len * sizeof(double complex) ); + double complex *y = malloc( len * sizeof(double complex) ); + double elapsed; + double t; + int i; - for ( i = 0; i < len; i++ ) { - x[ i ] = ( ( rand_double()*200.0 ) - 100.0 ) + ( ( rand_double()*200.0 ) - 100.0 )*I; - y[ i ] = 0.0 + 0.0*I; - } + for ( i = 0; i < len; i++ ) { + x[ i ] = ( ( rand_double()*200.0 ) - 100.0 ) + ( ( rand_double()*200.0 ) - 100.0 )*I; + y[ i ] = 0.0 + 0.0*I; + } - t = tic(); - for ( i = 0; i < iterations; i++ ) { - stdlib_strided_zmap( len, x, 1, y, 1, identity ); - if ( y[ 0 ] != y[ 0 ] ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; + t = tic(); + for ( i = 0; i < iterations; i++ ) { + stdlib_strided_zmap( len, x, 1, y, 1, identity ); + if ( y[ 0 ] != y[ 0 ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; - if ( y[ 0 ] != y[ 0 ] ) { - printf( "should not return NaN\n" ); - } - free( x ); - free( y ); - return elapsed; + if ( y[ 0 ] != y[ 0 ] ) { + printf( "should not return NaN\n" ); + } + free( x ); + free( y ); + return elapsed; } /**