From 89b859b824d81f2c85b7ff6c5db185cef1553de7 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 18 Apr 2024 04:42:19 +0000 Subject: [PATCH] Auto-generated commit --- CONTRIBUTORS | 4 ++++ manifest.json | 18 ++++++++++++------ package.json | 1 + src/addon.c | 8 ++------ 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 4500383..0570891 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -5,6 +5,7 @@ Adarsh Palaskar Aditya Sapra AgPriyanshu18 <113460573+AgPriyanshu18@users.noreply.github.com> +Aleksandr <112382387+alextes90@users.noreply.github.com> Ali Salesi Aman Bhansali Amit Jimiwal @@ -69,8 +70,10 @@ Seyyed Parsa Neshaei Shashank Shekhar Singh Shivam <11shivam00@gmail.com> Shraddheya Shendre +Shubh Mehta <93862397+Shubh942@users.noreply.github.com> Shubham Mishra Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> +Soumajit Chatterjee <121816890+soumajit23@users.noreply.github.com> Spandan Barve Stephannie Jiménez Gacha Suraj kumar <125961509+kumarsuraj212003@users.noreply.github.com> @@ -83,4 +86,5 @@ Yernar Yergaziyev naveen nishant-s7 <97207366+nishant-s7@users.noreply.github.com> orimiles5 <97595296+orimiles5@users.noreply.github.com> +rainn <88160429+AmCodesLame@users.noreply.github.com> rei2hu diff --git a/manifest.json b/manifest.json index 713e649..fe8f4a1 100644 --- a/manifest.json +++ b/manifest.json @@ -47,7 +47,8 @@ "@stdlib/napi-export", "@stdlib/napi-argv", "@stdlib/napi-argv-int64", - "@stdlib/napi-argv-strided-float64array" + "@stdlib/napi-argv-strided-float64array", + "@stdlib/napi-create-double" ] }, { @@ -101,7 +102,8 @@ "@stdlib/napi-export", "@stdlib/napi-argv", "@stdlib/napi-argv-int64", - "@stdlib/napi-argv-strided-float64array" + "@stdlib/napi-argv-strided-float64array", + "@stdlib/napi-create-double" ] }, { @@ -160,7 +162,8 @@ "@stdlib/napi-export", "@stdlib/napi-argv", "@stdlib/napi-argv-int64", - "@stdlib/napi-argv-strided-float64array" + "@stdlib/napi-argv-strided-float64array", + "@stdlib/napi-create-double" ] }, { @@ -213,7 +216,8 @@ "@stdlib/napi-export", "@stdlib/napi-argv", "@stdlib/napi-argv-int64", - "@stdlib/napi-argv-strided-float64array" + "@stdlib/napi-argv-strided-float64array", + "@stdlib/napi-create-double" ] }, { @@ -271,7 +275,8 @@ "@stdlib/napi-export", "@stdlib/napi-argv", "@stdlib/napi-argv-int64", - "@stdlib/napi-argv-strided-float64array" + "@stdlib/napi-argv-strided-float64array", + "@stdlib/napi-create-double" ] }, { @@ -328,7 +333,8 @@ "@stdlib/napi-export", "@stdlib/napi-argv", "@stdlib/napi-argv-int64", - "@stdlib/napi-argv-strided-float64array" + "@stdlib/napi-argv-strided-float64array", + "@stdlib/napi-create-double" ] }, { diff --git a/package.json b/package.json index 1bebb79..ce44425 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "@stdlib/napi-argv": "^0.2.1", "@stdlib/napi-argv-int64": "^0.2.1", "@stdlib/napi-argv-strided-float64array": "^0.2.1", + "@stdlib/napi-create-double": "github:stdlib-js/napi-create-double#main", "@stdlib/napi-export": "^0.2.1", "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1", "@stdlib/utils-library-manifest": "^0.2.1", diff --git a/src/addon.c b/src/addon.c index bc89133..e36f668 100644 --- a/src/addon.c +++ b/src/addon.c @@ -21,8 +21,8 @@ #include "stdlib/napi/argv.h" #include "stdlib/napi/argv_int64.h" #include "stdlib/napi/argv_strided_float64array.h" +#include "stdlib/napi/create_double.h" #include -#include /** * Receives JavaScript callback invocation data. @@ -39,11 +39,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 4 ); STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 ); STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, Y, N, strideY, argv, 3 ); - - napi_value v; - napi_status status = napi_create_double( env, c_ddot( N, X, strideX, Y, strideY ), &v ); - assert( status == napi_ok ); - + STDLIB_NAPI_CREATE_DOUBLE( env, c_ddot( N, X, strideX, Y, strideY ), v ); return v; }