Skip to content

Commit

Permalink
Fix const incorrectness. (#2942)
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc committed Jun 26, 2024
1 parent 4408113 commit db3b0ef
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/nrnpython/nrnpy_nrn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2152,11 +2152,11 @@ static int section_setattro(NPySecObj* self, PyObject* pyname, PyObject* value)
err = -1;
} else {
int errp;
auto const d = nrnpy_rangepointer(sec, sym, 0.5, &errp, 0 /* idx */);
auto d = nrnpy_rangepointer(sec, sym, 0.5, &errp, 0 /* idx */);
if (!d) {
rv_noexist(sec, n, 0.5, errp);
err = -1;
} else if (!PyArg_Parse(value, "d", static_cast<double const*>(d))) {
} else if (!PyArg_Parse(value, "d", static_cast<double*>(d))) {
PyErr_SetString(PyExc_ValueError, "bad value");
err = -1;
} else {
Expand Down Expand Up @@ -2436,13 +2436,13 @@ static int segment_setattro(NPySegObj* self, PyObject* pyname, PyObject* value)
err = -1;
} else {
int errp;
auto const d = nrnpy_rangepointer(sec, sym, self->x_, &errp, 0 /* idx */);
auto d = nrnpy_rangepointer(sec, sym, self->x_, &errp, 0 /* idx */);
if (!d) {
rv_noexist(sec, n, self->x_, errp);
Py_DECREF(pyname);
return -1;
}
if (!PyArg_Parse(value, "d", static_cast<double const*>(d))) {
if (!PyArg_Parse(value, "d", static_cast<double*>(d))) {
PyErr_SetString(PyExc_ValueError, "bad value");
Py_DECREF(pyname);
return -1;
Expand Down Expand Up @@ -2781,7 +2781,7 @@ static int rv_setitem(PyObject* self, Py_ssize_t ix, PyObject* value) {
return -1;
}
int err;
auto const d = nrnpy_rangepointer(sec, r->sym_, r->pymech_->pyseg_->x_, &err, ix);
auto d = nrnpy_rangepointer(sec, r->sym_, r->pymech_->pyseg_->x_, &err, ix);
if (!d) {
rv_noexist(sec, r->sym_->name, r->pymech_->pyseg_->x_, err);
return -1;
Expand All @@ -2801,7 +2801,7 @@ static int rv_setitem(PyObject* self, Py_ssize_t ix, PyObject* value) {
neuron::container::data_handle<double>{neuron::container::do_not_search, &x},
0);
} else {
if (!PyArg_Parse(value, "d", static_cast<double const*>(d))) {
if (!PyArg_Parse(value, "d", static_cast<double*>(d))) {
PyErr_SetString(PyExc_ValueError, "bad value");
return -1;
}
Expand Down

0 comments on commit db3b0ef

Please sign in to comment.