summaryrefslogtreecommitdiff
path: root/numpy/core/src/common
diff options
context:
space:
mode:
authorSayantika Banik <sayantikabanik122@gmail.com>2021-09-08 06:21:36 +0000
committerSayantika Banik <sayantikabanik122@gmail.com>2021-09-08 06:21:36 +0000
commit879b3b4798975c7c0c49cef6ece3563c5f2daaeb (patch)
treee102f2222f1557d9b4f8b1a3e9484ca59b8ad954 /numpy/core/src/common
parent9680d760cdb08cc54c18657c77269853670f17e9 (diff)
parent17c3a6b414a3e642abeb116ff71e97f9b6f2aab5 (diff)
downloadnumpy-879b3b4798975c7c0c49cef6ece3563c5f2daaeb.tar.gz
Merge branch 'main' of https://github.com/sayantikabanik/numpy
Diffstat (limited to 'numpy/core/src/common')
-rw-r--r--numpy/core/src/common/.doxyfile1
-rw-r--r--numpy/core/src/common/array_assign.c4
-rw-r--r--numpy/core/src/common/cblasfuncs.c8
-rw-r--r--numpy/core/src/common/lowlevel_strided_loops.h4
-rw-r--r--numpy/core/src/common/mem_overlap.c4
-rw-r--r--numpy/core/src/common/npy_argparse.c5
-rw-r--r--numpy/core/src/common/npy_argparse.h2
-rw-r--r--numpy/core/src/common/npy_longdouble.c5
-rw-r--r--numpy/core/src/common/numpyos.c17
-rw-r--r--numpy/core/src/common/python_xerbla.c4
-rw-r--r--numpy/core/src/common/ucsnarrow.c5
11 files changed, 31 insertions, 28 deletions
diff --git a/numpy/core/src/common/.doxyfile b/numpy/core/src/common/.doxyfile
new file mode 100644
index 000000000..462cbbcfa
--- /dev/null
+++ b/numpy/core/src/common/.doxyfile
@@ -0,0 +1 @@
+INCLUDE_PATH += @CUR_DIR
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 e78587de0..714636782 100644
--- a/numpy/core/src/common/cblasfuncs.c
+++ b/numpy/core/src/common/cblasfuncs.c
@@ -2,17 +2,19 @@
* 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>
-#include <assert.h>
-#include <numpy/arrayobject.h>
+
+#include "numpy/arrayobject.h"
#include "npy_cblas.h"
#include "arraytypes.h"
#include "common.h"
+#include <assert.h>
+
static const double oneD[2] = {1.0, 0.0}, zeroD[2] = {0.0, 0.0};
static const float oneF[2] = {1.0, 0.0}, zeroF[2] = {0.0, 0.0};
diff --git a/numpy/core/src/common/lowlevel_strided_loops.h b/numpy/core/src/common/lowlevel_strided_loops.h
index 3df054b40..2bbe4d100 100644
--- a/numpy/core/src/common/lowlevel_strided_loops.h
+++ b/numpy/core/src/common/lowlevel_strided_loops.h
@@ -1,8 +1,8 @@
#ifndef __LOWLEVEL_STRIDED_LOOPS_H
#define __LOWLEVEL_STRIDED_LOOPS_H
#include "common.h"
-#include <npy_config.h>
-#include <array_method.h>
+#include "npy_config.h"
+#include "array_method.h"
#include "dtype_transfer.h"
#include "mem_overlap.h"
diff --git a/numpy/core/src/common/mem_overlap.c b/numpy/core/src/common/mem_overlap.c
index 9da33bfc1..2632e1413 100644
--- a/numpy/core/src/common/mem_overlap.c
+++ b/numpy/core/src/common/mem_overlap.c
@@ -181,9 +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 8460a38e6..76123c1ed 100644
--- a/numpy/core/src/common/npy_argparse.c
+++ b/numpy/core/src/common/npy_argparse.c
@@ -1,8 +1,9 @@
-#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_argparse.h b/numpy/core/src/common/npy_argparse.h
index 5da535c91..487619d6d 100644
--- a/numpy/core/src/common/npy_argparse.h
+++ b/numpy/core/src/common/npy_argparse.h
@@ -1,7 +1,7 @@
#ifndef _NPY_ARGPARSE_H
#define _NPY_ARGPARSE_H
-#include "Python.h"
+#include <Python.h>
#include "numpy/ndarraytypes.h"
/*
diff --git a/numpy/core/src/common/npy_longdouble.c b/numpy/core/src/common/npy_longdouble.c
index 260e02a64..38dfd325c 100644
--- a/numpy/core/src/common/npy_longdouble.c
+++ b/numpy/core/src/common/npy_longdouble.c
@@ -1,8 +1,9 @@
-#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/python_xerbla.c b/numpy/core/src/common/python_xerbla.c
index fe2f718b2..37a41408b 100644
--- a/numpy/core/src/common/python_xerbla.c
+++ b/numpy/core/src/common/python_xerbla.c
@@ -1,4 +1,6 @@
-#include "Python.h"
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#include "numpy/npy_common.h"
#include "npy_cblas.h"
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"