From dcd317e18fca8613ab10a094929e940c258fa41e Mon Sep 17 00:00:00 2001 From: Jay Soni Date: Wed, 19 Mar 2025 15:54:15 +0530 Subject: [PATCH 1/3] Fixed C lint errors --- .../stats/base/smeanors/benchmark/c/benchmark.length.c | 2 +- .../@stdlib/strided/base/dmskmap/examples/c/example.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/smeanors/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/stats/base/smeanors/benchmark/c/benchmark.length.c index 6d0d385a7436..18ec7a511a6f 100644 --- a/lib/node_modules/@stdlib/stats/base/smeanors/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/stats/base/smeanors/benchmark/c/benchmark.length.c @@ -96,7 +96,7 @@ static float rand_float( void ) { */ static double benchmark( int iterations, int len ) { double elapsed; - float x[ len ]; + double x[ len ]; float v; double t; int i; diff --git a/lib/node_modules/@stdlib/strided/base/dmskmap/examples/c/example.c b/lib/node_modules/@stdlib/strided/base/dmskmap/examples/c/example.c index b7f829860183..e91615871552 100644 --- a/lib/node_modules/@stdlib/strided/base/dmskmap/examples/c/example.c +++ b/lib/node_modules/@stdlib/strided/base/dmskmap/examples/c/example.c @@ -28,10 +28,10 @@ static double scale( const double x ) { int main( void ) { // Create an input strided array: - double X[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 }; + const double X[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 0, 1 }; + const uint8_t M[] = { 0, 0, 1, 0, 0, 1 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; From 56082440328d66f47435afab52768c5e105286d2 Mon Sep 17 00:00:00 2001 From: JaySoni1 Date: Wed, 19 Mar 2025 16:48:03 +0530 Subject: [PATCH 2/3] chore: fixed C lint errors --- .../@stdlib/stats/base/smeanors/benchmark/c/benchmark.length.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/stats/base/smeanors/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/stats/base/smeanors/benchmark/c/benchmark.length.c index 18ec7a511a6f..fad365ae317b 100644 --- a/lib/node_modules/@stdlib/stats/base/smeanors/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/stats/base/smeanors/benchmark/c/benchmark.length.c @@ -107,6 +107,7 @@ static double benchmark( int iterations, int len ) { v = 0.0f; t = tic(); for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar v = stdlib_strided_smeanors( len, x, 1 ); if ( v != v ) { printf( "should not return NaN\n" ); From 72f41b6d498ee27c22e2eea14ede2ac841e04072 Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 2 Apr 2025 16:46:18 -0700 Subject: [PATCH 3/3] chore: revert type change Signed-off-by: Athan --- .../@stdlib/stats/base/smeanors/benchmark/c/benchmark.length.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/base/smeanors/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/stats/base/smeanors/benchmark/c/benchmark.length.c index fad365ae317b..bc18c3311086 100644 --- a/lib/node_modules/@stdlib/stats/base/smeanors/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/stats/base/smeanors/benchmark/c/benchmark.length.c @@ -96,7 +96,7 @@ static float rand_float( void ) { */ static double benchmark( int iterations, int len ) { double elapsed; - double x[ len ]; + float x[ len ]; float v; double t; int i;