Skip to content

Commit b0467c4

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 ef4372f commit b0467c4

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,17 @@ static float rand_float( void ) {
9696
*/
9797
static double benchmark1( int iterations, int len ) {
9898
double elapsed;
99-
float x[ len ] = {0}; /* Initialize array to silence warning */
100-
int64_t n;
99+
float x[ len ];
100+
CBLAS_INT n; /* silence warning about incompatible pointer type */
101101
double v;
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+
105110
for ( i = 0; i < len; i++ ) {
106111
if ( rand_float() < 0.2f ) {
107112
x[ i ] = 0.0f / 0.0f; // NaN
@@ -135,12 +140,17 @@ static double benchmark1( int iterations, int len ) {
135140
*/
136141
static double benchmark2( int iterations, int len ) {
137142
double elapsed;
138-
float x[ len ] = {0}; /* Initialize array to silence warning */
139-
int64_t n;
143+
float x[ len ];
144+
CBLAS_INT n; /* silence warning about incompatible pointer type */
140145
double v;
141146
double t;
142147
int i;
143148

149+
/* Initialize array to silence warning */
150+
for ( i = 0; i < len; i++ ) {
151+
x[ i ] = 0;
152+
}
153+
144154
for ( i = 0; i < len; i++ ) {
145155
if ( rand_float() < 0.2f ) {
146156
x[ i ] = 0.0f / 0.0f; // NaN

0 commit comments

Comments
 (0)