Skip to content

Commit 85717ed

Browse files
committed
refactor: apply suggestions from code review
--- 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: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 2e393b9 commit 85717ed

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

  • lib/node_modules/@stdlib/blas/ext/base/dcartesian-power/src

lib/node_modules/@stdlib/blas/ext/base/dcartesian-power/src/main.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "stdlib/math/base/special/pow.h"
2121
#include "stdlib/blas/base/shared.h"
2222
#include "stdlib/strided/base/stride2offset.h"
23+
#include <stdint.h>
2324

2425
/**
2526
* Computes the Cartesian power for a double-precision floating-point strided array.
@@ -33,7 +34,7 @@
3334
* @param strideOut2 stride length between elements within each output pair
3435
*/
3536
void API_SUFFIX(stdlib_strided_dcartesian_power)( const CBLAS_INT N, const CBLAS_INT k, const double *X, const CBLAS_INT strideX, double *Out, const CBLAS_INT strideOut1, const CBLAS_INT strideOut2 ) {
36-
CBLAS_INT len = stdlib_base_pow( N, k );
37+
int64_t len = (int64_t)stdlib_base_pow( N, k );
3738
CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX );
3839
CBLAS_INT oo = stdlib_strided_stride2offset( len, strideOut1 ) + stdlib_strided_stride2offset( k, strideOut2 );
3940
API_SUFFIX(stdlib_strided_dcartesian_power_ndarray)( N, k, X, strideX, ox, Out, strideOut1, strideOut2, oo );
@@ -53,19 +54,19 @@ void API_SUFFIX(stdlib_strided_dcartesian_power)( const CBLAS_INT N, const CBLAS
5354
* @param offsetOut starting index
5455
*/
5556
void API_SUFFIX(stdlib_strided_dcartesian_power_ndarray)( const CBLAS_INT N, const CBLAS_INT k, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *Out, const CBLAS_INT strideOut1, const CBLAS_INT strideOut2, const CBLAS_INT offsetOut ) {
56-
CBLAS_INT len;
57-
CBLAS_INT oj;
58-
CBLAS_INT io;
5957
CBLAS_INT ix;
60-
CBLAS_INT i;
6158
CBLAS_INT j;
6259
CBLAS_INT s;
63-
CBLAS_INT t;
60+
int64_t len;
61+
int64_t io;
62+
int64_t oj;
63+
int64_t i;
64+
int64_t t;
6465

6566
if ( N <= 0 || k <= 0 ) {
6667
return;
6768
}
68-
len = stdlib_base_pow( N, k );
69+
len = (int64_t)stdlib_base_pow( N, k );
6970
io = offsetOut;
7071
for ( i = 0; i < len; i++ ) {
7172
t = i;

0 commit comments

Comments
 (0)