Skip to content

Commit 2282645

Browse files
Merge pull request #227 from oleksandr-pavlyk/feature/deprec-conv-warn
MAINT: Elimited deprecated conversion from string constant to 'char *'
2 parents 5a330dc + fda3c80 commit 2282645

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

numexpr/interpreter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ run_interpreter(NumExprObject *self, NpyIter *iter, NpyIter *reduce_iter,
905905
pc_error, &errmsg);
906906
}
907907
else {
908-
errmsg = "Parallel engine doesn't support reduction yet";
908+
errmsg = (char *) "Parallel engine doesn't support reduction yet";
909909
r = -1;
910910
}
911911
}

numexpr/numexpr_object.cpp

+12-10
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ NumExpr_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
8181
return (PyObject *)self;
8282
}
8383

84+
#define CHARP(s) ((char *)(s))
85+
8486
static int
8587
NumExpr_init(NumExprObject *self, PyObject *args, PyObject *kwds)
8688
{
@@ -94,9 +96,9 @@ NumExpr_init(NumExprObject *self, PyObject *args, PyObject *kwds)
9496
npy_intp *memsteps;
9597
npy_intp *memsizes;
9698
int rawmemsize;
97-
static char *kwlist[] = {"signature", "tempsig",
98-
"program", "constants",
99-
"input_names", NULL};
99+
static char *kwlist[] = {CHARP("signature"), CHARP("tempsig"),
100+
CHARP("program"), CHARP("constants"),
101+
CHARP("input_names"), NULL};
100102

101103
if (!PyArg_ParseTupleAndKeywords(args, kwds, "SSS|OO", kwlist,
102104
&signature,
@@ -357,15 +359,15 @@ static PyMethodDef NumExpr_methods[] = {
357359
};
358360

359361
static PyMemberDef NumExpr_members[] = {
360-
{"signature", T_OBJECT_EX, offsetof(NumExprObject, signature), READONLY, NULL},
361-
{"constsig", T_OBJECT_EX, offsetof(NumExprObject, constsig), READONLY, NULL},
362-
{"tempsig", T_OBJECT_EX, offsetof(NumExprObject, tempsig), READONLY, NULL},
363-
{"fullsig", T_OBJECT_EX, offsetof(NumExprObject, fullsig), READONLY, NULL},
362+
{CHARP("signature"), T_OBJECT_EX, offsetof(NumExprObject, signature), READONLY, NULL},
363+
{CHARP("constsig"), T_OBJECT_EX, offsetof(NumExprObject, constsig), READONLY, NULL},
364+
{CHARP("tempsig"), T_OBJECT_EX, offsetof(NumExprObject, tempsig), READONLY, NULL},
365+
{CHARP("fullsig"), T_OBJECT_EX, offsetof(NumExprObject, fullsig), READONLY, NULL},
364366

365-
{"program", T_OBJECT_EX, offsetof(NumExprObject, program), READONLY, NULL},
366-
{"constants", T_OBJECT_EX, offsetof(NumExprObject, constants),
367+
{CHARP("program"), T_OBJECT_EX, offsetof(NumExprObject, program), READONLY, NULL},
368+
{CHARP("constants"), T_OBJECT_EX, offsetof(NumExprObject, constants),
367369
READONLY, NULL},
368-
{"input_names", T_OBJECT, offsetof(NumExprObject, input_names), 0, NULL},
370+
{CHARP("input_names"), T_OBJECT, offsetof(NumExprObject, input_names), 0, NULL},
369371
{NULL},
370372
};
371373

0 commit comments

Comments
 (0)