@@ -63,15 +63,14 @@ namespace scorepy
6363PyTypeObject& getCInstrumenterType ()
6464{
6565 static PyMethodDef methods[] = {
66- { " _enable_instrumenter" , reinterpret_cast <PyCFunction> (CInstrumenter_enable_instrumenter),
66+ { " _enable_instrumenter" , scorepy::castToPyFunc (CInstrumenter_enable_instrumenter),
6767 METH_NOARGS, " Enable the instrumenter" },
68- { " _disable_instrumenter" ,
69- reinterpret_cast <PyCFunction>(CInstrumenter_disable_instrumenter), METH_NOARGS,
70- " Disable the instrumenter" },
68+ { " _disable_instrumenter" , scorepy::castToPyFunc (CInstrumenter_disable_instrumenter),
69+ METH_NOARGS, " Disable the instrumenter" },
7170 { nullptr } /* Sentinel */
7271 };
7372 static PyGetSetDef getseters[] = {
74- { " tracingOrProfiling" , reinterpret_cast <getter> (CInstrumenter_get_tracingOrProfiling),
73+ { " tracingOrProfiling" , scorepy::castToPyFunc (CInstrumenter_get_tracingOrProfiling),
7574 nullptr , " Return whether the trace (True) or profile (False) instrumentation is used" ,
7675 nullptr },
7776 { nullptr } /* Sentinel */
@@ -83,7 +82,7 @@ PyTypeObject& getCInstrumenterType()
8382 sizeof (CInstrumenter), /* tp_basicsize */
8483 };
8584 type.tp_new = call_object_new;
86- type.tp_init = reinterpret_cast <initproc> (CInstrumenter_init);
85+ type.tp_init = scorepy::castToPyFunc (CInstrumenter_init);
8786 type.tp_methods = methods;
8887 type.tp_getset = getseters;
8988 type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE;
0 commit comments