numpy 2.0.0
src/multiarray/dtype_transfer.c File Reference
#include "Python.h"
#include "structmember.h"
#include <numpy/ndarrayobject.h>
#include <numpy/npy_cpu.h>
#include "numpy/npy_3kcompat.h"
#include "convert_datatype.h"
#include "_datetime.h"
#include "datetime_strings.h"
#include "lowlevel_strided_loops.h"

Data Structures

struct  _strided_zero_pad_data
struct  _align_wrap_data
struct  _wrap_copy_swap_data
struct  _strided_cast_data
struct  _strided_datetime_cast_data
struct  _one_to_n_data
struct  _n_to_n_data
struct  _subarray_broadcast_offsetrun
struct  _subarray_broadcast_data
struct  _single_field_transfer
struct  _field_transfer_data
struct  _masked_wrapper_transfer_data
struct  _dst_memset_zero_data

Defines

#define PY_SSIZE_T_CLEAN
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
#define NPY_LOWLEVEL_BUFFER_BLOCKSIZE   128
#define NPY_DT_DBG_TRACING   0
#define NPY_DT_REF_DBG_TRACING   0
#define NPY_DT_DBG_REFTRACE(msg, ref)

Functions

static int get_decsrcref_transfer_function (int aligned, npy_intp src_stride, PyArray_Descr *src_dtype, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api)
static int get_setdstzero_transfer_function (int aligned, npy_intp dst_stride, PyArray_Descr *dst_dtype, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api)
NPY_NO_EXPORT int get_bool_setdstone_transfer_function (npy_intp dst_stride, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *NPY_UNUSED(out_needs_api))
static void _strided_to_strided_move_references (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
static void _strided_to_strided_copy_references (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
NpyAuxData_strided_zero_pad_data_clone (NpyAuxData *data)
static void _strided_to_strided_zero_pad_copy (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
static void _strided_to_strided_truncate_copy (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
NPY_NO_EXPORT int PyArray_GetStridedZeroPadCopyFn (int aligned, npy_intp src_stride, npy_intp dst_stride, npy_intp src_itemsize, npy_intp dst_itemsize, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata)
void _align_wrap_data_free (NpyAuxData *data)
NpyAuxData_align_wrap_data_clone (NpyAuxData *data)
static void _strided_to_strided_contig_align_wrap (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
static void _strided_to_strided_contig_align_wrap_init_dest (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
NPY_NO_EXPORT int wrap_aligned_contig_transfer_function (npy_intp src_itemsize, npy_intp dst_itemsize, PyArray_StridedTransferFn *tobuffer, NpyAuxData *todata, PyArray_StridedTransferFn *frombuffer, NpyAuxData *fromdata, PyArray_StridedTransferFn *wrapped, NpyAuxData *wrappeddata, int init_dest, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata)
void _wrap_copy_swap_data_free (NpyAuxData *data)
NpyAuxData_wrap_copy_swap_data_clone (NpyAuxData *data)
static void _strided_to_strided_wrap_copy_swap (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp NPY_UNUSED(src_itemsize), NpyAuxData *data)
static int wrap_copy_swap_function (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *dtype, int should_swap, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata)
void _strided_cast_data_free (NpyAuxData *data)
NpyAuxData_strided_cast_data_clone (NpyAuxData *data)
static void _aligned_strided_to_strided_cast (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
static void _aligned_strided_to_strided_cast_decref_src (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
static void _aligned_contig_to_contig_cast (char *dst, npy_intp NPY_UNUSED(dst_stride), char *src, npy_intp NPY_UNUSED(src_stride), npy_intp N, npy_intp NPY_UNUSED(itemsize), NpyAuxData *data)
static int get_nbo_cast_numeric_transfer_function (int aligned, npy_intp src_stride, npy_intp dst_stride, int src_type_num, int dst_type_num, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata)
void _strided_datetime_cast_data_free (NpyAuxData *data)
NpyAuxData_strided_datetime_cast_data_clone (NpyAuxData *data)
static void _strided_to_strided_datetime_general_cast (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
static void _strided_to_strided_datetime_cast (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
static void _aligned_strided_to_strided_datetime_cast (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
static void _strided_to_strided_datetime_to_string (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp NPY_UNUSED(src_itemsize), NpyAuxData *data)
static void _strided_to_strided_string_to_datetime (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
static int get_nbo_cast_datetime_transfer_function (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata)
static int get_nbo_datetime_to_string_transfer_function (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata)
static int get_datetime_to_unicode_transfer_function (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api)
static int get_nbo_string_to_datetime_transfer_function (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata)
static int get_unicode_to_datetime_transfer_function (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api)
static int get_nbo_cast_transfer_function (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, int move_references, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api, int *out_needs_wrap)
static int get_cast_transfer_function (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, int move_references, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api)
void _one_to_n_data_free (NpyAuxData *data)
NpyAuxData_one_to_n_data_clone (NpyAuxData *data)
static void _strided_to_strided_one_to_n (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
static void _strided_to_strided_one_to_n_with_finish (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
static int wrap_transfer_function_one_to_n (PyArray_StridedTransferFn *stransfer_inner, NpyAuxData *data_inner, PyArray_StridedTransferFn *stransfer_finish_src, NpyAuxData *data_finish_src, npy_intp dst_itemsize, npy_intp N, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata)
static int get_one_to_n_transfer_function (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, int move_references, npy_intp N, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api)
void _n_to_n_data_free (NpyAuxData *data)
NpyAuxData_n_to_n_data_clone (NpyAuxData *data)
static void _strided_to_strided_n_to_n (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *data)
static void _contig_to_contig_n_to_n (char *dst, npy_intp NPY_UNUSED(dst_stride), char *src, npy_intp NPY_UNUSED(src_stride), npy_intp N, npy_intp NPY_UNUSED(src_itemsize), NpyAuxData *data)
static int wrap_transfer_function_n_to_n (PyArray_StridedTransferFn *stransfer_inner, NpyAuxData *data_inner, npy_intp src_stride, npy_intp dst_stride, npy_intp src_itemsize, npy_intp dst_itemsize, npy_intp N, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata)
static int get_n_to_n_transfer_function (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, int move_references, npy_intp N, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api)
void _subarray_broadcast_data_free (NpyAuxData *data)
NpyAuxData_subarray_broadcast_data_clone (NpyAuxData *data)
static void _strided_to_strided_subarray_broadcast (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp NPY_UNUSED(src_itemsize), NpyAuxData *data)
static void _strided_to_strided_subarray_broadcast_withrefs (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp NPY_UNUSED(src_itemsize), NpyAuxData *data)
static int get_subarray_broadcast_transfer_function (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, npy_intp src_size, npy_intp dst_size, PyArray_Dims src_shape, PyArray_Dims dst_shape, int move_references, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api)
static int get_subarray_transfer_function (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, int move_references, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api)
void _field_transfer_data_free (NpyAuxData *data)
NpyAuxData_field_transfer_data_clone (NpyAuxData *data)
static void _strided_to_strided_field_transfer (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp NPY_UNUSED(src_itemsize), NpyAuxData *data)
static int get_fields_transfer_function (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, int move_references, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api)
static int get_decsrcref_fields_transfer_function (int aligned, npy_intp src_stride, PyArray_Descr *src_dtype, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api)
static int get_setdestzero_fields_transfer_function (int aligned, npy_intp dst_stride, PyArray_Descr *dst_dtype, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api)
void _masked_wrapper_transfer_data_free (NpyAuxData *data)
NpyAuxData_masked_wrapper_transfer_data_clone (NpyAuxData *data)
void _strided_masked_wrapper_decsrcref_transfer_function (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_mask *mask, npy_intp mask_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *transferdata)
void _strided_masked_wrapper_transfer_function (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_mask *mask, npy_intp mask_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *transferdata)
static void _null_to_strided_set_bool_one (char *dst, npy_intp dst_stride, char *NPY_UNUSED(src), npy_intp NPY_UNUSED(src_stride), npy_intp N, npy_intp NPY_UNUSED(src_itemsize), NpyAuxData *NPY_UNUSED(data))
static void _null_to_contig_set_bool_one (char *dst, npy_intp NPY_UNUSED(dst_stride), char *NPY_UNUSED(src), npy_intp NPY_UNUSED(src_stride), npy_intp N, npy_intp NPY_UNUSED(src_itemsize), NpyAuxData *NPY_UNUSED(data))
NpyAuxData_dst_memset_zero_data_clone (NpyAuxData *data)
static void _null_to_strided_memset_zero (char *dst, npy_intp dst_stride, char *NPY_UNUSED(src), npy_intp NPY_UNUSED(src_stride), npy_intp N, npy_intp NPY_UNUSED(src_itemsize), NpyAuxData *data)
static void _null_to_contig_memset_zero (char *dst, npy_intp dst_stride, char *NPY_UNUSED(src), npy_intp NPY_UNUSED(src_stride), npy_intp N, npy_intp NPY_UNUSED(src_itemsize), NpyAuxData *data)
static void _null_to_strided_reference_setzero (char *dst, npy_intp dst_stride, char *NPY_UNUSED(src), npy_intp NPY_UNUSED(src_stride), npy_intp N, npy_intp NPY_UNUSED(src_itemsize), NpyAuxData *NPY_UNUSED(data))
static void _dec_src_ref_nop (char *NPY_UNUSED(dst), npy_intp NPY_UNUSED(dst_stride), char *NPY_UNUSED(src), npy_intp NPY_UNUSED(src_stride), npy_intp NPY_UNUSED(N), npy_intp NPY_UNUSED(src_itemsize), NpyAuxData *NPY_UNUSED(data))
static void _strided_to_null_dec_src_ref_reference (char *NPY_UNUSED(dst), npy_intp NPY_UNUSED(dst_stride), char *src, npy_intp src_stride, npy_intp N, npy_intp NPY_UNUSED(src_itemsize), NpyAuxData *NPY_UNUSED(data))
NPY_NO_EXPORT int PyArray_GetDTypeCopySwapFn (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *dtype, PyArray_StridedTransferFn **outstransfer, NpyAuxData **outtransferdata)
NPY_NO_EXPORT int PyArray_GetDTypeTransferFunction (int aligned, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, int move_references, PyArray_StridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api)
NPY_NO_EXPORT int PyArray_GetMaskedDTypeTransferFunction (int aligned, npy_intp src_stride, npy_intp dst_stride, npy_intp mask_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, PyArray_Descr *mask_dtype, int move_references, PyArray_MaskedStridedTransferFn **out_stransfer, NpyAuxData **out_transferdata, int *out_needs_api)
NPY_NO_EXPORT int PyArray_CastRawArrays (npy_intp count, char *src, char *dst, npy_intp src_stride, npy_intp dst_stride, PyArray_Descr *src_dtype, PyArray_Descr *dst_dtype, int move_references)

Define Documentation

#define _MULTIARRAYMODULE
#define NPY_DT_DBG_REFTRACE (   msg,
  ref 
)

Referenced by wrap_copy_swap_function().

#define NPY_DT_DBG_TRACING   0
**** PRINTF DEBUG TRACING *********
#define NPY_DT_REF_DBG_TRACING   0
Tracing incref/decref can be very noisy
#define NPY_LOWLEVEL_BUFFER_BLOCKSIZE   128

Referenced by _align_wrap_data_clone().

#define NPY_NO_DEPRECATED_API
#define PY_SSIZE_T_CLEAN

Function Documentation

NpyAuxData* _align_wrap_data_clone ( NpyAuxData data)
transfer data copy function

Round up the structure size to 16-byte boundary
Add space for two low level buffers
Allocate the data, and populate it

References NPY_LOWLEVEL_BUFFER_BLOCKSIZE.

static void _aligned_contig_to_contig_cast ( char *  dst,
npy_intp   NPY_UNUSEDdst_stride,
char *  src,
npy_intp   NPY_UNUSEDsrc_stride,
npy_intp  N,
npy_intp   NPY_UNUSEDitemsize,
NpyAuxData data 
) [static]

References NPY_DATETIME_NAT.

static void _aligned_strided_to_strided_cast ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]
static void _aligned_strided_to_strided_cast_decref_src ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]
This one requires src be of type NPY_OBJECT

After casting, decrement the source ref

static void _aligned_strided_to_strided_datetime_cast ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]

Apply the scaling

static void _contig_to_contig_n_to_n ( char *  dst,
npy_intp   NPY_UNUSEDdst_stride,
char *  src,
npy_intp   NPY_UNUSEDsrc_stride,
npy_intp  N,
npy_intp   NPY_UNUSEDsrc_itemsize,
NpyAuxData data 
) [static]

References NPY_FAIL, and PyArray_malloc.

Referenced by _strided_to_strided_one_to_n().

static void _dec_src_ref_nop ( char *  NPY_UNUSEDdst,
npy_intp   NPY_UNUSEDdst_stride,
char *  NPY_UNUSEDsrc,
npy_intp   NPY_UNUSEDsrc_stride,
npy_intp   NPY_UNUSEDN,
npy_intp   NPY_UNUSEDsrc_itemsize,
NpyAuxData NPY_UNUSEDdata 
) [static]

NOP

References NPY_FAIL.

NpyAuxData* _dst_memset_zero_data_clone ( NpyAuxData data)
zero-padded data copy function

References _strided_to_strided_copy_references().

Referenced by get_decsrcref_fields_transfer_function().

NpyAuxData* _field_transfer_data_clone ( NpyAuxData data)
transfer data copy function

Allocate the data and populate it
Copy all the fields transfer data

References NPY_AUXDATA_FREE, NPY_FAIL, and PyArray_free.

Referenced by get_fields_transfer_function().

void _field_transfer_data_free ( NpyAuxData data)
transfer data free function

Referenced by get_fields_transfer_function().

NpyAuxData* _masked_wrapper_transfer_data_clone ( NpyAuxData data)
transfer data copy function

Allocate the data and populate it
Clone all the owned auxdata as well

References NPY_AUXDATA_FREE, and NPY_FAIL.

void _masked_wrapper_transfer_data_free ( NpyAuxData data)
transfer data free function
NpyAuxData* _n_to_n_data_clone ( NpyAuxData data)
transfer data copy function

Allocate the data, and populate it

References _subarray_broadcast_offsetrun::count, and _subarray_broadcast_offsetrun::offset.

static void _null_to_contig_memset_zero ( char *  dst,
npy_intp  dst_stride,
char *  NPY_UNUSEDsrc,
npy_intp   NPY_UNUSEDsrc_stride,
npy_intp  N,
npy_intp   NPY_UNUSEDsrc_itemsize,
NpyAuxData data 
) [static]
static void _null_to_contig_set_bool_one ( char *  dst,
npy_intp   NPY_UNUSEDdst_stride,
char *  NPY_UNUSEDsrc,
npy_intp   NPY_UNUSEDsrc_stride,
npy_intp  N,
npy_intp   NPY_UNUSEDsrc_itemsize,
NpyAuxData NPY_UNUSEDdata 
) [static]

bool type is one byte, so can just use the char

static void _null_to_strided_memset_zero ( char *  dst,
npy_intp  dst_stride,
char *  NPY_UNUSEDsrc,
npy_intp   NPY_UNUSEDsrc_stride,
npy_intp  N,
npy_intp   NPY_UNUSEDsrc_itemsize,
NpyAuxData data 
) [static]
static void _null_to_strided_reference_setzero ( char *  dst,
npy_intp  dst_stride,
char *  NPY_UNUSEDsrc,
npy_intp   NPY_UNUSEDsrc_stride,
npy_intp  N,
npy_intp   NPY_UNUSEDsrc_itemsize,
NpyAuxData NPY_UNUSEDdata 
) [static]

Release the reference in dst
Set it to zero

References get_fields_transfer_function().

Referenced by get_decsrcref_fields_transfer_function().

static void _null_to_strided_set_bool_one ( char *  dst,
npy_intp  dst_stride,
char *  NPY_UNUSEDsrc,
npy_intp   NPY_UNUSEDsrc_stride,
npy_intp  N,
npy_intp   NPY_UNUSEDsrc_itemsize,
NpyAuxData NPY_UNUSEDdata 
) [static]
******************* DEST BOOL SETONE **************************

bool type is one byte, so can just use the char

References _PyArray_Descr::elsize, and PyArray_GetStridedCopyFn().

NpyAuxData* _one_to_n_data_clone ( NpyAuxData data)
transfer data copy function

Allocate the data, and populate it

void _one_to_n_data_free ( NpyAuxData data)
NpyAuxData* _strided_cast_data_clone ( NpyAuxData data)
strided cast data copy function
void _strided_cast_data_free ( NpyAuxData data)
strided cast data free function

References NPY_FAIL.

NpyAuxData* _strided_datetime_cast_data_clone ( NpyAuxData data)
strided datetime cast data copy function
void _strided_datetime_cast_data_free ( NpyAuxData data)
strided datetime cast data free function

References NPY_DATETIME_NAT, and npy_datetimestruct::year.

void _strided_masked_wrapper_decsrcref_transfer_function ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_mask mask,
npy_intp  mask_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData transferdata 
)

Skip masked values, still calling decsrcref for move_references
Process unmasked values

void _strided_masked_wrapper_transfer_function ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_mask mask,
npy_intp  mask_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData transferdata 
)

Skip masked values
Process unmasked values

static void _strided_to_null_dec_src_ref_reference ( char *  NPY_UNUSEDdst,
npy_intp   NPY_UNUSEDdst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp   NPY_UNUSEDsrc_itemsize,
NpyAuxData NPY_UNUSEDdata 
) [static]

Release the reference in src

static void _strided_to_strided_contig_align_wrap ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]
static void _strided_to_strided_contig_align_wrap_init_dest ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]

References NPY_FAIL.

static void _strided_to_strided_copy_references ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]
Copies references from src to dst

Release the reference in dst
Copy the reference
Claim the reference

References PyArray_malloc.

Referenced by _dst_memset_zero_data_clone().

static void _strided_to_strided_datetime_cast ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]

Apply the scaling

Referenced by _strided_to_strided_datetime_to_string().

static void _strided_to_strided_datetime_general_cast ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]
static void _strided_to_strided_datetime_to_string ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp   NPY_UNUSEDsrc_itemsize,
NpyAuxData data 
) [static]

For an error, produce a 'NaT' string
Initialize the destination to all zeros
This may also raise an error, but the caller needs to use PyErr_Occurred().

References _strided_to_strided_datetime_cast().

static void _strided_to_strided_field_transfer ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp   NPY_UNUSEDsrc_itemsize,
NpyAuxData data 
) [static]
static void _strided_to_strided_move_references ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]
********************* COPY REFERENCES **************************
Moves references from src to dst

