diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_c.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_c.c index d49e0c2331e3..dbcf07dbba52 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_c.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_c.c @@ -88,7 +88,7 @@ * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -107,7 +107,7 @@ * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_0d( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_0d( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; int8_t status = stdlib_ndarray_iset_complex128( arrays[ 0 ], 0, stdlib_complex128_from_complex64( f() ) ); @@ -175,7 +175,7 @@ int8_t stdlib_ndarray_z_as_c_0d( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -194,10 +194,13 @@ int8_t stdlib_ndarray_z_as_c_0d( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_1d( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_1d( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_1D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_1D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -259,7 +262,7 @@ int8_t stdlib_ndarray_z_as_c_1d( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -278,10 +281,13 @@ int8_t stdlib_ndarray_z_as_c_1d( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_2d( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_2d( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_2D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_2D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -343,7 +349,7 @@ int8_t stdlib_ndarray_z_as_c_2d( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -362,10 +368,13 @@ int8_t stdlib_ndarray_z_as_c_2d( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_2d_blocked( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_2d_blocked( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_2D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_2D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -427,7 +436,7 @@ int8_t stdlib_ndarray_z_as_c_2d_blocked( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -446,10 +455,13 @@ int8_t stdlib_ndarray_z_as_c_2d_blocked( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_3d( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_3d( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_3D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_3D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -511,7 +523,7 @@ int8_t stdlib_ndarray_z_as_c_3d( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -530,10 +542,13 @@ int8_t stdlib_ndarray_z_as_c_3d( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_3d_blocked( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_3d_blocked( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_3D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_3D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -595,7 +610,7 @@ int8_t stdlib_ndarray_z_as_c_3d_blocked( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -614,10 +629,13 @@ int8_t stdlib_ndarray_z_as_c_3d_blocked( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_4d( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_4d( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_4D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_4D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -679,7 +697,7 @@ int8_t stdlib_ndarray_z_as_c_4d( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -698,10 +716,13 @@ int8_t stdlib_ndarray_z_as_c_4d( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_4d_blocked( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_4d_blocked( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_4D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_4D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -763,7 +784,7 @@ int8_t stdlib_ndarray_z_as_c_4d_blocked( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -782,10 +803,13 @@ int8_t stdlib_ndarray_z_as_c_4d_blocked( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_5d( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_5d( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_5D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_5D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -847,7 +871,7 @@ int8_t stdlib_ndarray_z_as_c_5d( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -866,10 +890,13 @@ int8_t stdlib_ndarray_z_as_c_5d( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_5d_blocked( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_5d_blocked( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_5D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_5D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -931,7 +958,7 @@ int8_t stdlib_ndarray_z_as_c_5d_blocked( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -950,10 +977,13 @@ int8_t stdlib_ndarray_z_as_c_5d_blocked( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_6d( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_6d( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_6D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_6D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -1015,7 +1045,7 @@ int8_t stdlib_ndarray_z_as_c_6d( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -1034,10 +1064,13 @@ int8_t stdlib_ndarray_z_as_c_6d( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_6d_blocked( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_6d_blocked( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_6D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_6D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -1099,7 +1132,7 @@ int8_t stdlib_ndarray_z_as_c_6d_blocked( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -1118,10 +1151,13 @@ int8_t stdlib_ndarray_z_as_c_6d_blocked( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_7d( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_7d( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_7D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_7D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -1183,7 +1219,7 @@ int8_t stdlib_ndarray_z_as_c_7d( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -1202,10 +1238,13 @@ int8_t stdlib_ndarray_z_as_c_7d( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_7d_blocked( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_7d_blocked( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_7D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_7D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -1267,7 +1306,7 @@ int8_t stdlib_ndarray_z_as_c_7d_blocked( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -1286,10 +1325,13 @@ int8_t stdlib_ndarray_z_as_c_7d_blocked( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_8d( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_8d( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_8D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_8D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -1351,7 +1393,7 @@ int8_t stdlib_ndarray_z_as_c_8d( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -1370,10 +1412,13 @@ int8_t stdlib_ndarray_z_as_c_8d( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_8d_blocked( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_8d_blocked( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_8D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_8D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -1435,7 +1480,7 @@ int8_t stdlib_ndarray_z_as_c_8d_blocked( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -1454,10 +1499,13 @@ int8_t stdlib_ndarray_z_as_c_8d_blocked( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_9d( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_9d( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_9D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_9D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -1519,7 +1567,7 @@ int8_t stdlib_ndarray_z_as_c_9d( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -1538,10 +1586,13 @@ int8_t stdlib_ndarray_z_as_c_9d( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_9d_blocked( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_9d_blocked( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_9D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_9D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -1603,7 +1654,7 @@ int8_t stdlib_ndarray_z_as_c_9d_blocked( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -1622,10 +1673,13 @@ int8_t stdlib_ndarray_z_as_c_9d_blocked( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_10d( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_10d( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_10D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_10D_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -1687,7 +1741,7 @@ int8_t stdlib_ndarray_z_as_c_10d( struct ndarray *arrays[], void *fcn ) { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -1706,10 +1760,13 @@ int8_t stdlib_ndarray_z_as_c_10d( struct ndarray *arrays[], void *fcn ) { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_10d_blocked( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_10d_blocked( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_10D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_10D_BLOCKED_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } @@ -1771,7 +1828,7 @@ int8_t stdlib_ndarray_z_as_c_10d_blocked( struct ndarray *arrays[], void *fcn ) * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -1790,27 +1847,30 @@ int8_t stdlib_ndarray_z_as_c_10d_blocked( struct ndarray *arrays[], void *fcn ) * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c_nd( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c_nd( struct ndarray * const arrays[], void *fcn ) { typedef stdlib_complex64_t func_type( void ); func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_NULLARY_ND_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + int8_t status = STDLIB_NDARRAY_NULLARY_ND_LOOP_CLBK_RET_CAST_FCN( stdlib_complex128_t, stdlib_complex128_from_complex64 ) + if ( status != 0 ) { + return -1; + } return 0; } // Define a list of nullary ndarray functions: static ndarrayNullaryFcn functions[] = { - stdlib_ndarray_z_as_c_0d, - stdlib_ndarray_z_as_c_1d, - stdlib_ndarray_z_as_c_2d, - stdlib_ndarray_z_as_c_3d, - stdlib_ndarray_z_as_c_4d, - stdlib_ndarray_z_as_c_5d, - stdlib_ndarray_z_as_c_6d, - stdlib_ndarray_z_as_c_7d, - stdlib_ndarray_z_as_c_8d, - stdlib_ndarray_z_as_c_9d, - stdlib_ndarray_z_as_c_10d, - stdlib_ndarray_z_as_c_nd + (int8_t (*)(struct ndarray *const[], void *))stdlib_ndarray_z_as_c_0d, + (int8_t (*)(struct ndarray *const[], void *))stdlib_ndarray_z_as_c_1d, + (int8_t (*)(struct ndarray *const[], void *))stdlib_ndarray_z_as_c_2d, + (int8_t (*)(struct ndarray *const[], void *))stdlib_ndarray_z_as_c_3d, + (int8_t (*)(struct ndarray *const[], void *))stdlib_ndarray_z_as_c_4d, + (int8_t (*)(struct ndarray *const[], void *))stdlib_ndarray_z_as_c_5d, + (int8_t (*)(struct ndarray *const[], void *))stdlib_ndarray_z_as_c_6d, + (int8_t (*)(struct ndarray *const[], void *))stdlib_ndarray_z_as_c_7d, + (int8_t (*)(struct ndarray *const[], void *))stdlib_ndarray_z_as_c_8d, + (int8_t (*)(struct ndarray *const[], void *))stdlib_ndarray_z_as_c_9d, + (int8_t (*)(struct ndarray *const[], void *))stdlib_ndarray_z_as_c_10d, + (int8_t (*)(struct ndarray *const[], void *))stdlib_ndarray_z_as_c_nd }; // Define a list of nullary ndarray functions implementing loop blocking... @@ -1899,7 +1959,7 @@ static const struct ndarrayNullaryDispatchObject obj = { * } * * // Create an array containing a pointer to the ndarray: -* struct ndarray *arrays[] = { x }; +* struct ndarray * const arrays[] = { x }; * * // Define a callback: * static stdlib_complex64_t fcn( void ) { @@ -1918,6 +1978,6 @@ static const struct ndarrayNullaryDispatchObject obj = { * // Free allocated memory: * stdlib_ndarray_free( x ); */ -int8_t stdlib_ndarray_z_as_c( struct ndarray *arrays[], void *fcn ) { +int8_t stdlib_ndarray_z_as_c( struct ndarray * const arrays[], void *fcn ) { return stdlib_ndarray_nullary_dispatch( &obj, arrays, fcn ); }