summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2021-02-17 12:19:39 -0600
committerSebastian Berg <sebastian@sipsolutions.net>2021-02-17 12:23:10 -0600
commit4b034a96822d8452e3f4652a1c297bdff7391752 (patch)
tree02f616daa66723603c4ddb05972e1e6ec18e6d4d
parent1eff37ac2eb9dfbd191046a2aa0396747ee4746a (diff)
downloadnumpy-4b034a96822d8452e3f4652a1c297bdff7391752.tar.gz
DOC: Fix comments
As noted by Matti and Ross, these comments were incorrect. Co-authored-by: Matti Picus <matti.picus@gmail.com> Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
-rw-r--r--numpy/core/include/numpy/ndarraytypes.h6
-rw-r--r--numpy/core/src/common/lowlevel_strided_loops.h15
-rw-r--r--numpy/core/src/multiarray/dtype_transfer.c2
-rw-r--r--numpy/core/src/multiarray/dtype_transfer.h2
4 files changed, 11 insertions, 14 deletions
diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h
index 059fb2821..a731e7f15 100644
--- a/numpy/core/include/numpy/ndarraytypes.h
+++ b/numpy/core/include/numpy/ndarraytypes.h
@@ -1921,11 +1921,15 @@ typedef void (PyDataMem_EventHookFunc)(void *inp, void *outp, size_t size,
common_dtype_function *common_dtype;
common_instance_function *common_instance;
/*
+ * The casting implementation (ArrayMethod) to convert between two
+ * instances of this DType, stored explicitly for fast access:
+ */
+ PyObject *within_dtype_castingimpl;
+ /*
* Dictionary of ArrayMethods representing most possible casts
* (structured and object are exceptions).
* This should potentially become a weak mapping in the future.
*/
- PyObject *within_dtype_castingimpl;
PyObject *castingimpls;
};
diff --git a/numpy/core/src/common/lowlevel_strided_loops.h b/numpy/core/src/common/lowlevel_strided_loops.h
index 5dad9e5c5..1255e51dd 100644
--- a/numpy/core/src/common/lowlevel_strided_loops.h
+++ b/numpy/core/src/common/lowlevel_strided_loops.h
@@ -174,17 +174,10 @@ PyArray_GetDTypeCopySwapFn(int aligned,
* If 0, the destination data gets new reference ownership.
* If 1, the references from the source data are moved to
* the destination data.
- * out_stransfer:
- * The resulting transfer function is placed here.
- * out_transferdata:
- * The auxiliary data for the transfer function is placed here.
- * When finished with the transfer function, the caller must call
- * NPY_AUXDATA_FREE on this data.
- * context:
- * A pointer to a PyArrayMethod_Context which is filled in the call.
- * Note that `context->method` may be set to `NULL` e.g. for multi-step
- * casts. The filled result is always valid as input to the returned
- * `out_stransfer` function.
+ * cast_info:
+ * A pointer to an (uninitialized) `NPY_cast_info` struct, the caller
+ * must call `NPY_cast_info_xfree` on it (except on error) and handle
+ * its memory livespan.
* out_needs_api:
* If this is non-NULL, and the transfer function produced needs
* to call into the (Python) API, this gets set to 1. This
diff --git a/numpy/core/src/multiarray/dtype_transfer.c b/numpy/core/src/multiarray/dtype_transfer.c
index f0bb62b89..eceb13fb7 100644
--- a/numpy/core/src/multiarray/dtype_transfer.c
+++ b/numpy/core/src/multiarray/dtype_transfer.c
@@ -2859,7 +2859,7 @@ _multistep_cast_auxdata_clone_int(_multistep_castdata *castdata, int move_info)
newdata->from_buffer = char_data + from_buffer_offset;
newdata->to_buffer = char_data + to_buffer_offset;
- /* Initialize func's to NULL to signal no-cleanup in case of an error. */
+ /* Initialize funcs to NULL to signal no-cleanup in case of an error. */
newdata->from.func = NULL;
newdata->to.func = NULL;
diff --git a/numpy/core/src/multiarray/dtype_transfer.h b/numpy/core/src/multiarray/dtype_transfer.h
index 78b75d12f..e29ac40b8 100644
--- a/numpy/core/src/multiarray/dtype_transfer.h
+++ b/numpy/core/src/multiarray/dtype_transfer.h
@@ -10,7 +10,7 @@
* casts (e.g. structured dtypes).
*
* This struct provides a place to store all necessary information as
- * compact as possible. It must be used with the inlie functions below
+ * compact as possible. It must be used with the inline functions below
* to ensure correct setup and teardown.
*
* In general, the casting machinery currently handles the correct set up