Release the reference in dst
Move the reference
Set the source reference to NULL

static void _strided_to_strided_n_to_n ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]
static void _strided_to_strided_one_to_n ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]
static void _strided_to_strided_one_to_n_with_finish ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]
static void _strided_to_strided_string_to_datetime ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]

Replicating strnlen with memchr, because Mac OS X lacks it
If the string is all full, use the buffer
Otherwise parse the data in place
Convert to the datetime

static void _strided_to_strided_subarray_broadcast ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp   NPY_UNUSEDsrc_itemsize,
NpyAuxData data 
) [static]
static void _strided_to_strided_subarray_broadcast_withrefs ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp   NPY_UNUSEDsrc_itemsize,
NpyAuxData data 
) [static]
static void _strided_to_strided_truncate_copy ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]
Does a strided to strided zero-padded copy for the case where dst_itemsize < src_itemsize

Referenced by _strided_to_strided_zero_pad_copy().

static void _strided_to_strided_wrap_copy_swap ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp   NPY_UNUSEDsrc_itemsize,
NpyAuxData data 
) [static]
static void _strided_to_strided_zero_pad_copy ( char *  dst,
npy_intp  dst_stride,
char *  src,
npy_intp  src_stride,
npy_intp  N,
npy_intp  src_itemsize,
NpyAuxData data 
) [static]
NpyAuxData* _strided_zero_pad_data_clone ( NpyAuxData data)
zero-padded data copy function

