8000 Merge pull request #5175 from larsmans/c-fixes · numpy/numpy@4c4595b · GitHub
[go: up one dir, main page]

Skip to content

Commit 4c4595b

Browse files
committed
Merge pull request #5175 from larsmans/c-fixes
MAINT: core: string constants in static buffers
2 parents 9636420 + 8b17fae commit 4c4595b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

numpy/core/src/multiarray/multiarraymodule.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ PyArray_As1D(PyObject **op, char **ptr, int *d1, int typecode)
254254
{
255255
npy_intp newd1;
256256
PyArray_Descr *descr;
257-
char msg[] = "PyArray_As1D: use PyArray_AsCArray.";
257+
static const char msg[] = "PyArray_As1D: use PyArray_AsCArray.";
258258

259259
if (DEPRECATE(msg) < 0) {
260260
return -1;
@@ -275,7 +275,7 @@ PyArray_As2D(PyObject **op, char ***ptr, int *d1, int *d2, int typecode)
275275
{
276276
npy_intp newdims[2];
277277
PyArray_Descr *descr;
278-
char msg[] = "PyArray_As1D: use PyArray_AsCArray.";
278+
static const char msg[] = "PyArray_As1D: use PyArray_AsCArray.";
279279

280280
if (DEPRECATE(msg) < 0) {
281281
return -1;
@@ -347,8 +347,9 @@ PyArray_ConcatenateArrays(int narrays, PyArrayObject **arrays, int axis)
347347
}
348348

349349
if (ndim == 1 && axis != 0) {
350-
char msg[] = "axis != 0 for ndim == 1; this will raise an error in "
351-
"future versions of numpy";
350+
static const char msg[] = "axis != 0 for ndim == 1; "
351+
"this will raise an error in "
352+
"future versions of numpy";
352353
if (DEPRECATE(msg) < 0) {
353354
return NULL;
354355
}

0 commit comments

Comments
 (0)
0