Skip to content

Commit 4d1c412

Browse files
GeoDaoyukgryte
andauthored
chore: fix C lint errors
PR-URL: #8392 Closes: #8391 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
1 parent 97fb507 commit 4d1c412

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

lib/node_modules/@stdlib/strided/base/dmskmap2/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,12 @@ static double add( const double x, const double y ) {
230230
return x + y;
231231
}
232232

233-
double X[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 };
234-
double Y[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 };
233+
const double X[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 };
234+
const double Y[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 };
235235
double Z[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
236-
uint8_t M[] = { 0, 0, 1, 0, 0, 1 };
236+
const uint8_t M[] = { 0, 0, 1, 0, 0, 1 };
237237

238-
int64_t N = 6;
238+
const int64_t N = 6;
239239

240240
stdlib_strided_dmskmap2( N, X, 1, Y, 1, M, 1, Z, 1, add );
241241
```
@@ -288,23 +288,23 @@ static double add( const double x, const double y ) {
288288

289289
int main( void ) {
290290
// Create input strided arrays:
291-
double X[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 };
292-
double Y[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 };
291+
const double X[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 };
292+
const double Y[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 };
293293

294294
// Create a mask strided array:
295-
uint8_t M[] = { 0, 0, 1, 0, 0, 1 };
295+
const uint8_t M[] = { 0, 0, 1, 0, 0, 1 };
296296

297297
// Create an output strided array:
298298
double Z[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
299299

300300
// Specify the number of elements:
301-
int64_t N = 6;
301+
const int64_t N = 6;
302302

303303
// Define the strides:
304-
int64_t strideX = 1;
305-
int64_t strideY = -1;
306-
int64_t strideZ = 1;
307-
int64_t strideM = 1;
304+
const int64_t strideX = 1;
305+
const int64_t strideY = -1;
306+
const int64_t strideZ = 1;
307+
const int64_t strideM = 1;
308308

309309
// Apply the callback:
310310
stdlib_strided_dmskmap2( N, X, strideX, Y, strideY, M, strideM, Z, strideZ, add );

lib/node_modules/@stdlib/strided/base/dmskmap2/examples/c/example.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,23 @@ static double add( const double x, const double y ) {
2828

2929
int main( void ) {
3030
// Create input strided arrays:
31-
double X[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 };
32-
double Y[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 };
31+
const double X[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 };
32+
const double Y[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 };
3333

3434
// Create a mask strided array:
35-
uint8_t M[] = { 0, 0, 1, 0, 0, 1 };
35+
const uint8_t M[] = { 0, 0, 1, 0, 0, 1 };
3636

3737
// Create an output strided array:
3838
double Z[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
3939

4040
// Specify the number of elements:
41-
int64_t N = 6;
41+
const int64_t N = 6;
4242

4343
// Define the strides:
44-
int64_t strideX = 1;
45-
int64_t strideY = -1;
46-
int64_t strideZ = 1;
47-
int64_t strideM = 1;
44+
const int64_t strideX = 1;
45+
const int64_t strideY = -1;
46+
const int64_t strideZ = 1;
47+
const int64_t strideM = 1;
4848

4949
// Apply the callback:
5050
stdlib_strided_dmskmap2( N, X, strideX, Y, strideY, M, strideM, Z, strideZ, add );

lib/node_modules/@stdlib/strided/base/smap/benchmark/c/benchmark.length.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ static double benchmark( int iterations, int len ) {
117117
}
118118
t = tic();
119119
for ( i = 0; i < iterations; i++ ) {
120+
// cppcheck-suppress uninitvar
120121
stdlib_strided_smap( len, x, 1, y, 1, identity );
121122
if ( y[ i%len ] != y[ i%len ] ) {
122123
printf( "should not return NaN\n" );

0 commit comments

Comments
 (0)