summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2021-09-04 15:19:18 -0600
committerGitHub <noreply@github.com>2021-09-04 15:19:18 -0600
commit3544fae2859d8ecac378b9ddc8f909c69455a831 (patch)
treedb802a0682e5e1876e00ba2b8f908c0081c37f11
parent410a89ef04a2d3c50dd2dba2ad403c872c3745ac (diff)
parent7653829fa0d409d5850566cda1c031d9fadc1c22 (diff)
downloadnumpy-3544fae2859d8ecac378b9ddc8f909c69455a831.tar.gz
Merge pull request #19824 from charris/cleanup-includes
MAINT: Small cleanups of includes in *.c files.
-rw-r--r--.clang-format2
-rw-r--r--numpy/core/src/common/array_assign.c4
-rw-r--r--numpy/core/src/common/cblasfuncs.c4
-rw-r--r--numpy/core/src/common/mem_overlap.c3
-rw-r--r--numpy/core/src/common/npy_argparse.c6
-rw-r--r--numpy/core/src/common/npy_longdouble.c6
-rw-r--r--numpy/core/src/common/numpyos.c17
-rw-r--r--numpy/core/src/common/ucsnarrow.c5
-rw-r--r--numpy/core/src/dummymodule.c6
-rw-r--r--numpy/core/src/multiarray/abstractdtypes.c6
-rw-r--r--numpy/core/src/multiarray/alloc.c12
-rw-r--r--numpy/core/src/multiarray/array_assign_array.c6
-rw-r--r--numpy/core/src/multiarray/array_assign_scalar.c4
-rw-r--r--numpy/core/src/multiarray/array_coercion.c8
-rw-r--r--numpy/core/src/multiarray/array_method.c3
-rw-r--r--numpy/core/src/multiarray/arrayobject.c6
-rw-r--r--numpy/core/src/multiarray/buffer.c5
-rw-r--r--numpy/core/src/multiarray/calculation.c5
-rw-r--r--numpy/core/src/multiarray/common.c5
-rw-r--r--numpy/core/src/multiarray/common_dtype.c7
-rw-r--r--numpy/core/src/multiarray/compiled_base.c6
-rw-r--r--numpy/core/src/multiarray/conversion_utils.c5
-rw-r--r--numpy/core/src/multiarray/convert.c5
-rw-r--r--numpy/core/src/multiarray/convert_datatype.c5
-rw-r--r--numpy/core/src/multiarray/ctors.c5
-rw-r--r--numpy/core/src/multiarray/datetime.c15
-rw-r--r--numpy/core/src/multiarray/datetime_busday.c4
-rw-r--r--numpy/core/src/multiarray/datetime_busdaycal.c8
-rw-r--r--numpy/core/src/multiarray/datetime_strings.c9
-rw-r--r--numpy/core/src/multiarray/descriptor.c4
-rw-r--r--numpy/core/src/multiarray/dtype_transfer.c8
-rw-r--r--numpy/core/src/multiarray/dtypemeta.c6
-rw-r--r--numpy/core/src/multiarray/flagsobject.c4
-rw-r--r--numpy/core/src/multiarray/getset.c4
-rw-r--r--numpy/core/src/multiarray/hashdescr.c6
-rw-r--r--numpy/core/src/multiarray/item_selection.c6
-rw-r--r--numpy/core/src/multiarray/iterators.c5
-rw-r--r--numpy/core/src/multiarray/legacy_dtype_implementation.c2
-rw-r--r--numpy/core/src/multiarray/mapping.c6
-rw-r--r--numpy/core/src/multiarray/methods.c10
-rw-r--r--numpy/core/src/multiarray/multiarraymodule.c8
-rw-r--r--numpy/core/src/multiarray/nditer_api.c3
-rw-r--r--numpy/core/src/multiarray/nditer_constr.c4
-rw-r--r--numpy/core/src/multiarray/nditer_pywrap.c7
-rw-r--r--numpy/core/src/multiarray/number.c6
-rw-r--r--numpy/core/src/multiarray/refcount.c4
-rw-r--r--numpy/core/src/multiarray/scalarapi.c5
-rw-r--r--numpy/core/src/multiarray/sequence.c5
-rw-r--r--numpy/core/src/multiarray/shape.c5
-rw-r--r--numpy/core/src/multiarray/strfuncs.c6
-rw-r--r--numpy/core/src/multiarray/temp_elide.c5
-rw-r--r--numpy/core/src/multiarray/typeinfo.c7
-rw-r--r--numpy/core/src/multiarray/usertypes.c6
-rw-r--r--numpy/core/src/multiarray/vdot.c6
-rw-r--r--numpy/core/src/npymath/halffloat.c1
-rw-r--r--numpy/core/src/umath/_scaled_float_dtype.c6
-rw-r--r--numpy/core/src/umath/dispatching.c8
-rw-r--r--numpy/core/src/umath/extobj.c8
-rw-r--r--numpy/core/src/umath/legacy_array_method.c7
-rw-r--r--numpy/core/src/umath/reduction.c6
-rw-r--r--numpy/core/src/umath/ufunc_object.c8
-rw-r--r--numpy/core/src/umath/ufunc_type_resolution.c12
-rw-r--r--numpy/core/src/umath/umathmodule.c19
-rw-r--r--numpy/fft/_pocketfft.c3
-rw-r--r--numpy/linalg/lapack_litemodule.c4
65 files changed, 204 insertions, 198 deletions
diff --git a/.clang-format b/.clang-format
index 99b9aabe1..c78fb5f77 100644
--- a/.clang-format
+++ b/.clang-format
@@ -16,7 +16,7 @@ DerivePointerAlignment: false
IndentWidth: 4
IncludeBlocks: Regroup
IncludeCategories:
- - Regex: '^[<"](Python|structmember)'
+ - Regex: '^[<"](Python|structmember|pymem)'
Priority: -3
CaseSensitive: true
- Regex: '^"numpy/'
diff --git a/numpy/core/src/common/array_assign.c b/numpy/core/src/common/array_assign.c
index c55f6bdb4..b7495fc09 100644
--- a/numpy/core/src/common/array_assign.c
+++ b/numpy/core/src/common/array_assign.c
@@ -7,12 +7,12 @@
*
* See LICENSE.txt for the license.
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include <numpy/ndarraytypes.h>
#include "npy_config.h"
#include "npy_pycompat.h"
diff --git a/numpy/core/src/common/cblasfuncs.c b/numpy/core/src/common/cblasfuncs.c
index 630f0175e..714636782 100644
--- a/numpy/core/src/common/cblasfuncs.c
+++ b/numpy/core/src/common/cblasfuncs.c
@@ -2,12 +2,12 @@
* This module provides a BLAS optimized matrix multiply,
* inner product and dot for numpy arrays
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "npy_cblas.h"
#include "arraytypes.h"
diff --git a/numpy/core/src/common/mem_overlap.c b/numpy/core/src/common/mem_overlap.c
index 0f0a75c72..2632e1413 100644
--- a/numpy/core/src/common/mem_overlap.c
+++ b/numpy/core/src/common/mem_overlap.c
@@ -181,10 +181,11 @@
All rights reserved.
Licensed under 3-clause BSD license, see LICENSE.txt.
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#include "numpy/ndarraytypes.h"
#include "mem_overlap.h"
#include "npy_extint128.h"
diff --git a/numpy/core/src/common/npy_argparse.c b/numpy/core/src/common/npy_argparse.c
index a90ff47d7..76123c1ed 100644
--- a/numpy/core/src/common/npy_argparse.c
+++ b/numpy/core/src/common/npy_argparse.c
@@ -1,9 +1,9 @@
-#define PY_SSIZE_T_CLEAN
-#include <Python.h>
-
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#include "numpy/ndarraytypes.h"
#include "npy_argparse.h"
#include "npy_pycompat.h"
diff --git a/numpy/core/src/common/npy_longdouble.c b/numpy/core/src/common/npy_longdouble.c
index db9cd4a67..38dfd325c 100644
--- a/numpy/core/src/common/npy_longdouble.c
+++ b/numpy/core/src/common/npy_longdouble.c
@@ -1,9 +1,9 @@
-#define PY_SSIZE_T_CLEAN
-#include <Python.h>
-
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#include "numpy/ndarraytypes.h"
#include "numpy/npy_math.h"
#include "npy_pycompat.h"
diff --git a/numpy/core/src/common/numpyos.c b/numpy/core/src/common/numpyos.c
index 42a71777b..4551a06a2 100644
--- a/numpy/core/src/common/numpyos.c
+++ b/numpy/core/src/common/numpyos.c
@@ -1,11 +1,9 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include <locale.h>
-#include <stdio.h>
-
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/npy_math.h"
@@ -13,14 +11,13 @@
#include "npy_pycompat.h"
+#include <locale.h>
+#include <stdio.h>
+
#ifdef HAVE_STRTOLD_L
#include <stdlib.h>
#ifdef HAVE_XLOCALE_H
- /*
- * the defines from xlocale.h are included in locale.h on some systems;
- * see gh-8367
- */
- #include <xlocale.h>
+#include <xlocale.h> // xlocale was removed in glibc 2.26, see gh-8367
#endif
#endif
diff --git a/numpy/core/src/common/ucsnarrow.c b/numpy/core/src/common/ucsnarrow.c
index 3ef5d6878..4bea4beee 100644
--- a/numpy/core/src/common/ucsnarrow.c
+++ b/numpy/core/src/common/ucsnarrow.c
@@ -1,12 +1,9 @@
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include <locale.h>
-#include <stdio.h>
-
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/npy_math.h"
diff --git a/numpy/core/src/dummymodule.c b/numpy/core/src/dummymodule.c
index a58b48839..7284ffd68 100644
--- a/numpy/core/src/dummymodule.c
+++ b/numpy/core/src/dummymodule.c
@@ -4,12 +4,12 @@
* This is a dummy module whose purpose is to get distutils to generate the
* configuration files before the libraries are made.
*/
-#define PY_SSIZE_T_CLEAN
-#include <Python.h>
-
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define NO_IMPORT_ARRAY
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#include "npy_pycompat.h"
static struct PyMethodDef methods[] = {
diff --git a/numpy/core/src/multiarray/abstractdtypes.c b/numpy/core/src/multiarray/abstractdtypes.c
index 48715fbd5..99573f089 100644
--- a/numpy/core/src/multiarray/abstractdtypes.c
+++ b/numpy/core/src/multiarray/abstractdtypes.c
@@ -1,10 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/ndarraytypes.h"
#include "numpy/arrayobject.h"
diff --git a/numpy/core/src/multiarray/alloc.c b/numpy/core/src/multiarray/alloc.c
index 1afcee602..adb4ae128 100644
--- a/numpy/core/src/multiarray/alloc.c
+++ b/numpy/core/src/multiarray/alloc.c
@@ -1,20 +1,18 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-
#include <pymem.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
-#include <numpy/ndarraytypes.h>
+#include "numpy/ndarraytypes.h"
#include "numpy/arrayobject.h"
-#include <numpy/npy_common.h>
+#include "numpy/npy_common.h"
#include "npy_config.h"
#include "alloc.h"
-
#include <assert.h>
-
#ifdef NPY_OS_LINUX
#include <sys/mman.h>
#ifndef MADV_HUGEPAGE
diff --git a/numpy/core/src/multiarray/array_assign_array.c b/numpy/core/src/multiarray/array_assign_array.c
index 665dadfbf..020a7f29a 100644
--- a/numpy/core/src/multiarray/array_assign_array.c
+++ b/numpy/core/src/multiarray/array_assign_array.c
@@ -6,13 +6,13 @@
*
* See LICENSE.txt for the license.
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
-#include <numpy/ndarraytypes.h>
+#include "numpy/ndarraytypes.h"
#include "npy_config.h"
#include "npy_pycompat.h"
diff --git a/numpy/core/src/multiarray/array_assign_scalar.c b/numpy/core/src/multiarray/array_assign_scalar.c
index 6cd5f4ad9..4ffef7ecc 100644
--- a/numpy/core/src/multiarray/array_assign_scalar.c
+++ b/numpy/core/src/multiarray/array_assign_scalar.c
@@ -6,12 +6,12 @@
*
* See LICENSE.txt for the license.
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include <numpy/ndarraytypes.h>
#include "npy_config.h"
diff --git a/numpy/core/src/multiarray/array_coercion.c b/numpy/core/src/multiarray/array_coercion.c
index 172b88c72..90b50097a 100644
--- a/numpy/core/src/multiarray/array_coercion.c
+++ b/numpy/core/src/multiarray/array_coercion.c
@@ -1,9 +1,9 @@
-#define PY_SSIZE_T_CLEAN
-#include <Python.h>
-
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _UMATHMODULE
#define _MULTIARRAYMODULE
+#define _UMATHMODULE
+
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
#include "numpy/npy_3kcompat.h"
diff --git a/numpy/core/src/multiarray/array_method.c b/numpy/core/src/multiarray/array_method.c
index 44ba8c733..816c9e271 100644
--- a/numpy/core/src/multiarray/array_method.c
+++ b/numpy/core/src/multiarray/array_method.c
@@ -26,10 +26,9 @@
* It is then sufficient for a ufunc (or other owner) to only hold a
* weak reference to the input DTypes.
*/
-
-
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
+
#include <npy_pycompat.h>
#include "arrayobject.h"
#include "array_method.h"
diff --git a/numpy/core/src/multiarray/arrayobject.c b/numpy/core/src/multiarray/arrayobject.c
index b27f511bd..d653bfc22 100644
--- a/numpy/core/src/multiarray/arrayobject.c
+++ b/numpy/core/src/multiarray/arrayobject.c
@@ -20,13 +20,13 @@ maintainer email: oliphant.travis@ieee.org
Space Science Telescope Institute
(J. Todd Miller, Perry Greenfield, Rick White)
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-/*#include <stdio.h>*/
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/buffer.c b/numpy/core/src/multiarray/buffer.c
index a3d5090b0..d10122c4f 100644
--- a/numpy/core/src/multiarray/buffer.c
+++ b/numpy/core/src/multiarray/buffer.c
@@ -1,9 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/calculation.c b/numpy/core/src/multiarray/calculation.c
index 587c05ccc..327f685d4 100644
--- a/numpy/core/src/multiarray/calculation.c
+++ b/numpy/core/src/multiarray/calculation.c
@@ -1,9 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "lowlevel_strided_loops.h"
diff --git a/numpy/core/src/multiarray/common.c b/numpy/core/src/multiarray/common.c
index 1fd9ab1a3..82d34193d 100644
--- a/numpy/core/src/multiarray/common.c
+++ b/numpy/core/src/multiarray/common.c
@@ -1,8 +1,9 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "npy_config.h"
diff --git a/numpy/core/src/multiarray/common_dtype.c b/numpy/core/src/multiarray/common_dtype.c
index 659580c98..ca80b1ed7 100644
--- a/numpy/core/src/multiarray/common_dtype.c
+++ b/numpy/core/src/multiarray/common_dtype.c
@@ -1,9 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
-#include <numpy/npy_common.h>
+#include "numpy/npy_common.h"
#include "numpy/arrayobject.h"
#include "common_dtype.h"
diff --git a/numpy/core/src/multiarray/compiled_base.c b/numpy/core/src/multiarray/compiled_base.c
index 186cd7b61..efe120b80 100644
--- a/numpy/core/src/multiarray/compiled_base.c
+++ b/numpy/core/src/multiarray/compiled_base.c
@@ -1,10 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/npy_3kcompat.h"
#include "numpy/npy_math.h"
diff --git a/numpy/core/src/multiarray/conversion_utils.c b/numpy/core/src/multiarray/conversion_utils.c
index 81f73c892..6de764fb1 100644
--- a/numpy/core/src/multiarray/conversion_utils.c
+++ b/numpy/core/src/multiarray/conversion_utils.c
@@ -1,9 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/convert.c b/numpy/core/src/multiarray/convert.c
index cc2c21de1..2f68db07c 100644
--- a/numpy/core/src/multiarray/convert.c
+++ b/numpy/core/src/multiarray/convert.c
@@ -1,11 +1,12 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
#include "npy_config.h"
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "npy_pycompat.h"
diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c
index da52d1371..b6755e91d 100644
--- a/numpy/core/src/multiarray/convert_datatype.c
+++ b/numpy/core/src/multiarray/convert_datatype.c
@@ -1,9 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c
index 2633d0283..73d864a4d 100644
--- a/numpy/core/src/multiarray/ctors.c
+++ b/numpy/core/src/multiarray/ctors.c
@@ -1,9 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/datetime.c b/numpy/core/src/multiarray/datetime.c
index 182eb12f9..093090b4c 100644
--- a/numpy/core/src/multiarray/datetime.c
+++ b/numpy/core/src/multiarray/datetime.c
@@ -6,16 +6,13 @@
*
* See LICENSE.txt for the license.
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include <datetime.h>
-#include <time.h>
-
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
-#include <numpy/arrayobject.h>
+#include "numpy/arrayobject.h"
#include "npy_config.h"
#include "npy_pycompat.h"
@@ -30,7 +27,11 @@
#include "usertypes.h"
#include "dtype_transfer.h"
-#include <lowlevel_strided_loops.h>
+#include "lowlevel_strided_loops.h"
+
+#include <datetime.h>
+#include <time.h>
+
/*
* Computes the python `ret, d = divmod(d, unit)`.
diff --git a/numpy/core/src/multiarray/datetime_busday.c b/numpy/core/src/multiarray/datetime_busday.c
index f0564146d..d3e9e1451 100644
--- a/numpy/core/src/multiarray/datetime_busday.c
+++ b/numpy/core/src/multiarray/datetime_busday.c
@@ -6,12 +6,12 @@
*
* See LICENSE.txt for the license.
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include <numpy/arrayobject.h>
#include "npy_config.h"
diff --git a/numpy/core/src/multiarray/datetime_busdaycal.c b/numpy/core/src/multiarray/datetime_busdaycal.c
index e3e729d3c..880efe934 100644
--- a/numpy/core/src/multiarray/datetime_busdaycal.c
+++ b/numpy/core/src/multiarray/datetime_busdaycal.c
@@ -7,19 +7,19 @@
*
* See LICENSE.txt for the license.
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
-#include <numpy/arrayobject.h>
+#include "numpy/arrayobject.h"
+#include "numpy/arrayscalars.h"
#include "npy_config.h"
#include "npy_pycompat.h"
#include "common.h"
-#include "numpy/arrayscalars.h"
#include "lowlevel_strided_loops.h"
#include "_datetime.h"
#include "datetime_busday.h"
diff --git a/numpy/core/src/multiarray/datetime_strings.c b/numpy/core/src/multiarray/datetime_strings.c
index 360868568..5080647cb 100644
--- a/numpy/core/src/multiarray/datetime_strings.c
+++ b/numpy/core/src/multiarray/datetime_strings.c
@@ -6,15 +6,14 @@
*
* See LICENSE.txt for the license.
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include <time.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
-#include <numpy/arrayobject.h>
+#include "numpy/arrayobject.h"
#include "npy_config.h"
#include "npy_pycompat.h"
@@ -24,6 +23,8 @@
#include "_datetime.h"
#include "datetime_strings.h"
+#include <time.h>
+
/*
* Platform-specific time_t typedef. Some platforms use 32 bit, some use 64 bit
* and we just use the default with the exception of mingw, where we must use
diff --git a/numpy/core/src/multiarray/descriptor.c b/numpy/core/src/multiarray/descriptor.c
index 7b4e28f1d..397768f19 100644
--- a/numpy/core/src/multiarray/descriptor.c
+++ b/numpy/core/src/multiarray/descriptor.c
@@ -1,11 +1,11 @@
/* Array Descr Object */
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/dtype_transfer.c b/numpy/core/src/multiarray/dtype_transfer.c
index 169025a63..8fb44c4f6 100644
--- a/numpy/core/src/multiarray/dtype_transfer.c
+++ b/numpy/core/src/multiarray/dtype_transfer.c
@@ -7,16 +7,16 @@
* The University of British Columbia
*
* See LICENSE.txt for the license.
-
+ *
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
-#include <numpy/arrayobject.h>
+#include "numpy/arrayobject.h"
#include "lowlevel_strided_loops.h"
#include "npy_pycompat.h"
diff --git a/numpy/core/src/multiarray/dtypemeta.c b/numpy/core/src/multiarray/dtypemeta.c
index a8e845c34..059ec201e 100644
--- a/numpy/core/src/multiarray/dtypemeta.c
+++ b/numpy/core/src/multiarray/dtypemeta.c
@@ -1,12 +1,11 @@
/* Array Descr Object */
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#include "assert.h"
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include <numpy/ndarraytypes.h>
#include <numpy/arrayscalars.h>
#include "npy_pycompat.h"
@@ -19,6 +18,7 @@
#include "convert_datatype.h"
#include "usertypes.h"
+#include <assert.h>
static void
dtypemeta_dealloc(PyArray_DTypeMeta *self) {
diff --git a/numpy/core/src/multiarray/flagsobject.c b/numpy/core/src/multiarray/flagsobject.c
index c5dffd8a5..3b1b4f406 100644
--- a/numpy/core/src/multiarray/flagsobject.c
+++ b/numpy/core/src/multiarray/flagsobject.c
@@ -1,11 +1,11 @@
/* Array Flags Object */
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/getset.c b/numpy/core/src/multiarray/getset.c
index 0a13fc367..2c8d1b3b4 100644
--- a/numpy/core/src/multiarray/getset.c
+++ b/numpy/core/src/multiarray/getset.c
@@ -1,11 +1,11 @@
/* Array Descr Object */
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "npy_config.h"
diff --git a/numpy/core/src/multiarray/hashdescr.c b/numpy/core/src/multiarray/hashdescr.c
index e9a99cc8f..a3c9e986b 100644
--- a/numpy/core/src/multiarray/hashdescr.c
+++ b/numpy/core/src/multiarray/hashdescr.c
@@ -1,7 +1,9 @@
-#define PY_SSIZE_T_CLEAN
-#include <Python.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
+
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#include <numpy/arrayobject.h>
#include "npy_config.h"
diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c
index 7ceb8b368..ad5478bbf 100644
--- a/numpy/core/src/multiarray/item_selection.c
+++ b/numpy/core/src/multiarray/item_selection.c
@@ -1,10 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
-
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/iterators.c b/numpy/core/src/multiarray/iterators.c
index c8e790e46..36bfaa7cf 100644
--- a/numpy/core/src/multiarray/iterators.c
+++ b/numpy/core/src/multiarray/iterators.c
@@ -1,9 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/legacy_dtype_implementation.c b/numpy/core/src/multiarray/legacy_dtype_implementation.c
index 9b4946da3..72a52d7a8 100644
--- a/numpy/core/src/multiarray/legacy_dtype_implementation.c
+++ b/numpy/core/src/multiarray/legacy_dtype_implementation.c
@@ -6,9 +6,9 @@
* until such a time where legay user dtypes are deprecated and removed
* entirely.
*/
-
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
+
#include "numpy/arrayobject.h"
#include "scalartypes.h"
#include "_datetime.h"
diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c
index 5f6befe17..014a863d5 100644
--- a/numpy/core/src/multiarray/mapping.c
+++ b/numpy/core/src/multiarray/mapping.c
@@ -1,10 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-/*#include <stdio.h>*/
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "arrayobject.h"
diff --git a/numpy/core/src/multiarray/methods.c b/numpy/core/src/multiarray/methods.c
index 530f943fc..2c10817fa 100644
--- a/numpy/core/src/multiarray/methods.c
+++ b/numpy/core/src/multiarray/methods.c
@@ -1,14 +1,14 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
-#include <stdarg.h>
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
-#include "arrayobject.h"
#include "numpy/arrayscalars.h"
+#include "arrayobject.h"
#include "arrayfunction_override.h"
#include "npy_argparse.h"
#include "npy_config.h"
@@ -30,6 +30,8 @@
#include "methods.h"
#include "alloc.h"
+#include <stdarg.h>
+
/* NpyArg_ParseKeywords
*
diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c
index bbfd7e4f4..3b70424a5 100644
--- a/numpy/core/src/multiarray/multiarraymodule.c
+++ b/numpy/core/src/multiarray/multiarraymodule.c
@@ -11,16 +11,14 @@
oliphant@ee.byu.edu
Brigham Young University
*/
-
-/* $Id: multiarraymodule.c,v 1.36 2005/09/14 00:14:00 teoliphant Exp $ */
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _UMATHMODULE
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _UMATHMODULE
-#define _MULTIARRAYMODULE
#include <numpy/npy_common.h>
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/nditer_api.c b/numpy/core/src/multiarray/nditer_api.c
index a1ca5bff5..811eece7d 100644
--- a/numpy/core/src/multiarray/nditer_api.c
+++ b/numpy/core/src/multiarray/nditer_api.c
@@ -11,8 +11,9 @@
*/
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-/* Indicate that this .c file is allowed to include the header */
+/* Allow this .c file to include nditer_impl.h */
#define NPY_ITERATOR_IMPLEMENTATION_CODE
+
#include "nditer_impl.h"
#include "templ_common.h"
#include "ctors.h"
diff --git a/numpy/core/src/multiarray/nditer_constr.c b/numpy/core/src/multiarray/nditer_constr.c
index 98d4f5a75..57dbb3a94 100644
--- a/numpy/core/src/multiarray/nditer_constr.c
+++ b/numpy/core/src/multiarray/nditer_constr.c
@@ -11,10 +11,10 @@
*/
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-/* Indicate that this .c file is allowed to include the header */
+/* Allow this .c file to include nditer_impl.h */
#define NPY_ITERATOR_IMPLEMENTATION_CODE
-#include "nditer_impl.h"
+#include "nditer_impl.h"
#include "arrayobject.h"
#include "array_coercion.h"
#include "templ_common.h"
diff --git a/numpy/core/src/multiarray/nditer_pywrap.c b/numpy/core/src/multiarray/nditer_pywrap.c
index efa13ae09..8e072d5f4 100644
--- a/numpy/core/src/multiarray/nditer_pywrap.c
+++ b/numpy/core/src/multiarray/nditer_pywrap.c
@@ -6,13 +6,14 @@
*
* See LICENSE.txt for the license.
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
-#include <numpy/arrayobject.h>
+#include "numpy/arrayobject.h"
#include "npy_config.h"
#include "npy_pycompat.h"
#include "alloc.h"
diff --git a/numpy/core/src/multiarray/number.c b/numpy/core/src/multiarray/number.c
index 45566c0fb..292ef55a6 100644
--- a/numpy/core/src/multiarray/number.c
+++ b/numpy/core/src/multiarray/number.c
@@ -1,10 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-/*#include <stdio.h>*/
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "npy_config.h"
diff --git a/numpy/core/src/multiarray/refcount.c b/numpy/core/src/multiarray/refcount.c
index 1d693369e..a1c310700 100644
--- a/numpy/core/src/multiarray/refcount.c
+++ b/numpy/core/src/multiarray/refcount.c
@@ -2,13 +2,13 @@
* This module corresponds to the `Special functions for NPY_OBJECT`
* section in the numpy reference for C-API.
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "iterators.h"
diff --git a/numpy/core/src/multiarray/scalarapi.c b/numpy/core/src/multiarray/scalarapi.c
index 22780c8b4..e409e9874 100644
--- a/numpy/core/src/multiarray/scalarapi.c
+++ b/numpy/core/src/multiarray/scalarapi.c
@@ -1,9 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/sequence.c b/numpy/core/src/multiarray/sequence.c
index 3cd3bf216..8db0690a1 100644
--- a/numpy/core/src/multiarray/sequence.c
+++ b/numpy/core/src/multiarray/sequence.c
@@ -1,9 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/shape.c b/numpy/core/src/multiarray/shape.c
index 222906737..5a4e8c0f3 100644
--- a/numpy/core/src/multiarray/shape.c
+++ b/numpy/core/src/multiarray/shape.c
@@ -1,9 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/strfuncs.c b/numpy/core/src/multiarray/strfuncs.c
index 2fe1c8529..ba457f4f4 100644
--- a/numpy/core/src/multiarray/strfuncs.c
+++ b/numpy/core/src/multiarray/strfuncs.c
@@ -1,9 +1,9 @@
-#define PY_SSIZE_T_CLEAN
-#include <Python.h>
-
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#include "numpy/arrayobject.h"
#include "npy_pycompat.h"
#include "npy_import.h"
diff --git a/numpy/core/src/multiarray/temp_elide.c b/numpy/core/src/multiarray/temp_elide.c
index 2b4621744..f615aa336 100644
--- a/numpy/core/src/multiarray/temp_elide.c
+++ b/numpy/core/src/multiarray/temp_elide.c
@@ -1,8 +1,9 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "npy_config.h"
#include "numpy/arrayobject.h"
diff --git a/numpy/core/src/multiarray/typeinfo.c b/numpy/core/src/multiarray/typeinfo.c
index b0563b3c0..8cf6bc1e0 100644
--- a/numpy/core/src/multiarray/typeinfo.c
+++ b/numpy/core/src/multiarray/typeinfo.c
@@ -3,6 +3,10 @@
* Unfortunately, we need two different types to cover the cases where min/max
* do and do not appear in the tuple.
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
+#include "npy_pycompat.h"
#include "typeinfo.h"
#if (defined(PYPY_VERSION_NUM) && (PYPY_VERSION_NUM <= 0x07030000))
@@ -10,9 +14,6 @@
#include <structseq.h>
#endif
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
-#include "npy_pycompat.h"
static PyTypeObject PyArray_typeinfoType;
diff --git a/numpy/core/src/multiarray/usertypes.c b/numpy/core/src/multiarray/usertypes.c
index be059cc45..d0cf53576 100644
--- a/numpy/core/src/multiarray/usertypes.c
+++ b/numpy/core/src/multiarray/usertypes.c
@@ -20,13 +20,13 @@ maintainer email: oliphant.travis@ieee.org
Space Science Telescope Institute
(J. Todd Miller, Perry Greenfield, Rick White)
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-/*#include <stdio.h>*/
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/vdot.c b/numpy/core/src/multiarray/vdot.c
index 8c4625dcb..ff08ed2d4 100644
--- a/numpy/core/src/multiarray/vdot.c
+++ b/numpy/core/src/multiarray/vdot.c
@@ -1,9 +1,9 @@
-#define PY_SSIZE_T_CLEAN
-#include <Python.h>
-
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#include "common.h"
#include "vdot.h"
#include "npy_cblas.h"
diff --git a/numpy/core/src/npymath/halffloat.c b/numpy/core/src/npymath/halffloat.c
index cbaa11e43..51948c736 100644
--- a/numpy/core/src/npymath/halffloat.c
+++ b/numpy/core/src/npymath/halffloat.c
@@ -1,4 +1,5 @@
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+
#include "numpy/halffloat.h"
/*
diff --git a/numpy/core/src/umath/_scaled_float_dtype.c b/numpy/core/src/umath/_scaled_float_dtype.c
index cbea378f0..866f636a0 100644
--- a/numpy/core/src/umath/_scaled_float_dtype.c
+++ b/numpy/core/src/umath/_scaled_float_dtype.c
@@ -11,10 +11,10 @@
* NOTE: The tests were initially written using private API and ABI, ideally
* they should be replaced/modified with versions using public API.
*/
-
-#define _UMATHMODULE
-#define _MULTIARRAYMODULE
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+#define _UMATHMODULE
+
#include "numpy/ndarrayobject.h"
#include "numpy/ufuncobject.h"
diff --git a/numpy/core/src/umath/dispatching.c b/numpy/core/src/umath/dispatching.c
index 24faa49f3..40de28754 100644
--- a/numpy/core/src/umath/dispatching.c
+++ b/numpy/core/src/umath/dispatching.c
@@ -34,13 +34,13 @@
* into the `signature` so that it is available to the ufunc loop.
*
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+#define _UMATHMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define _UMATHMODULE
-#define _MULTIARRAYMODULE
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-
#include "numpy/ndarraytypes.h"
#include "common.h"
diff --git a/numpy/core/src/umath/extobj.c b/numpy/core/src/umath/extobj.c
index 65dd28890..6b9a27e26 100644
--- a/numpy/core/src/umath/extobj.c
+++ b/numpy/core/src/umath/extobj.c
@@ -1,10 +1,10 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+#define _UMATHMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define _UMATHMODULE
-#define _MULTIARRAYMODULE
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-
#include "npy_config.h"
#include "npy_pycompat.h"
diff --git a/numpy/core/src/umath/legacy_array_method.c b/numpy/core/src/umath/legacy_array_method.c
index ed2d2a2f6..77b1b9013 100644
--- a/numpy/core/src/umath/legacy_array_method.c
+++ b/numpy/core/src/umath/legacy_array_method.c
@@ -2,12 +2,13 @@
* This file defines most of the machinery in order to wrap legacy style
* ufunc loops into new style arraymethods.
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+#define _UMATHMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define _UMATHMODULE
-#define _MULTIARRAYMODULE
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#include "numpy/ndarraytypes.h"
#include "convert_datatype.h"
diff --git a/numpy/core/src/umath/reduction.c b/numpy/core/src/umath/reduction.c
index 86cc20eb1..d5a251368 100644
--- a/numpy/core/src/umath/reduction.c
+++ b/numpy/core/src/umath/reduction.c
@@ -6,15 +6,15 @@
*
* See LICENSE.txt for the license.
*/
-#define _UMATHMODULE
-#define _MULTIARRAYMODULE
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+#define _UMATHMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "npy_config.h"
-#include <numpy/arrayobject.h>
+#include "numpy/arrayobject.h"
#include "npy_pycompat.h"
#include "ctors.h"
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 081d7437a..7abcb9513 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -23,13 +23,13 @@
* Rick White
*
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+#define _UMATHMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define _UMATHMODULE
-#define _MULTIARRAYMODULE
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-
#include <stddef.h>
#include "npy_config.h"
diff --git a/numpy/core/src/umath/ufunc_type_resolution.c b/numpy/core/src/umath/ufunc_type_resolution.c
index ef4486523..7e24bc493 100644
--- a/numpy/core/src/umath/ufunc_type_resolution.c
+++ b/numpy/core/src/umath/ufunc_type_resolution.c
@@ -20,20 +20,18 @@
*
* See LICENSE.txt for the license.
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+#define _UMATHMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define _UMATHMODULE
-#define _MULTIARRAYMODULE
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-
// printif debug tracing
#ifndef NPY_UF_DBG_TRACING
#define NPY_UF_DBG_TRACING 0
#endif
-#include <stdbool.h>
-
#include "npy_config.h"
#include "npy_pycompat.h"
#include "npy_import.h"
@@ -49,6 +47,8 @@
#include "cblasfuncs.h"
#endif
+#include <stdbool.h>
+
static PyObject *
npy_casting_to_py_object(NPY_CASTING casting)
{
diff --git a/numpy/core/src/umath/umathmodule.c b/numpy/core/src/umath/umathmodule.c
index 7ba5b5d6d..a9954dfc1 100644
--- a/numpy/core/src/umath/umathmodule.c
+++ b/numpy/core/src/umath/umathmodule.c
@@ -1,27 +1,18 @@
/* -*- c -*- */
-
-/*
- * vim:syntax=c
- */
-
-/*
- *****************************************************************************
- ** INCLUDES **
- *****************************************************************************
- */
+/* vim:syntax=c */
/*
* _UMATHMODULE IS needed in __ufunc_api.h, included from numpy/ufuncobject.h.
* This is a mess and it would be nice to fix it. It has nothing to do with
* __ufunc_api.c
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+#define _UMATHMODULE
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define _UMATHMODULE
-#define _MULTIARRAYMODULE
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-
#include "npy_config.h"
#include "numpy/arrayobject.h"
diff --git a/numpy/fft/_pocketfft.c b/numpy/fft/_pocketfft.c
index 5a4931c01..1eb2eba18 100644
--- a/numpy/fft/_pocketfft.c
+++ b/numpy/fft/_pocketfft.c
@@ -9,10 +9,11 @@
* Copyright (C) 2004-2018 Max-Planck-Society
* \author Martin Reinecke
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#include "numpy/arrayobject.h"
#include "npy_config.h"
diff --git a/numpy/linalg/lapack_litemodule.c b/numpy/linalg/lapack_litemodule.c
index 00a806465..2fed0f2b0 100644
--- a/numpy/linalg/lapack_litemodule.c
+++ b/numpy/linalg/lapack_litemodule.c
@@ -2,14 +2,14 @@
Modified by Jim Hugunin
More modifications by Jeff Whitaker
*/
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#include "numpy/arrayobject.h"
#include "npy_cblas.h"
-
#define FNAME(name) BLAS_FUNC(name)
typedef CBLAS_INT fortran_int;