Skip to content

Commit 0ccda74

Browse files
GeoDaoyukgryte
andauthored
chore: fix C lint errors
PR-URL: #8199 Closes: #8196 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
1 parent 72317f7 commit 0ccda74

File tree

1 file changed

+4
-4
lines changed
  • lib/node_modules/@stdlib/ndarray/base/minmax-view-buffer-index/benchmark/c

1 file changed

+4
-4
lines changed

lib/node_modules/@stdlib/ndarray/base/minmax-view-buffer-index/benchmark/c/benchmark.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ static double benchmark( void ) {
9696
int i;
9797

9898
int64_t out[ 2 ];
99-
int64_t shape[] = { 10, 10, 10 };
99+
const int64_t shape[] = { 10, 10, 10 };
100100
int64_t strides[] = { 100, 10, 1 };
101-
int64_t offset = 1000;
102-
int64_t ndims = 3;
101+
const int64_t offset = 1000;
102+
const int64_t ndims = 3;
103103

104104
t = tic();
105105
for ( i = 0; i < ITERATIONS; i++ ) {
106-
strides[ 0 ] *= ( rand_double() < 0.5 ) ? 1 : -1;
106+
strides[ 0 ] = ( i%2 ) ? 100 : -100;
107107
stdlib_ndarray_minmax_view_buffer_index( ndims, shape, strides, offset, out );
108108
if ( out[ 0 ] > 1e10 ) {
109109
printf( "unexpected result\n" );

0 commit comments

Comments
 (0)