Referenced by _strided_to_strided_zero_pad_copy().

NpyAuxData* _subarray_broadcast_data_clone ( NpyAuxData data)
transfer data copy function

Allocate the data and populate it

void _subarray_broadcast_data_free ( NpyAuxData data)
transfer data free function
NpyAuxData* _wrap_copy_swap_data_clone ( NpyAuxData data)
wrap copy swap data copy function
void _wrap_copy_swap_data_free ( NpyAuxData data)
wrap copy swap data free function

References PyArray_malloc.

NPY_NO_EXPORT int get_bool_setdstone_transfer_function ( npy_intp  dst_stride,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  NPY_UNUSEDout_needs_api 
)
Returns a transfer function which sets a boolean type to ones.
Returns NPY_SUCCEED or NPY_FAIL.
Only for the bool type, sets the destination to 1
static int get_cast_transfer_function ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
int  move_references,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  out_needs_api 
) [static]

If all native byte order and doesn't need alignment wrapping, return the function
Otherwise, we have to copy and/or swap to aligned temporaries
Get the copy/swap operation from src
Get the copy/swap operation to dst
Wrap it all up in a new transfer function + data

References _strided_to_strided_one_to_n_with_finish().

static int get_datetime_to_unicode_transfer_function ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  out_needs_api 
) [static]

