Skip to content

Commit 704fde7

Browse files
committed
Update PyBuffer_FromContiguous definition: rename 'fort' parameter to 'order' to match its declaration. Update function comment to reflect new variable name as well.
1 parent ec4021c commit 704fde7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Include/pybuffer.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,20 @@ PyAPI_FUNC(int) PyBuffer_FromContiguous(const Py_buffer *view, const void *buf,
6767
error (i.e. the object does not have a buffer interface or
6868
it is not working).
6969
70-
If fort is 'F', then if the object is multi-dimensional,
70+
If order is 'F', then if the object is multi-dimensional,
7171
then the data will be copied into the array in
7272
Fortran-style (first dimension varies the fastest). If
73-
fort is 'C', then the data will be copied into the array
74-
in C-style (last dimension varies the fastest). If fort
73+
order is 'C', then the data will be copied into the array
74+
in C-style (last dimension varies the fastest). If order
7575
is 'A', then it does not matter and the copy will be made
7676
in whatever way is more efficient. */
7777
PyAPI_FUNC(int) PyObject_CopyData(PyObject *dest, PyObject *src);
7878

7979
/* Copy the data from the src buffer to the buffer of destination. */
80-
PyAPI_FUNC(int) PyBuffer_IsContiguous(const Py_buffer *view, char fort);
80+
PyAPI_FUNC(int) PyBuffer_IsContiguous(const Py_buffer *view, char order);
8181

8282
/*Fill the strides array with byte-strides of a contiguous
83-
(Fortran-style if fort is 'F' or C-style otherwise)
83+
(Fortran-style if order is 'F' or C-style otherwise)
8484
array of the given shape with the given number of bytes
8585
per element. */
8686
PyAPI_FUNC(void) PyBuffer_FillContiguousStrides(int ndims,

Objects/abstract.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ PyBuffer_SizeFromFormat(const char *format)
616616
}
617617

618618
int
619-
PyBuffer_FromContiguous(const Py_buffer *view, const void *buf, Py_ssize_t len, char fort)
619+
PyBuffer_FromContiguous(const Py_buffer *view, const void *buf, Py_ssize_t len, char order)
620620
{
621621
int k;
622622
void (*addone)(int, Py_ssize_t *, const Py_ssize_t *);
@@ -628,7 +628,7 @@ PyBuffer_FromContiguous(const Py_buffer *view, const void *buf, Py_ssize_t len,
628628
len = view->len;
629629
}
630630

631-
if (PyBuffer_IsContiguous(view, fort)) {
631+
if (PyBuffer_IsContiguous(view, order)) {
632632
/* simplest copy is all that is needed */
633633
memcpy(view->buf, buf, len);
634634
return 0;
@@ -646,7 +646,7 @@ PyBuffer_FromContiguous(const Py_buffer *view, const void *buf, Py_ssize_t len,
646646
indices[k] = 0;
647647
}
648648

649-
if (fort == 'F') {
649+
if (order == 'F') {
650650
addone = _Py_add_one_to_index_F;
651651
}
652652
else {

0 commit comments

Comments
 (0)