summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorLars Buitinck <larsmans@gmail.com>2014-10-12 15:58:26 +0200
committerLars Buitinck <larsmans@gmail.com>2014-10-12 15:59:07 +0200
commit8b17fae1428502ade57c2aa5706add6228711713 (patch)
treeecee89e1b1070e7025936086b6268654c475adf2 /numpy/core
parentbfc4bf4421a84eec6e17ddf09a3d2beacf4ea4b7 (diff)
downloadnumpy-8b17fae1428502ade57c2aa5706add6228711713.tar.gz
MAINT: core: string constants in static buffers
Saves copying them into temporary buffers.
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/src/multiarray/multiarraymodule.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c
index 8e9b656cf..fc635b9e9 100644
--- a/numpy/core/src/multiarray/multiarraymodule.c
+++ b/numpy/core/src/multiarray/multiarraymodule.c
@@ -247,7 +247,7 @@ PyArray_As1D(PyObject **op, char **ptr, int *d1, int typecode)
{
npy_intp newd1;
PyArray_Descr *descr;
- char msg[] = "PyArray_As1D: use PyArray_AsCArray.";
+ static const char msg[] = "PyArray_As1D: use PyArray_AsCArray.";
if (DEPRECATE(msg) < 0) {
return -1;
@@ -268,7 +268,7 @@ PyArray_As2D(PyObject **op, char ***ptr, int *d1, int *d2, int typecode)
{
npy_intp newdims[2];
PyArray_Descr *descr;
- char msg[] = "PyArray_As1D: use PyArray_AsCArray.";
+ static const char msg[] = "PyArray_As1D: use PyArray_AsCArray.";
if (DEPRECATE(msg) < 0) {
return -1;
@@ -340,8 +340,9 @@ PyArray_ConcatenateArrays(int narrays, PyArrayObject **arrays, int axis)
}
if (ndim == 1 && axis != 0) {
- char msg[] = "axis != 0 for ndim == 1; this will raise an error in "
- "future versions of numpy";
+ static const char msg[] = "axis != 0 for ndim == 1; "
+ "this will raise an error in "
+ "future versions of numpy";
if (DEPRECATE(msg) < 0) {
return NULL;
}