Get an ASCII string data type, adapted to match the UNICODE one
Get the copy/swap operation to dst
Get the NBO datetime to string aligned contig function
Get the cast operation to dst
Wrap it all up in a new transfer function + data

References NPY_AUXDATA_FREE, and NPY_FAIL.

NPY_NO_EXPORT int get_decsrcref_transfer_function ( int  aligned,
npy_intp  src_stride,
PyArray_Descr src_dtype,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  out_needs_api 
) [static]
System Message: ERROR/3 (<string>, line 1) Document or section may not begin with a transition.

System Message: ERROR/3 (<string>, line 1) Document may not end with a transition.
Returns a transfer function which DECREFs any references in src_type.
Returns NPY_SUCCEED or NPY_FAIL.

If there are no references, it's a nop
If it's a single reference, it's one decref
If there are subarrays, need to wrap it
Get a function for contiguous src of the subarray type
If there are fields, need to do each field

Referenced by _strided_to_strided_field_transfer(), and get_fields_transfer_function().

static int get_fields_transfer_function ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
int  move_references,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  out_needs_api 
) [static]
Handles fields transfer. To call this, at least one of the dtypes must have fields

Copy the src value to all the fields of dst
Allocate the data and populate it
If the references should be removed from src, add another transfer function to do that.
Copy the value of the first field to dst
If DECREF is needed on source fields, may need to process all the fields
Allocate the data and populate it
Special case bool type, the existence of fields implies True

