diff --git a/.editorconfig b/.editorconfig index c66ad556..cbf411ea 100644 --- a/.editorconfig +++ b/.editorconfig @@ -32,6 +32,23 @@ insert_final_newline = true [*.js] indent_style = tab +[*.js.txt] +indent_style = tab + +# Set properties for JavaScript ES module files: +[*.mjs] +indent_style = tab + +[*.mjs.txt] +indent_style = tab + +# Set properties for JavaScript CommonJS files: +[*.cjs] +indent_style = tab + +[*.cjs.txt] +indent_style = tab + # Set properties for TypeScript files: [*.ts] indent_style = tab @@ -84,6 +101,11 @@ indent_style = tab indent_style = tab tab_width = 2 +# Set properties for XML files: +[*.xml] +indent_style = tab +tab_width = 2 + # Set properties for CSS files: [*.css] indent_style = tab @@ -101,6 +123,11 @@ indent_style = space indent_size = 4 trim_trailing_whitespace = false +[*.md.txt] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = false + # Set properties for `usage.txt` files: [usage.txt] indent_style = space @@ -121,6 +148,11 @@ indent_size = 2 indent_style = space indent_size = 2 +# Set properties for `manifest.json` files: +[manifest.json] +indent_style = space +indent_size = 2 + # Set properties for `tslint.json` files: [tslint.json] indent_style = space diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ac43d572..01c768cd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,7 +20,9 @@ name: Publish Package # Workflow triggers: -on: push +on: + push: + tags: v[0-9]+.[0-9]+.[0-9]+ # Workflow jobs: jobs: @@ -33,20 +35,20 @@ jobs: - uses: actions/setup-node@v1 with: node-version: 15 - - name: Increment version + - name: Replace all GitHub links to individual packages with npm links run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - npm version patch + find . -type f -name '*.md' -print0 | xargs -0 sed -Ei 's/@stdlib\/([^:]*)\]: https:\/\/github.com\/stdlib-js/@stdlib\/\1\]: https:\/\/www.npmjs.com\/package\/@stdlib/g' + - name: Replace all stdlib GitHub dependencies with the respective npm packages + run: | + find package.json -type f -print0 | xargs -0 sed -Ei 's/"github:stdlib-js[^"]*"/"^0.0.x"/g' - name: Publish package to npm uses: JS-DevTools/npm-publish@v1 with: token: ${{ secrets.NPM_TOKEN }} access: public - - name: Push changes + - name: Discard any uncommitted changes run: | - git push origin main - git push --tags + git reset --hard - uses: act10ns/slack@v1 with: status: ${{ job.status }} diff --git a/.gitignore b/.gitignore index 1475963a..75891c6d 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ # Files # ######### -.postinstall.json + # Directories # ############### @@ -70,9 +70,6 @@ tmp/ *.tar *.zip -# Make an exception for compressed distributable files: -!dist/*.gz - # Logs and databases # ###################### *.log diff --git a/array/package.json b/array/package.json index 1f0659b0..60eaeec2 100644 --- a/array/package.json +++ b/array/package.json @@ -15,6 +15,9 @@ ], "main": "./lib", "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", "lib": "./lib", "test": "./test" }, diff --git a/base/assert/is-allowed-data-type-cast/package.json b/base/assert/is-allowed-data-type-cast/package.json index b76a78ad..5f356798 100644 --- a/base/assert/is-allowed-data-type-cast/package.json +++ b/base/assert/is-allowed-data-type-cast/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/assert/is-buffer-length-compatible-shape/package.json b/base/assert/is-buffer-length-compatible-shape/package.json index 48c4dbe1..dbaa390f 100644 --- a/base/assert/is-buffer-length-compatible-shape/package.json +++ b/base/assert/is-buffer-length-compatible-shape/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/assert/is-buffer-length-compatible/package.json b/base/assert/is-buffer-length-compatible/package.json index 873fd3e8..79217d1f 100644 --- a/base/assert/is-buffer-length-compatible/package.json +++ b/base/assert/is-buffer-length-compatible/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/assert/is-column-major-contiguous/package.json b/base/assert/is-column-major-contiguous/package.json index d17c6c2c..d5d69eb7 100644 --- a/base/assert/is-column-major-contiguous/package.json +++ b/base/assert/is-column-major-contiguous/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/assert/is-column-major/package.json b/base/assert/is-column-major/package.json index fdc63299..81ebba27 100644 --- a/base/assert/is-column-major/package.json +++ b/base/assert/is-column-major/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/assert/is-contiguous/package.json b/base/assert/is-contiguous/package.json index 470ce092..d94e2f3e 100644 --- a/base/assert/is-contiguous/package.json +++ b/base/assert/is-contiguous/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/assert/is-row-major-contiguous/package.json b/base/assert/is-row-major-contiguous/package.json index b647a662..ec41b753 100644 --- a/base/assert/is-row-major-contiguous/package.json +++ b/base/assert/is-row-major-contiguous/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/assert/is-row-major/package.json b/base/assert/is-row-major/package.json index 87938a07..b73225a4 100644 --- a/base/assert/is-row-major/package.json +++ b/base/assert/is-row-major/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/assert/is-safe-data-type-cast/package.json b/base/assert/is-safe-data-type-cast/package.json index ea824b03..ee0f73d8 100644 --- a/base/assert/is-safe-data-type-cast/package.json +++ b/base/assert/is-safe-data-type-cast/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/assert/is-same-kind-data-type-cast/package.json b/base/assert/is-same-kind-data-type-cast/package.json index bb1f7e7c..8575b4e3 100644 --- a/base/assert/is-same-kind-data-type-cast/package.json +++ b/base/assert/is-same-kind-data-type-cast/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/assert/is-single-segment-compatible/package.json b/base/assert/is-single-segment-compatible/package.json index 35d71aca..be7f7808 100644 --- a/base/assert/is-single-segment-compatible/package.json +++ b/base/assert/is-single-segment-compatible/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/assert/package.json b/base/assert/package.json index 864f0f18..4f379398 100644 --- a/base/assert/package.json +++ b/base/assert/package.json @@ -15,6 +15,7 @@ ], "main": "lib/index.js", "directories": { + "doc": "./docs", "example": "./examples", "lib": "./lib", "test": "./test" diff --git a/base/bind2vind/package.json b/base/bind2vind/package.json index 45a2786d..a5236266 100644 --- a/base/bind2vind/package.json +++ b/base/bind2vind/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/bind2vind/src/main.c b/base/bind2vind/src/main.c index d7bab055..70f1da2d 100644 --- a/base/bind2vind/src/main.c +++ b/base/bind2vind/src/main.c @@ -100,7 +100,7 @@ int64_t stdlib_ndarray_bind2vind( int64_t ndims, int64_t *shape, int64_t *stride idx -= k * s; k += shape[ i ] - 1; } else { - k = idx / s; // truncates + k = idx / s; // cppcheck-suppress zerodivcond // truncates idx -= k * s; } ind += k * llabs( s ); @@ -115,7 +115,7 @@ int64_t stdlib_ndarray_bind2vind( int64_t ndims, int64_t *shape, int64_t *stride idx -= k * s; k += shape[ i ] - 1; } else { - k = idx / s; // truncates + k = idx / s; // cppcheck-suppress zerodivcond // truncates idx -= k * s; } ind += k * llabs( s ); diff --git a/base/broadcast-shapes/README.md b/base/broadcast-shapes/README.md index ee836226..0a2bc113 100644 --- a/base/broadcast-shapes/README.md +++ b/base/broadcast-shapes/README.md @@ -342,6 +342,7 @@ If successful, the function returns `0`; otherwise, the function returns `-1` (e #include "stdlib/ndarray/base/broadcast_shapes.h" #include #include +#include int main() { int64_t N1 = 4; @@ -362,7 +363,7 @@ int main() { int64_t i; printf( "shape = ( " ); for ( i = 0; i < N1; i++ ) { - printf( "%lli", out[ i ] ); + printf( "%"PRId64"", out[ i ] ); if ( i < N1-1 ) { printf( ", " ); } diff --git a/base/broadcast-shapes/examples/c/example.c b/base/broadcast-shapes/examples/c/example.c index abb751d0..fae2252b 100644 --- a/base/broadcast-shapes/examples/c/example.c +++ b/base/broadcast-shapes/examples/c/example.c @@ -19,6 +19,7 @@ #include "stdlib/ndarray/base/broadcast_shapes.h" #include #include +#include int main() { int64_t N1 = 4; @@ -39,7 +40,7 @@ int main() { int64_t i; printf( "shape = ( " ); for ( i = 0; i < N1; i++ ) { - printf( "%lli", out[ i ] ); + printf( "%"PRId64"", out[ i ] ); if ( i < N1-1 ) { printf( ", " ); } diff --git a/base/bytes-per-element/package.json b/base/bytes-per-element/package.json index 258c12ed..5056e4e2 100644 --- a/base/bytes-per-element/package.json +++ b/base/bytes-per-element/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/clamp-index/package.json b/base/clamp-index/package.json index 5f1a8bc2..b9956d56 100644 --- a/base/clamp-index/package.json +++ b/base/clamp-index/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/dtype-char/package.json b/base/dtype-char/package.json index b6703d0f..d1cd1153 100644 --- a/base/dtype-char/package.json +++ b/base/dtype-char/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/function-object/examples/c/example.c b/base/function-object/examples/c/example.c index a5aaa53c..68ba3822 100644 --- a/base/function-object/examples/c/example.c +++ b/base/function-object/examples/c/example.c @@ -65,26 +65,26 @@ int main() { obj->data = data; printf( "name = %s\n", obj->name ); - printf( "nin = %u\n", obj->nin ); - printf( "nout = %u\n", obj->nout ); - printf( "narrays = %u\n", obj->narrays ); - printf( "nfunctions = %u\n", obj->nfunctions ); + printf( "nin = %i\n", obj->nin ); + printf( "nout = %i\n", obj->nout ); + printf( "narrays = %i\n", obj->narrays ); + printf( "nfunctions = %i\n", obj->nfunctions ); // Free allocated memory: stdlib_ndarray_function_free( obj ); // Use the function interface to create an ndarray function object... struct ndarrayFunctionObject *obj2 = stdlib_ndarray_function_allocate( "unary_ndarray_function_2", 1, 1, functions, 1, types, data ); - if ( obj == NULL ) { + if ( obj2 == NULL ) { fprintf( stderr, "Error allocating memory.\n" ); exit( 1 ); } printf( "name = %s\n", obj2->name ); - printf( "nin = %u\n", obj2->nin ); - printf( "nout = %u\n", obj2->nout ); - printf( "narrays = %u\n", obj2->narrays ); - printf( "nfunctions = %u\n", obj2->nfunctions ); + printf( "nin = %i\n", obj2->nin ); + printf( "nout = %i\n", obj2->nout ); + printf( "narrays = %i\n", obj2->narrays ); + printf( "nfunctions = %i\n", obj2->nfunctions ); // Free allocated memory: stdlib_ndarray_function_free( obj ); diff --git a/base/function-object/package.json b/base/function-object/package.json index aa7e7593..71661313 100644 --- a/base/function-object/package.json +++ b/base/function-object/package.json @@ -58,6 +58,7 @@ "fcn", "c", "n-api", + "node-api", "napi" ], "__stdlib__": {} diff --git a/base/ind/package.json b/base/ind/package.json index b8338dfe..b02d5a25 100644 --- a/base/ind/package.json +++ b/base/ind/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/ind2sub/README.md b/base/ind2sub/README.md index ce67e7d6..0691b0ba 100644 --- a/base/ind2sub/README.md +++ b/base/ind2sub/README.md @@ -364,6 +364,7 @@ int8_t stdlib_ndarray_ind2sub( int64_t ndims, int64_t *shape, int64_t *strides, #include "stdlib/ndarray/orders.h" #include #include +#include int main() { int64_t ndims = 2; @@ -378,7 +379,7 @@ int main() { int i; printf( "subscripts = { " ); for ( i = 0; i < ndims; i++ ) { - printf( "%lli", out[ i ] ); + printf( "%"PRId64"", out[ i ] ); if ( i < ndims-1 ) { printf( ", " ); } diff --git a/base/ind2sub/examples/c/example.c b/base/ind2sub/examples/c/example.c index 767878ca..e444074f 100644 --- a/base/ind2sub/examples/c/example.c +++ b/base/ind2sub/examples/c/example.c @@ -21,6 +21,7 @@ #include "stdlib/ndarray/orders.h" #include #include +#include int main() { int64_t ndims = 2; @@ -35,7 +36,7 @@ int main() { int i; printf( "subscripts = { " ); for ( i = 0; i < ndims; i++ ) { - printf( "%lli", out[ i ] ); + printf( "%"PRId64"", out[ i ] ); if ( i < ndims-1 ) { printf( ", " ); } diff --git a/base/ind2sub/src/main.c b/base/ind2sub/src/main.c index ec5c0f3a..c6f9959a 100644 --- a/base/ind2sub/src/main.c +++ b/base/ind2sub/src/main.c @@ -120,7 +120,7 @@ int8_t stdlib_ndarray_ind2sub( int64_t ndims, int64_t *shape, int64_t *strides, idx -= k * s; out[ i ] = shape[ i ] - 1 + k; } else { - k = idx / s; // truncates + k = idx / s; // cppcheck-suppress zerodivcond // truncates idx -= k * s; out[ i ] = k; } @@ -135,7 +135,7 @@ int8_t stdlib_ndarray_ind2sub( int64_t ndims, int64_t *shape, int64_t *strides, idx -= k * s; out[ i ] = shape[ i ] - 1 + k; } else { - k = idx / s; // truncates + k = idx / s; // cppcheck-suppress zerodivcond // truncates idx -= k * s; out[ i ] = k; } diff --git a/base/ind2sub/test/test.js b/base/ind2sub/test/test.js index bb738691..1904236c 100644 --- a/base/ind2sub/test/test.js +++ b/base/ind2sub/test/test.js @@ -34,6 +34,90 @@ tape( 'main export is a function', function test( t ) { t.end(); }); +tape( 'the function converts a linear index to an array of subscripts (0d; order=row-major)', function test( t ) { + var strides; + var offset; + var order; + var shape; + var out; + + shape = []; + order = 'row-major'; + strides = [ 0 ]; + offset = 0; + + out = ind2sub( shape, strides, offset, order, 0, 'throw' ); + t.strictEqual( isArray( out ), true, 'returns an array' ); + t.deepEqual( out, [], 'returns expected value' ); + + t.end(); +}); + +tape( 'the function converts a linear index to an array of subscripts (0d; order=column-major)', function test( t ) { + var strides; + var offset; + var order; + var shape; + var out; + + shape = []; + order = 'column-major'; + strides = [ 0 ]; + offset = 0; + + out = ind2sub( shape, strides, offset, order, 0, 'throw' ); + t.strictEqual( isArray( out ), true, 'returns an array' ); + t.deepEqual( out, [], 'returns expected value' ); + + t.end(); +}); + +tape( 'the function converts a linear index to an array of subscripts (1d; order=row-major)', function test( t ) { + var strides; + var offset; + var order; + var shape; + var out; + + shape = [ 2 ]; + order = 'row-major'; + strides = [ 1 ]; + offset = 0; + + out = ind2sub( shape, strides, offset, order, 0, 'throw' ); + t.strictEqual( isArray( out ), true, 'returns an array' ); + t.deepEqual( out, [ 0 ], 'returns expected value' ); + + out = ind2sub( shape, strides, offset, order, 1, 'throw' ); + t.strictEqual( isArray( out ), true, 'returns an array' ); + t.deepEqual( out, [ 1 ], 'returns expected value' ); + + t.end(); +}); + +tape( 'the function converts a linear index to an array of subscripts (1d; order=column-major)', function test( t ) { + var strides; + var offset; + var order; + var shape; + var out; + + shape = [ 2 ]; + order = 'column-major'; + strides = [ 1 ]; + offset = 0; + + out = ind2sub( shape, strides, offset, order, 0, 'throw' ); + t.strictEqual( isArray( out ), true, 'returns an array' ); + t.deepEqual( out, [ 0 ], 'returns expected value' ); + + out = ind2sub( shape, strides, offset, order, 1, 'throw' ); + t.strictEqual( isArray( out ), true, 'returns an array' ); + t.deepEqual( out, [ 1 ], 'returns expected value' ); + + t.end(); +}); + tape( 'the function converts a linear index to an array of subscripts (2d; order=row-major)', function test( t ) { var strides; var offset; diff --git a/base/iteration-order/package.json b/base/iteration-order/package.json index 497ee018..cc81fdcb 100644 --- a/base/iteration-order/package.json +++ b/base/iteration-order/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/max-view-buffer-index/package.json b/base/max-view-buffer-index/package.json index 13208202..6528451d 100644 --- a/base/max-view-buffer-index/package.json +++ b/base/max-view-buffer-index/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/min-view-buffer-index/package.json b/base/min-view-buffer-index/package.json index 4bc4d05b..073b58ff 100644 --- a/base/min-view-buffer-index/package.json +++ b/base/min-view-buffer-index/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/minmax-view-buffer-index/README.md b/base/minmax-view-buffer-index/README.md index 624c32af..7718628a 100644 --- a/base/minmax-view-buffer-index/README.md +++ b/base/minmax-view-buffer-index/README.md @@ -218,6 +218,7 @@ int8_t stdlib_ndarray_minmax_view_buffer_index( int64_t ndims, int64_t *shape, i ```c #include "stdlib/ndarray/base/minmax_view_buffer_index.h" #include +#include int main() { int64_t ndims = 2; @@ -228,8 +229,8 @@ int main() { stdlib_ndarray_minmax_view_buffer_index( ndims, shape, strides, offset, out ); - printf( "min: %lli\n", out[ 0 ] ); - printf( "max: %lli\n", out[ 1 ] ); + printf( "min: %"PRId64"\n", out[ 0 ] ); + printf( "max: %"PRId64"\n", out[ 1 ] ); } ``` diff --git a/base/minmax-view-buffer-index/examples/c/example.c b/base/minmax-view-buffer-index/examples/c/example.c index 37fc37ea..c94f7ee8 100644 --- a/base/minmax-view-buffer-index/examples/c/example.c +++ b/base/minmax-view-buffer-index/examples/c/example.c @@ -18,6 +18,7 @@ #include "stdlib/ndarray/base/minmax_view_buffer_index.h" #include +#include int main() { int64_t ndims = 2; @@ -28,6 +29,6 @@ int main() { stdlib_ndarray_minmax_view_buffer_index( ndims, shape, strides, offset, out ); - printf( "min: %lli\n", out[ 0 ] ); - printf( "max: %lli\n", out[ 1 ] ); + printf( "min: %"PRId64"\n", out[ 0 ] ); + printf( "max: %"PRId64"\n", out[ 1 ] ); } diff --git a/base/napi/README.md b/base/napi/README.md index f9e93e2f..65108438 100644 --- a/base/napi/README.md +++ b/base/napi/README.md @@ -20,13 +20,13 @@ limitations under the License. # ndarray Native Add-ons -> C APIs for creating N-API ndarray native add-ons. +> C APIs for creating Node-API ndarray native add-ons.
-This package exposes an absolute file path for the directory containing header files for various C APIs. The various C APIs facilitate the creation of N-API ndarray native add-ons. +This package exposes an absolute file path for the directory containing header files for various C APIs. The various C APIs facilitate the creation of Node-API ndarray native add-ons.
@@ -92,7 +92,7 @@ console.log( headerDir );
-This package exposes various C APIs to facilitate the creation of N-API ndarray native add-ons. The included C APIs are the APIs implemented in the following packages: +This package exposes various C APIs to facilitate the creation of Node-API ndarray native add-ons. The included C APIs are the APIs implemented in the following packages: diff --git a/base/napi/addon-arguments/README.md b/base/napi/addon-arguments/README.md index 7190d874..a05df0a1 100644 --- a/base/napi/addon-arguments/README.md +++ b/base/napi/addon-arguments/README.md @@ -20,7 +20,7 @@ limitations under the License. # Add-on Arguments -> C API for validating, extracting, and transforming (to native C types) function arguments provided to an ndarray N-API add-on interface. +> C API for validating, extracting, and transforming (to native C types) function arguments provided to an ndarray Node-API add-on interface. @@ -108,7 +108,7 @@ console.log( headerDir ); #### stdlib_ndarray_napi_addon_arguments( env, argv, nargs, nin, \*arrays[], \*err ) -Validates, extracts, and transforms (to native C types) function arguments provided to an ndarray N-API add-on interface. +Validates, extracts, and transforms (to native C types) function arguments provided to an ndarray Node-API add-on interface. ```c #include @@ -118,11 +118,11 @@ Validates, extracts, and transforms (to native C types) function arguments provi // ... /** -* Receives JavaScript callback invocation data via N-API. +* Receives JavaScript callback invocation data. * * @param env environment under which the function is invoked * @param info callback data -* @return N-API value +* @return Node-API value */ napi_value addon( napi_env env, napi_callback_info info ) { napi_status status; diff --git a/base/napi/addon-arguments/include/stdlib/ndarray/base/napi/addon_arguments.h b/base/napi/addon-arguments/include/stdlib/ndarray/base/napi/addon_arguments.h index 04cae767..010adf1d 100644 --- a/base/napi/addon-arguments/include/stdlib/ndarray/base/napi/addon_arguments.h +++ b/base/napi/addon-arguments/include/stdlib/ndarray/base/napi/addon_arguments.h @@ -31,7 +31,7 @@ extern "C" { #endif /** -* Validates, extracts, and transforms (to native C types) function arguments provided to an ndarray N-API add-on interface. +* Validates, extracts, and transforms (to native C types) function arguments provided to an ndarray Node-API add-on interface. */ napi_status stdlib_ndarray_napi_addon_arguments( const napi_env env, const napi_value *argv, const int64_t nargs, const int64_t nin, struct ndarray *arrays[], napi_value *err ); diff --git a/base/napi/addon-arguments/package.json b/base/napi/addon-arguments/package.json index 4f76bd76..06d783b5 100644 --- a/base/napi/addon-arguments/package.json +++ b/base/napi/addon-arguments/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/ndarray/base/napi/addon-arguments", "version": "0.0.0", - "description": "C API for validating, extracting, and transforming (to native C types) function arguments provided to an ndarray N-API add-on interface.", + "description": "C API for validating, extracting, and transforming (to native C types) function arguments provided to an ndarray Node-API add-on interface.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", @@ -59,6 +59,7 @@ "tensor", "napi", "n-api", + "node-api", "addon", "arguments", "args" diff --git a/base/napi/addon-arguments/src/addon.c b/base/napi/addon-arguments/src/addon.c index 6d77cca6..83567a01 100644 --- a/base/napi/addon-arguments/src/addon.c +++ b/base/napi/addon-arguments/src/addon.c @@ -23,12 +23,12 @@ #include /** -* Receives JavaScript callback invocation data via N-API. +* Receives JavaScript callback invocation data. * * @private * @param env environment under which the function is invoked * @param info callback data -* @return N-API value +* @return Node-API value */ static napi_value addon( napi_env env, napi_callback_info info ) { napi_status status; @@ -80,7 +80,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) { } /** -* Initializes an N-API module. +* Initializes a Node-API module. * * @private * @param env environment under which the function is invoked diff --git a/base/napi/addon-arguments/src/main.c b/base/napi/addon-arguments/src/main.c index c013de6e..f5b986b2 100644 --- a/base/napi/addon-arguments/src/main.c +++ b/base/napi/addon-arguments/src/main.c @@ -25,7 +25,7 @@ #include /** -* Validates, extracts, and transforms (to native C types) function arguments provided to an ndarray N-API add-on interface. +* Validates, extracts, and transforms (to native C types) function arguments provided to an ndarray Node-API add-on interface. * * ## Notes * diff --git a/base/napi/dtype-string-to-dtype/README.md b/base/napi/dtype-string-to-dtype/README.md index cd5aa4a2..6effbb01 100644 --- a/base/napi/dtype-string-to-dtype/README.md +++ b/base/napi/dtype-string-to-dtype/README.md @@ -18,7 +18,7 @@ limitations under the License. --> -# N-API ndarray dtype +# Node-API ndarray dtype > C API for returning the ndarray [data type][@stdlib/ndarray/dtypes] corresponding to a data type string. diff --git a/base/napi/dtype-string-to-dtype/package.json b/base/napi/dtype-string-to-dtype/package.json index 336ac75f..f18714bb 100644 --- a/base/napi/dtype-string-to-dtype/package.json +++ b/base/napi/dtype-string-to-dtype/package.json @@ -16,6 +16,7 @@ "main": "./lib", "browser": "./lib/browser.js", "directories": { + "doc": "./docs", "include": "./include", "lib": "./lib", "src": "./src", diff --git a/base/napi/package.json b/base/napi/package.json index 23ef0912..45227359 100644 --- a/base/napi/package.json +++ b/base/napi/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/ndarray/base/napi", "version": "0.0.0", - "description": "C APIs for creating N-API ndarray native add-ons.", + "description": "C APIs for creating Node-API ndarray native add-ons.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", @@ -57,6 +57,7 @@ "array", "napi", "n-api", + "node-api", "addon" ], "__stdlib__": {} diff --git a/base/napi/typedarray-type-to-dtype/README.md b/base/napi/typedarray-type-to-dtype/README.md index 532d97cc..eb42162e 100644 --- a/base/napi/typedarray-type-to-dtype/README.md +++ b/base/napi/typedarray-type-to-dtype/README.md @@ -18,9 +18,9 @@ limitations under the License. --> -# N-API ndarray dtype +# Node-API ndarray dtype -> C API for returning the ndarray [data type][@stdlib/ndarray/dtypes] corresponding to an N-API typed array type. +> C API for returning the ndarray [data type][@stdlib/ndarray/dtypes] corresponding to a Node-API typed array type. @@ -42,7 +42,7 @@ limitations under the License. #### stdlib_ndarray_napi_typedarray_type_to_dtype( napi_typedarray_type vtype ) -Returns the ndarray [data type][@stdlib/ndarray/dtypes] corresponding to an N-API typed array type. +Returns the ndarray [data type][@stdlib/ndarray/dtypes] corresponding to a Node-API typed array type. ```c #include "stdlib/ndarray/base/napi/typedarray_type_to_dtype.h" diff --git a/base/napi/typedarray-type-to-dtype/include/stdlib/ndarray/base/napi/typedarray_type_to_dtype.h b/base/napi/typedarray-type-to-dtype/include/stdlib/ndarray/base/napi/typedarray_type_to_dtype.h index bc8026ea..a0d21bbe 100644 --- a/base/napi/typedarray-type-to-dtype/include/stdlib/ndarray/base/napi/typedarray_type_to_dtype.h +++ b/base/napi/typedarray-type-to-dtype/include/stdlib/ndarray/base/napi/typedarray_type_to_dtype.h @@ -30,7 +30,7 @@ extern "C" { #endif /** -* Returns the ndarray data type corresponding to an N-API typed array type. +* Returns the ndarray data type corresponding to a Node-API typed array type. */ enum STDLIB_NDARRAY_DTYPE stdlib_ndarray_napi_typedarray_type_to_dtype( napi_typedarray_type vtype ); diff --git a/base/napi/typedarray-type-to-dtype/package.json b/base/napi/typedarray-type-to-dtype/package.json index c5c3a124..7a836ba2 100644 --- a/base/napi/typedarray-type-to-dtype/package.json +++ b/base/napi/typedarray-type-to-dtype/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/ndarray/base/napi/typedarray-type-to-dtype", "version": "0.0.0", - "description": "C API for returning the ndarray data type corresponding to an N-API typed array type.", + "description": "C API for returning the ndarray data type corresponding to a Node-API typed array type.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", @@ -16,6 +16,7 @@ "main": "./lib", "browser": "./lib/browser.js", "directories": { + "doc": "./docs", "include": "./include", "lib": "./lib", "src": "./src", diff --git a/base/napi/typedarray-type-to-dtype/src/main.c b/base/napi/typedarray-type-to-dtype/src/main.c index 344b3026..5fd98d38 100644 --- a/base/napi/typedarray-type-to-dtype/src/main.c +++ b/base/napi/typedarray-type-to-dtype/src/main.c @@ -21,9 +21,9 @@ #include /** -* Returns the ndarray data type corresponding to an N-API typed array type. +* Returns the ndarray data type corresponding to a Node-API typed array type. * -* @param vtype N-API typed array type +* @param vtype Node-API typed array type * @return data type * * @example diff --git a/base/napi/unary/README.md b/base/napi/unary/README.md index 4c7fdb59..cb748e23 100644 --- a/base/napi/unary/README.md +++ b/base/napi/unary/README.md @@ -20,7 +20,7 @@ limitations under the License. # Unary -> C API for registering an N-API module exporting an ndarray interface for applying a unary callback to an input ndarray. +> C API for registering a Node-API module exporting an ndarray interface for applying a unary callback to an input ndarray. @@ -119,11 +119,11 @@ static const struct ndarrayFunctionObject obj = {...}; // ... /** -* Receives JavaScript callback invocation data via N-API. +* Receives JavaScript callback invocation data. * * @param env environment under which the function is invoked * @param info callback data -* @return N-API value +* @return Node-API value */ napi_value addon( napi_env env, napi_callback_info info ) { stdlib_ndarray_napi_unary( env, info, &obj ); @@ -145,7 +145,7 @@ void stdlib_ndarray_napi_unary( napi_env env, napi_callback_info info, const str #### STDLIB_NDARRAY_NAPI_MODULE_UNARY( obj ) -Macro for registering an N-API module exporting an ndarray interface for applying a unary callback to an input ndarray. +Macro for registering a Node-API module exporting an ndarray interface for applying a unary callback to an input ndarray. ```c #include "stdlib/ndarray/base/function_object.h" @@ -157,7 +157,7 @@ static const struct ndarrayFunctionObject obj = {...}; // ... -// Register an N-API module: +// Register a Node-API module: STDLIB_NDARRAY_NAPI_MODULE_UNARY( obj ); ``` @@ -165,7 +165,7 @@ The macro expects the following arguments: - **obj**: `struct ndarrayFunctionObject` ndarray [function object][@stdlib/ndarray/base/function-object]. -When used, this macro should be used **instead of** `NAPI_MODULE`. The macro includes `NAPI_MODULE`, thus ensuring N-API module registration. +When used, this macro should be used **instead of** `NAPI_MODULE`. The macro includes `NAPI_MODULE`, thus ensuring Node-API module registration.
diff --git a/base/napi/unary/include/stdlib/ndarray/base/napi/unary.h b/base/napi/unary/include/stdlib/ndarray/base/napi/unary.h index 1224e3c8..017c614d 100644 --- a/base/napi/unary/include/stdlib/ndarray/base/napi/unary.h +++ b/base/napi/unary/include/stdlib/ndarray/base/napi/unary.h @@ -24,7 +24,7 @@ #include /** -* Macro for registering an N-API module exporting an ndarray interface for applying a unary callback to an input ndarray. +* Macro for registering a Node-API module exporting an ndarray interface for applying a unary callback to an input ndarray. * * @param obj ndarray function object * @@ -39,7 +39,7 @@ * * // ... * -* // Register an N-API module: +* // Register a Node-API module: * STDLIB_NDARRAY_NAPI_MODULE_UNARY( obj ); */ #define STDLIB_NDARRAY_NAPI_MODULE_UNARY( obj ) \ diff --git a/base/napi/unary/package.json b/base/napi/unary/package.json index a48587a3..f585f638 100644 --- a/base/napi/unary/package.json +++ b/base/napi/unary/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/ndarray/base/napi/unary", "version": "0.0.0", - "description": "C API for registering an N-API module exporting an ndarray interface for applying a unary callback to an input ndarray.", + "description": "C API for registering a Node-API module exporting an ndarray interface for applying a unary callback to an input ndarray.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", @@ -60,6 +60,7 @@ "array", "napi", "n-api", + "node-api", "addon", "unary" ], diff --git a/base/nonsingleton-dimensions/README.md b/base/nonsingleton-dimensions/README.md index bdcf8099..099e1026 100644 --- a/base/nonsingleton-dimensions/README.md +++ b/base/nonsingleton-dimensions/README.md @@ -163,12 +163,13 @@ int64_t stdlib_ndarray_nonsingleton_dimensions( int64_t ndims, int64_t *shape ); ```c #include "stdlib/ndarray/base/nonsingleton_dimensions.h" #include +#include int main() { int64_t shape[] = { 10, 3, 1, 1, 5 }; int64_t n = stdlib_ndarray_nonsingleton_dimensions( 5, shape ); - printf( "shape: %llux%llux%llux%llux%llu. non-singleton dimensions: %llu\n", shape[ 0 ], shape[ 1 ], shape[ 2 ], shape[ 3 ], shape[ 4 ], n ); + printf( "shape: %"PRId64"x%"PRId64"x%"PRId64"x%"PRId64"x%"PRId64". non-singleton dimensions: %"PRId64"\n", shape[ 0 ], shape[ 1 ], shape[ 2 ], shape[ 3 ], shape[ 4 ], n ); } ``` diff --git a/base/nonsingleton-dimensions/examples/c/example.c b/base/nonsingleton-dimensions/examples/c/example.c index aa058eda..bbb1afb8 100644 --- a/base/nonsingleton-dimensions/examples/c/example.c +++ b/base/nonsingleton-dimensions/examples/c/example.c @@ -18,10 +18,11 @@ #include "stdlib/ndarray/base/nonsingleton_dimensions.h" #include +#include int main() { int64_t shape[] = { 10, 3, 1, 1, 5 }; int64_t n = stdlib_ndarray_nonsingleton_dimensions( 5, shape ); - printf( "shape: %llux%llux%llux%llux%llu. non-singleton dimensions: %llu\n", shape[ 0 ], shape[ 1 ], shape[ 2 ], shape[ 3 ], shape[ 4 ], n ); + printf( "shape: %"PRId64"x%"PRId64"x%"PRId64"x%"PRId64"x%"PRId64". non-singleton dimensions: %"PRId64"\n", shape[ 0 ], shape[ 1 ], shape[ 2 ], shape[ 3 ], shape[ 4 ], n ); } diff --git a/base/numel/package.json b/base/numel/package.json index 4e96688f..ec8299f1 100644 --- a/base/numel/package.json +++ b/base/numel/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/package.json b/base/package.json index 0dbe4fca..a764e422 100644 --- a/base/package.json +++ b/base/package.json @@ -15,6 +15,7 @@ ], "main": "lib/index.js", "directories": { + "doc": "./docs", "example": "./examples", "lib": "./lib", "test": "./test" diff --git a/base/shape2strides/README.md b/base/shape2strides/README.md index a57ed88a..a1a2d5c3 100644 --- a/base/shape2strides/README.md +++ b/base/shape2strides/README.md @@ -186,6 +186,7 @@ int8_t stdlib_ndarray_shape2strides( int64_t ndims, int64_t *shape, enum STDLIB_ #include "stdlib/ndarray/base/shape2strides.h" #include "stdlib/ndarray/orders.h" #include +#include int main() { int64_t shape[] = { 2, 3, 10 }; @@ -197,7 +198,7 @@ int main() { int i; printf( "strides = { " ); for ( i = 0; i < ndims; i++ ) { - printf( "%lli", out[ i ] ); + printf( "%"PRId64"", out[ i ] ); if ( i < ndims-1 ) { printf( ", " ); } diff --git a/base/shape2strides/examples/c/example.c b/base/shape2strides/examples/c/example.c index c0bb254c..750694e1 100644 --- a/base/shape2strides/examples/c/example.c +++ b/base/shape2strides/examples/c/example.c @@ -19,6 +19,7 @@ #include "stdlib/ndarray/base/shape2strides.h" #include "stdlib/ndarray/orders.h" #include +#include int main() { int64_t shape[] = { 2, 3, 10 }; @@ -30,7 +31,7 @@ int main() { int i; printf( "strides = { " ); for ( i = 0; i < ndims; i++ ) { - printf( "%lli", out[ i ] ); + printf( "%"PRId64"", out[ i ] ); if ( i < ndims-1 ) { printf( ", " ); } diff --git a/base/singleton-dimensions/README.md b/base/singleton-dimensions/README.md index e9a63380..7e22159d 100644 --- a/base/singleton-dimensions/README.md +++ b/base/singleton-dimensions/README.md @@ -163,12 +163,13 @@ int64_t stdlib_ndarray_singleton_dimensions( int64_t ndims, int64_t *shape ); ```c #include "stdlib/ndarray/base/singleton_dimensions.h" #include +#include int main() { int64_t shape[] = { 10, 3, 1, 1, 5 }; int64_t n = stdlib_ndarray_singleton_dimensions( 5, shape ); - printf( "shape: %llux%llux%llux%llux%llu. singleton dimensions: %llu\n", shape[ 0 ], shape[ 1 ], shape[ 2 ], shape[ 3 ], shape[ 4 ], n ); + printf( "shape: %"PRId64"x%"PRId64"x%"PRId64"x%"PRId64"x%"PRId64". singleton dimensions: %"PRId64"\n", shape[ 0 ], shape[ 1 ], shape[ 2 ], shape[ 3 ], shape[ 4 ], n ); } ``` diff --git a/base/singleton-dimensions/examples/c/example.c b/base/singleton-dimensions/examples/c/example.c index d3ebf2dd..59250fcd 100644 --- a/base/singleton-dimensions/examples/c/example.c +++ b/base/singleton-dimensions/examples/c/example.c @@ -18,10 +18,11 @@ #include "stdlib/ndarray/base/singleton_dimensions.h" #include +#include int main() { int64_t shape[] = { 10, 3, 1, 1, 5 }; int64_t n = stdlib_ndarray_singleton_dimensions( 5, shape ); - printf( "shape: %llux%llux%llux%llux%llu. singleton dimensions: %llu\n", shape[ 0 ], shape[ 1 ], shape[ 2 ], shape[ 3 ], shape[ 4 ], n ); + printf( "shape: %"PRId64"x%"PRId64"x%"PRId64"x%"PRId64"x%"PRId64". singleton dimensions: %"PRId64"\n", shape[ 0 ], shape[ 1 ], shape[ 2 ], shape[ 3 ], shape[ 4 ], n ); } diff --git a/base/strides2offset/package.json b/base/strides2offset/package.json index 99a955f0..d8567c33 100644 --- a/base/strides2offset/package.json +++ b/base/strides2offset/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/strides2order/package.json b/base/strides2order/package.json index 432a7dac..0e3ae9da 100644 --- a/base/strides2order/package.json +++ b/base/strides2order/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/sub2ind/package.json b/base/sub2ind/package.json index 4fb613e1..0928183b 100644 --- a/base/sub2ind/package.json +++ b/base/sub2ind/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/unary/examples/c/b_b/example.c b/base/unary/examples/c/b_b/example.c index 783dcd60..c78fe160 100644 --- a/base/unary/examples/c/b_b/example.c +++ b/base/unary/examples/c/b_b/example.c @@ -24,6 +24,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { int64_t i; @@ -36,7 +37,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %hhu\n", i, v ); + fprintf( stdout, "data[%"PRId64"] = %hhu\n", i, v ); } } diff --git a/base/unary/examples/c/c_c/example.c b/base/unary/examples/c/c_c/example.c index 4c22a9f9..e07dddb7 100644 --- a/base/unary/examples/c/c_c/example.c +++ b/base/unary/examples/c/c_c/example.c @@ -25,6 +25,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { float complex v; @@ -37,7 +38,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %f + %fi\n", i, crealf( v ), cimagf( v ) ); + fprintf( stdout, "data[%"PRId64"] = %f + %fi\n", i, crealf( v ), cimagf( v ) ); } } diff --git a/base/unary/examples/c/c_z/example.c b/base/unary/examples/c/c_z/example.c index 65657322..fee24f10 100644 --- a/base/unary/examples/c/c_z/example.c +++ b/base/unary/examples/c/c_z/example.c @@ -25,6 +25,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { double complex v; @@ -37,7 +38,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %lf + %lfi\n", i, creal( v ), cimag( v ) ); + fprintf( stdout, "data[%"PRId64"] = %lf + %lfi\n", i, creal( v ), cimag( v ) ); } } diff --git a/base/unary/examples/c/d_d/example.c b/base/unary/examples/c/d_d/example.c index 3627387c..fc610677 100644 --- a/base/unary/examples/c/d_d/example.c +++ b/base/unary/examples/c/d_d/example.c @@ -24,6 +24,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { int64_t i; @@ -36,7 +37,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %lf\n", i, v ); + fprintf( stdout, "data[%"PRId64"] = %lf\n", i, v ); } } diff --git a/base/unary/examples/c/d_z/example.c b/base/unary/examples/c/d_z/example.c index 72a0e1f5..6d5df9b3 100644 --- a/base/unary/examples/c/d_z/example.c +++ b/base/unary/examples/c/d_z/example.c @@ -25,6 +25,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { double complex v; @@ -37,7 +38,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %lf + %lfi\n", i, creal( v ), cimag( v ) ); + fprintf( stdout, "data[%"PRId64"] = %lf + %lfi\n", i, creal( v ), cimag( v ) ); } } diff --git a/base/unary/examples/c/d_z_as_z_z/example.c b/base/unary/examples/c/d_z_as_z_z/example.c index ae23c48d..138221c3 100644 --- a/base/unary/examples/c/d_z_as_z_z/example.c +++ b/base/unary/examples/c/d_z_as_z_z/example.c @@ -25,6 +25,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { double complex v; @@ -37,7 +38,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %lf + %lfi\n", i, creal( v ), cimag( v ) ); + fprintf( stdout, "data[%"PRId64"] = %lf + %lfi\n", i, creal( v ), cimag( v ) ); } } diff --git a/base/unary/examples/c/f_f/example.c b/base/unary/examples/c/f_f/example.c index 5c4fed08..08a50d02 100644 --- a/base/unary/examples/c/f_f/example.c +++ b/base/unary/examples/c/f_f/example.c @@ -24,6 +24,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { int64_t i; @@ -36,7 +37,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %f\n", i, v ); + fprintf( stdout, "data[%"PRId64"] = %f\n", i, v ); } } diff --git a/base/unary/examples/c/i_i/example.c b/base/unary/examples/c/i_i/example.c index fcba1d75..98614ca4 100644 --- a/base/unary/examples/c/i_i/example.c +++ b/base/unary/examples/c/i_i/example.c @@ -24,6 +24,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { int32_t v; @@ -36,7 +37,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %i\n", i, v ); + fprintf( stdout, "data[%"PRId64"] = %i\n", i, v ); } } diff --git a/base/unary/examples/c/k_k/example.c b/base/unary/examples/c/k_k/example.c index 6ad4d8de..2175cf66 100644 --- a/base/unary/examples/c/k_k/example.c +++ b/base/unary/examples/c/k_k/example.c @@ -24,6 +24,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { int16_t v; @@ -36,7 +37,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %d\n", i, v ); + fprintf( stdout, "data[%"PRId64"] = %d\n", i, v ); } } diff --git a/base/unary/examples/c/l_l/example.c b/base/unary/examples/c/l_l/example.c index 2ea189e2..43d955be 100644 --- a/base/unary/examples/c/l_l/example.c +++ b/base/unary/examples/c/l_l/example.c @@ -24,6 +24,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { int64_t v; @@ -36,7 +37,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %lli\n", i, v ); + fprintf( stdout, "data[%"PRId64"] = %"PRId64"\n", i, v ); } } diff --git a/base/unary/examples/c/s_s/example.c b/base/unary/examples/c/s_s/example.c index 4b1063c4..309f00a2 100644 --- a/base/unary/examples/c/s_s/example.c +++ b/base/unary/examples/c/s_s/example.c @@ -24,6 +24,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { int64_t i; @@ -36,7 +37,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %hhi\n", i, v ); + fprintf( stdout, "data[%"PRId64"] = %hhi\n", i, v ); } } diff --git a/base/unary/examples/c/t_t/example.c b/base/unary/examples/c/t_t/example.c index 9c20d73b..4d026c51 100644 --- a/base/unary/examples/c/t_t/example.c +++ b/base/unary/examples/c/t_t/example.c @@ -24,6 +24,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { uint16_t v; @@ -36,7 +37,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %u\n", i, v ); + fprintf( stdout, "data[%"PRId64"] = %u\n", i, v ); } } diff --git a/base/unary/examples/c/u_u/example.c b/base/unary/examples/c/u_u/example.c index 9b57208d..62e02e60 100644 --- a/base/unary/examples/c/u_u/example.c +++ b/base/unary/examples/c/u_u/example.c @@ -24,6 +24,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { uint32_t v; @@ -36,7 +37,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %lu\n", i, v ); + fprintf( stdout, "data[%"PRId64"] = %lu\n", i, v ); } } diff --git a/base/unary/examples/c/v_v/example.c b/base/unary/examples/c/v_v/example.c index c490371e..1c325855 100644 --- a/base/unary/examples/c/v_v/example.c +++ b/base/unary/examples/c/v_v/example.c @@ -24,6 +24,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { uint64_t v; @@ -36,7 +37,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %llu\n", i, v ); + fprintf( stdout, "data[%"PRId64"] = %"PRIu64"\n", i, v ); } } diff --git a/base/unary/examples/c/x_x/example.c b/base/unary/examples/c/x_x/example.c index 54a2e073..cb2d21ac 100644 --- a/base/unary/examples/c/x_x/example.c +++ b/base/unary/examples/c/x_x/example.c @@ -25,6 +25,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { int64_t i; @@ -37,7 +38,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %d\n", i, v ); + fprintf( stdout, "data[%"PRId64"] = %d\n", i, v ); } } diff --git a/base/unary/examples/c/z_z/example.c b/base/unary/examples/c/z_z/example.c index fb24d481..d306d600 100644 --- a/base/unary/examples/c/z_z/example.c +++ b/base/unary/examples/c/z_z/example.c @@ -25,6 +25,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { double complex v; @@ -37,7 +38,7 @@ void print_ndarray_contents( const struct ndarray *x ) { fprintf( stderr, "Unable to resolve data element.\n" ); exit( EXIT_FAILURE ); } - fprintf( stdout, "data[%lld] = %lf + %lfi\n", i, creal( v ), cimag( v ) ); + fprintf( stdout, "data[%"PRId64"] = %lf + %lfi\n", i, creal( v ), cimag( v ) ); } } diff --git a/base/unary/package.json b/base/unary/package.json index 91d891f7..95d6e1ed 100644 --- a/base/unary/package.json +++ b/base/unary/package.json @@ -20,6 +20,7 @@ "example": "./examples", "include": "./include", "lib": "./lib", + "scripts": "./scripts", "src": "./src", "test": "./test" }, diff --git a/base/vind2bind/package.json b/base/vind2bind/package.json index b50dba5e..ca76ddd4 100644 --- a/base/vind2bind/package.json +++ b/base/vind2bind/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/base/wrap-index/package.json b/base/wrap-index/package.json index c49a8a1e..1183aa34 100644 --- a/base/wrap-index/package.json +++ b/base/wrap-index/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/casting-modes/package.json b/casting-modes/package.json index a3461983..5335c08d 100644 --- a/casting-modes/package.json +++ b/casting-modes/package.json @@ -18,6 +18,7 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", "test": "./test" }, diff --git a/ctor/README.md b/ctor/README.md index 8e5848f5..0d51fc04 100644 --- a/ctor/README.md +++ b/ctor/README.md @@ -3330,6 +3330,7 @@ Notes: #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { int64_t i; @@ -3342,7 +3343,7 @@ void print_ndarray_contents( const struct ndarray *x ) { printf( "Unable to resolve data element.\n" ); exit( 1 ); } - printf( "data[%lld] = %f\n", i, v ); + printf( "data[%"PRId64"] = %f\n", i, v ); } } @@ -3402,8 +3403,8 @@ int main() { x1->flags = stdlib_ndarray_flags( x1 ); printf( "dtype = %u\n", stdlib_ndarray_dtype( x1 ) ); - printf( "length = %lld\n", stdlib_ndarray_length( x1 ) ); - printf( "byteLength = %lld\n", stdlib_ndarray_bytelength( x1 ) ); + printf( "length = %"PRId64"\n", stdlib_ndarray_length( x1 ) ); + printf( "byteLength = %"PRId64"\n", stdlib_ndarray_bytelength( x1 ) ); printf( "ltr = %u\n", stdlib_ndarray_dtype_char( stdlib_ndarray_dtype( x1 ) ) ); printf( "\n" ); @@ -3415,8 +3416,8 @@ int main() { } printf( "dtype = %u\n", stdlib_ndarray_dtype( x2 ) ); - printf( "length = %lld\n", stdlib_ndarray_length( x2 ) ); - printf( "byteLength = %lld\n", stdlib_ndarray_bytelength( x2 ) ); + printf( "length = %"PRId64"\n", stdlib_ndarray_length( x2 ) ); + printf( "byteLength = %"PRId64"\n", stdlib_ndarray_bytelength( x2 ) ); printf( "ltr = %u\n", stdlib_ndarray_dtype_char( stdlib_ndarray_dtype( x2 ) ) ); printf( "\n" ); diff --git a/ctor/benchmark/c/benchmark.c b/ctor/benchmark/c/benchmark.c index 877a3885..c18cd5ce 100644 --- a/ctor/benchmark/c/benchmark.c +++ b/ctor/benchmark/c/benchmark.c @@ -29,6 +29,7 @@ #include #include #include +#include #define NAME "ndarray" #define ITERATIONS 1000000 @@ -203,7 +204,7 @@ double benchmark3() { t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - buffer[ 0 ] = i % 255; + buffer[ 0 ] = i % 255; // cppcheck-suppress unreadVariable v = stdlib_ndarray_data( arr ); if ( v[ 0 ] != (i%255) ) { printf( "unexpected result\n" ); @@ -1404,7 +1405,7 @@ double benchmark28() { idx = (int64_t)( (rand_double()*30.0)-15.0 ); s = stdlib_ndarray_iget( arr, idx, (void *)&v ); if ( s != 0 || v > 6 ) { - printf( "unexpected result: idx=%lld, v=%u\n", idx, v ); + printf( "unexpected result: idx=%"PRId64", v=%u\n", idx, v ); break; } } diff --git a/ctor/examples/c/example.c b/ctor/examples/c/example.c index 3a29312b..bc4c98ea 100644 --- a/ctor/examples/c/example.c +++ b/ctor/examples/c/example.c @@ -25,6 +25,7 @@ #include #include #include +#include void print_ndarray_contents( const struct ndarray *x ) { int64_t i; @@ -37,7 +38,7 @@ void print_ndarray_contents( const struct ndarray *x ) { printf( "Unable to resolve data element.\n" ); exit( 1 ); } - printf( "data[%lld] = %f\n", i, v ); + printf( "data[%"PRId64"] = %f\n", i, v ); } } @@ -97,8 +98,8 @@ int main() { x1->flags = stdlib_ndarray_flags( x1 ); printf( "dtype = %d\n", stdlib_ndarray_dtype( x1 ) ); - printf( "length = %lld\n", stdlib_ndarray_length( x1 ) ); - printf( "byteLength = %lld\n", stdlib_ndarray_bytelength( x1 ) ); + printf( "length = %"PRId64"\n", stdlib_ndarray_length( x1 ) ); + printf( "byteLength = %"PRId64"\n", stdlib_ndarray_bytelength( x1 ) ); printf( "ltr = %u\n", stdlib_ndarray_dtype_char( stdlib_ndarray_dtype( x1 ) ) ); printf( "\n" ); @@ -110,8 +111,8 @@ int main() { } printf( "dtype = %d\n", stdlib_ndarray_dtype( x2 ) ); - printf( "length = %lld\n", stdlib_ndarray_length( x2 ) ); - printf( "byteLength = %lld\n", stdlib_ndarray_bytelength( x2 ) ); + printf( "length = %"PRId64"\n", stdlib_ndarray_length( x2 ) ); + printf( "byteLength = %"PRId64"\n", stdlib_ndarray_bytelength( x2 ) ); printf( "ltr = %u\n", stdlib_ndarray_dtype_char( stdlib_ndarray_dtype( x2 ) ) ); printf( "\n" ); @@ -122,7 +123,7 @@ int main() { printf( "Unable to resolve data pointer.\n" ); exit( 1 ); } - *(double *)ptr = 1.0; + *(double *)ptr = 1.0; // cppcheck-suppress invalidPointerCast sub[ 0 ] = 1; ptr = stdlib_ndarray_get_ptr( x2, sub ); @@ -130,7 +131,7 @@ int main() { printf( "Unable to resolve data pointer.\n" ); exit( 1 ); } - *(double *)ptr = 2.0; + *(double *)ptr = 2.0; // cppcheck-suppress invalidPointerCast sub[ 0 ] = 2; ptr = stdlib_ndarray_get_ptr( x2, sub ); @@ -138,7 +139,7 @@ int main() { printf( "Unable to resolve data pointer.\n" ); exit( 1 ); } - *(double *)ptr = 3.0; + *(double *)ptr = 3.0; // cppcheck-suppress invalidPointerCast // Print out the current ndarray elements: print_ndarray_contents( x2 ); diff --git a/index-modes/package.json b/index-modes/package.json index 2eca28e7..564c2194 100644 --- a/index-modes/package.json +++ b/index-modes/package.json @@ -18,6 +18,7 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", "test": "./test" }, diff --git a/next-dtype/package.json b/next-dtype/package.json index abd09f16..8946f280 100644 --- a/next-dtype/package.json +++ b/next-dtype/package.json @@ -18,6 +18,7 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", "test": "./test" }, diff --git a/orders/package.json b/orders/package.json index e6b40263..6096a415 100644 --- a/orders/package.json +++ b/orders/package.json @@ -18,6 +18,7 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", "test": "./test" }, diff --git a/package.json b/package.json index a629e2bd..0fd47fb1 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,8 @@ ], "main": "./lib", "directories": { + "doc": "./docs", + "example": "./examples", "lib": "./lib", "test": "./test" }, @@ -34,22 +36,22 @@ "url": "https://github.com/stdlib-js/stdlib/issues" }, "dependencies": { - "@stdlib/array": "^0.0.x", - "@stdlib/assert": "^0.0.x", - "@stdlib/bigint": "^0.0.x", - "@stdlib/buffer": "^0.0.x", - "@stdlib/complex": "^0.0.x", - "@stdlib/constants": "^0.0.x", - "@stdlib/math": "^0.0.x", - "@stdlib/number": "^0.0.x", - "@stdlib/string": "^0.0.x", - "@stdlib/types": "^0.0.x", - "@stdlib/utils": "^0.0.x" + "@stdlib/array": "github:stdlib-js/array", + "@stdlib/assert": "github:stdlib-js/assert", + "@stdlib/bigint": "github:stdlib-js/bigint", + "@stdlib/buffer": "github:stdlib-js/buffer", + "@stdlib/complex": "github:stdlib-js/complex", + "@stdlib/constants": "github:stdlib-js/constants", + "@stdlib/math": "github:stdlib-js/math", + "@stdlib/number": "github:stdlib-js/number", + "@stdlib/string": "github:stdlib-js/string", + "@stdlib/types": "github:stdlib-js/types", + "@stdlib/utils": "github:stdlib-js/utils" }, "devDependencies": { - "@stdlib/bench": "^0.0.x", - "@stdlib/blas": "^0.0.x", - "@stdlib/random": "^0.0.x", + "@stdlib/bench": "github:stdlib-js/bench", + "@stdlib/blas": "github:stdlib-js/blas", + "@stdlib/random": "github:stdlib-js/random", "proxyquire": "^2.0.0", "tape": "git+https://github.com/kgryte/tape.git#fix/globby", "istanbul": "^0.4.1", diff --git a/promotion-rules/package.json b/promotion-rules/package.json index 5224d260..ba74080e 100644 --- a/promotion-rules/package.json +++ b/promotion-rules/package.json @@ -18,6 +18,7 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", "test": "./test" }, diff --git a/safe-casts/package.json b/safe-casts/package.json index 4b6e28a6..27e496da 100644 --- a/safe-casts/package.json +++ b/safe-casts/package.json @@ -18,6 +18,7 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", "test": "./test" }, diff --git a/same-kind-casts/package.json b/same-kind-casts/package.json index f9039a9d..766700b6 100644 --- a/same-kind-casts/package.json +++ b/same-kind-casts/package.json @@ -18,6 +18,7 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", "test": "./test" },