Skip to content

Commit 222f82c

Browse files
chore: fix C lint errors
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent b0467c4 commit 222f82c

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/node_modules/@stdlib/blas/ext/base/dsnannsumors/benchmark/c/benchmark.length.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,6 @@ static double benchmark1( int iterations, int len ) {
102102
double t;
103103
int i;
104104

105-
/* Initialize array to silence warning */
106-
for ( i = 0; i < len; i++ ) {
107-
x[ i ] = 0;
108-
}
109-
110105
for ( i = 0; i < len; i++ ) {
111106
if ( rand_float() < 0.2f ) {
112107
x[ i ] = 0.0f / 0.0f; // NaN
@@ -118,6 +113,7 @@ static double benchmark1( int iterations, int len ) {
118113
n = 0;
119114
t = tic();
120115
for ( i = 0; i < iterations; i++ ) {
116+
/* cppcheck-suppress uninitvar */
121117
v = stdlib_strided_dsnannsumors( len, x, 1, &n );
122118
if ( v != v || n < 0 ) {
123119
printf( "should not return NaN\n" );
@@ -146,11 +142,6 @@ static double benchmark2( int iterations, int len ) {
146142
double t;
147143
int i;
148144

149-
/* Initialize array to silence warning */
150-
for ( i = 0; i < len; i++ ) {
151-
x[ i ] = 0;
152-
}
153-
154145
for ( i = 0; i < len; i++ ) {
155146
if ( rand_float() < 0.2f ) {
156147
x[ i ] = 0.0f / 0.0f; // NaN
@@ -162,6 +153,7 @@ static double benchmark2( int iterations, int len ) {
162153
n = 0;
163154
t = tic();
164155
for ( i = 0; i < iterations; i++ ) {
156+
/* cppcheck-suppress uninitvar */
165157
v = stdlib_strided_dsnannsumors_ndarray( len, x, 1, 0, &n );
166158
if ( v != v || n < 0 ) {
167159
printf( "should not return NaN\n" );

0 commit comments

Comments
 (0)