TODO: Perhaps a better behavior would be to combine all the
input fields with an OR? The same would apply to subarrays.
If the src field has references, may need to clear them
Transfer the first field to the output
If the references should be removed from src, add more transfer functions to decrement the references for all the other fields.
Match up the fields to copy
Keeps track of the names we already used
If DECREF is needed on source fields, will need to also go through its fields.
Allocate the data and populate it
Use field_count to track additional functions added

References _field_transfer_data_clone(), _field_transfer_data_free(), _strided_to_strided_field_transfer(), _field_transfer_data::base, NpyAuxData_tag::clone, _single_field_transfer::dst_offset, _PyArray_Descr::elsize, _field_transfer_data::field_count, _PyArray_Descr::fields, _field_transfer_data::fields, NpyAuxData_tag::free, get_decsrcref_transfer_function(), _PyArray_Descr::names, NPY_AUXDATA_FREE, NPY_FAIL, NPY_SUCCEED, PyArray_free, PyArray_malloc, PyDataType_REFCHK, _single_field_transfer::src_itemsize, and _single_field_transfer::src_offset.

Referenced by _null_to_strided_reference_setzero().

static int get_n_to_n_transfer_function ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
int  move_references,
npy_intp  N,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  out_needs_api 
) [static]

src_stride and dst_stride are set to contiguous, because subarrays are always contiguous.

