Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ce275e3

Browse files
committed
BUG: Fix order: long should be preferred over int for intp/default
(Might have gotten confused in the merge conflict?)
1 parent ec3df00 commit ce275e3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

numpy/_core/include/numpy/npy_common.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,7 @@ typedef size_t npy_uintp;
226226
* functions use different formatting codes that are portably specified
227227
* according to the Python documentation. See issue gh-2388.
228228
*/
229-
#if NPY_SIZEOF_INTP == NPY_SIZEOF_INT
230-
#define NPY_INTP NPY_INT
231-
#define NPY_UINTP NPY_UINT
232-
#define PyIntpArrType_Type PyIntArrType_Type
233-
#define PyUIntpArrType_Type PyUIntArrType_Type
234-
#define NPY_MAX_INTP NPY_MAX_INT
235-
#define NPY_MIN_INTP NPY_MIN_INT
236-
#define NPY_MAX_UINTP NPY_MAX_UINT
237-
#define NPY_INTP_FMT "d"
238-
#elif NPY_SIZEOF_INTP == NPY_SIZEOF_LONG
229+
#if NPY_SIZEOF_INTP == NPY_SIZEOF_LONG
239230
#define NPY_INTP NPY_LONG
240231
#define NPY_UINTP NPY_ULONG
241232
#define PyIntpArrType_Type PyLongArrType_Type
@@ -244,6 +235,15 @@ typedef size_t npy_uintp;
244235
#define NPY_MIN_INTP NPY_MIN_LONG
245236
#define NPY_MAX_UINTP NPY_MAX_ULONG
246237
#define NPY_INTP_FMT "ld"
238+
#elif NPY_SIZEOF_INTP == NPY_SIZEOF_INT
239+
#define NPY_INTP NPY_INT
240+
#define NPY_UINTP NPY_UINT
241+
#define PyIntpArrType_Type PyIntArrType_Type
242+
#define PyUIntpArrType_Type PyUIntArrType_Type
243+
#define NPY_MAX_INTP NPY_MAX_INT
244+
#define NPY_MIN_INTP NPY_MIN_INT
245+
#define NPY_MAX_UINTP NPY_MAX_UINT
246+
#define NPY_INTP_FMT "d"
247247
#elif defined(PY_LONG_LONG) && (NPY_SIZEOF_INTP == NPY_SIZEOF_LONGLONG)
248248
#define NPY_INTP NPY_LONGLONG
249249
#define NPY_UINTP NPY_ULONGLONG

0 commit comments

Comments
 (0)