References _subarray_broadcast_data::data, _subarray_broadcast_data::data_decsrcref, NPY_AUXDATA_FREE, NPY_FAIL, and PyArray_free.

static int get_nbo_cast_datetime_transfer_function ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata 
) [static]
Assumes src_dtype and dst_dtype are both datetimes or both timedeltas

Allocate the data for the casting
Special case the datetime (but not timedelta) with the nonlinear units (years and months). For timedelta, an average years and months value is used.

static int get_nbo_cast_numeric_transfer_function ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
int  src_type_num,
int  dst_type_num,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata 
) [static]

Emit a warning if complex imaginary is being cast away

static int get_nbo_cast_transfer_function ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
int  move_references,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  out_needs_api,
int *  out_needs_wrap 
) [static]

A parameterized type, datetime->datetime sometimes needs casting
Datetime <-> string conversions can be handled specially. The functions may raise an error if the strings have no space, or can't be parsed properly.
Check the data types whose casting functions use API calls
Get the cast function
Allocate the data for the casting
TODO: This is a hack so the cast functions have an array.
The cast functions shouldn't need that. Also, since we always handle byte order conversions, this array should have native byte order.
TODO: This is a hack so the cast functions have an array.
The cast functions shouldn't need that. Also, since we always handle byte order conversions, this array should have native byte order.
If it's aligned and all native byte order, we're all done
Use the contig version if the strides are contiguous or we're telling the caller to wrap the return, because the wrapping uses a contiguous buffer.

References _PyArray_Descr::elsize, NPY_AUXDATA_FREE, NPY_DATETIME, NPY_FAIL, NPY_NEEDS_INIT, NPY_SUCCEED, NPY_TIMEDELTA, PyArray_GetDTypeCopySwapFn(), PyDataType_FLAGCHK, _PyArray_Descr::type_num, and wrap_aligned_contig_transfer_function().

static int get_nbo_datetime_to_string_transfer_function ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata 
) [static]
static int get_nbo_string_to_datetime_transfer_function ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata 
) [static]
static int get_one_to_n_transfer_function ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
int  move_references,
npy_intp  N,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  out_needs_api 
) [static]

move_references is set to 0, handled in the wrapping transfer fn, src_stride is set to zero, because its 1 to N copying, and dst_stride is set to contiguous, because subarrays are always contiguous.
If the src object will need a DECREF, set src_dtype

static int get_setdestzero_fields_transfer_function ( int  aligned,
npy_intp  dst_stride,
PyArray_Descr dst_dtype,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  out_needs_api 
) [static]

Allocate the data and populate it

NPY_NO_EXPORT int get_setdstzero_transfer_function ( int  aligned,
npy_intp  dst_stride,
PyArray_Descr dst_dtype,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  out_needs_api 
) [static]
Returns a transfer function which zeros out the dest values.
Returns NPY_SUCCEED or NPY_FAIL.

If there are no references, just set the whole thing to zero
If it's exactly one reference, use the decref function
If there are subarrays, need to wrap it
Get a function for contiguous dst of the subarray type
If there are fields, need to do each field

Referenced by get_decsrcref_fields_transfer_function().

static int get_subarray_broadcast_transfer_function ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
npy_intp  src_size,
npy_intp  dst_size,
PyArray_Dims  src_shape,
PyArray_Dims  dst_shape,
int  move_references,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  out_needs_api 
) [static]

Allocate the data and populate it
move_references is set to 0, handled in the wrapping transfer fn, src_stride and dst_stride are set to contiguous, as N will always be 1 when it's called.
If the src object will need a DECREF
If the dst object needs a DECREF to set it to NULL
Calculate the broadcasting and set the offsets
Get the dst coord of this index for dimension i
Translate it into a src coord and update src_index
Out of bounds, flag with -1
Set the offset
Run-length encode the result
Stop the run when there's a valid index again
Stop the run when there's a valid index again
Multiply all the offsets by the src item size

References _field_transfer_data::field_count, _field_transfer_data::fields, NPY_AUXDATA_FREE, and PyArray_free.

static int get_subarray_transfer_function ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
int  move_references,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  out_needs_api 
) [static]
Handles subarray transfer. To call this, at least one of the dtype's subarrays must be non-NULL

Get the subarray shapes and sizes
Just a straight one-element copy.
Copy the src value to all the dst values
If the shapes match exactly, do an n to n copy
Copy the subarray with broadcasting, truncating, and zero-padding as necessary.

References NPY_FAIL, and PyArray_free.

static int get_unicode_to_datetime_transfer_function ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  out_needs_api 
) [static]

Get an ASCII string data type, adapted to match the UNICODE one
Get the cast operation from src
Get the string to NBO datetime aligned contig function
Get the copy/swap operation to dst
Wrap it all up in a new transfer function + data

References NPY_FAIL.

Referenced by get_nbo_string_to_datetime_transfer_function().

NPY_NO_EXPORT int PyArray_CastRawArrays ( npy_intp  count,
char *  src,
char *  dst,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
int  move_references 
)
Casts the specified number of elements from 'src' with data type 'src_dtype' to 'dst' with 'dst_dtype'. See PyArray_GetDTypeTransferFunction for more details.
returns NPY_SUCCEED or NPY_FAIL.

Make sure the copy is reasonable
Check data alignment
Get the function to do the casting
Cast
Cleanup
If needs_api was set to 1, it may have raised a Python exception

NPY_NO_EXPORT int PyArray_GetDTypeCopySwapFn ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr dtype,
PyArray_StridedTransferFn **  outstransfer,
NpyAuxData **  outtransferdata 
)
*************** DTYPE COPY SWAP FUNCTION ******************

If it's a custom data type, wrap its copy swap function
A straight copy
If it's not complex, one swap
If complex, a paired swap

Referenced by get_nbo_cast_transfer_function(), and get_nbo_datetime_to_string_transfer_function().

NPY_NO_EXPORT int PyArray_GetDTypeTransferFunction ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
int  move_references,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  out_needs_api 
)
*************** MAIN DTYPE TRANSFER FUNCTION ******************

If one of the dtypes is NULL, we give back either a src decref function or a dst setzero function
Common special case - number -> number NBO cast
If there are no references and the data types are equivalent, return a simple copy
We can't pass through the aligned flag because it's not appropriate. Consider a size-8 string, it will say it's aligned because strings only need alignment 1, but the copy function wants to know if it's alignment 8.

TODO: Change align from a flag to a "best power of 2 alignment"
which holds the strongest alignment value for all the data which will be used.
First look at the possibilities of just a copy or swap
A custom data type requires that we use its copy/swap
If the sizes and kinds are identical, but they're different custom types, then get a cast function
The special types, which have no byte-order
This is a straight copy
This is a straight copy + byte swap
This is a straight copy + element pair byte swap
Handle subarrays
Handle fields
Check for different-sized strings, unicodes, or voids
Otherwise a cast is necessary

Referenced by _strided_to_strided_one_to_n_with_finish(), and get_nbo_datetime_to_string_transfer_function().

NPY_NO_EXPORT int PyArray_GetMaskedDTypeTransferFunction ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
npy_intp  mask_stride,
PyArray_Descr src_dtype,
PyArray_Descr dst_dtype,
PyArray_Descr mask_dtype,
int  move_references,
PyArray_MaskedStridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata,
int *  out_needs_api 
)
This is identical to PyArray_GetDTypeTransferFunction, but returns a transfer function which also takes a mask as a parameter. Bit zero of the mask is used to determine which values to copy, and data is transfered exactly when NpyMask_IsExposed(mask[i*mask_stride]).
If move_references is true, values which are not copied to the destination will still have their source reference decremented.
If mask_dtype is NPY_BOOL or NPY_UINT8, each full element is either transferred or not according to the mask as described above. If dst_dtype and mask_dtype are both struct dtypes, their names must match exactly, and the dtype of each leaf field in mask_dtype must be either NPY_BOOL or NPY_UINT8.

TODO: Add struct-based mask_dtype support later
TODO: Special case some important cases so they're fast
Fall back to wrapping a non-masked transfer function
Create the wrapper function's auxdata
Fill in the auxdata object
If the src object will need a DECREF, get a function to handle that

NPY_NO_EXPORT int PyArray_GetStridedZeroPadCopyFn ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
npy_intp  src_itemsize,
npy_intp  dst_itemsize,
PyArray_StridedTransferFn **  outstransfer,
NpyAuxData **  outtransferdata 
)
Gives back a transfer function and transfer data pair which copies the data from source to dest, truncating it if the data doesn't fit, and padding with zero bytes if there's too much space.
For information on the 'aligned', 'src_stride' and 'dst_stride' parameters see above.
Returns NPY_SUCCEED or NPY_FAIL
NPY_NO_EXPORT int wrap_aligned_contig_transfer_function ( npy_intp  src_itemsize,
npy_intp  dst_itemsize,
PyArray_StridedTransferFn tobuffer,
NpyAuxData todata,
PyArray_StridedTransferFn frombuffer,
NpyAuxData fromdata,
PyArray_StridedTransferFn wrapped,
NpyAuxData wrappeddata,
int  init_dest,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata 
)
Wraps an aligned contig to contig transfer function between either copies or byte swaps to temporary buffers.
src_itemsize/dst_itemsize - The sizes of the src and dst datatypes. tobuffer - copy/swap function from src to an aligned contiguous buffer. todata - data for tobuffer frombuffer - copy/swap function from an aligned contiguous buffer to dst. fromdata - data for frombuffer wrapped - contig to contig transfer function being wrapped wrappeddata - data for wrapped init_dest - 1 means to memset the dest buffer to 0 before calling wrapped.
Returns NPY_SUCCEED or NPY_FAIL.

Round up the structure size to 16-byte boundary
Add space for two low level buffers
Allocate the data, and populate it
Set the function and data

Referenced by get_nbo_cast_transfer_function(), and get_nbo_datetime_to_string_transfer_function().

static int wrap_copy_swap_function ( int  aligned,
npy_intp  src_stride,
npy_intp  dst_stride,
PyArray_Descr dtype,
int  should_swap,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata 
) [static]
This only gets used for custom data types

Allocate the data for the copy swap
TODO: This is a hack so the copyswap functions have an array.
The copyswap functions shouldn't need that.

References _strided_cast_data::aip, _strided_cast_data::aop, _strided_cast_data::castfunc, and NPY_DT_DBG_REFTRACE.

static int wrap_transfer_function_n_to_n ( PyArray_StridedTransferFn stransfer_inner,
NpyAuxData data_inner,
npy_intp  src_stride,
npy_intp  dst_stride,
npy_intp  src_itemsize,
npy_intp  dst_itemsize,
npy_intp  N,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata 
) [static]
Wraps a transfer function to produce one that copies N contiguous elements of src to N contiguous elements of dst.

If the N subarray elements exactly fit in the strides, then can do a faster contiguous transfer.

References NPY_FAIL, and PyArray_free.

Referenced by _strided_to_strided_one_to_n_with_finish(), and get_decsrcref_fields_transfer_function().

static int wrap_transfer_function_one_to_n ( PyArray_StridedTransferFn stransfer_inner,
NpyAuxData data_inner,
PyArray_StridedTransferFn stransfer_finish_src,
NpyAuxData data_finish_src,
npy_intp  dst_itemsize,
npy_intp  N,
PyArray_StridedTransferFn **  out_stransfer,
NpyAuxData **  out_transferdata 
) [static]
Wraps a transfer function to produce one that copies one element of src to N contiguous elements of dst. If stransfer_finish_src is not NULL, it should be a transfer function which just affects src, for example to do a final DECREF operation for references.