From: John Spray Date: Tue, 4 Oct 2016 13:07:50 +0000 (+0100) Subject: mgr: squash compiler warnings X-Git-Tag: v11.0.1~28^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a22bb9cb75ccfbbb270f591f68a92f8258bf6f4a;p=ceph-ci.git mgr: squash compiler warnings Signed-off-by: John Spray --- diff --git a/src/mgr/MgrPyModule.cc b/src/mgr/MgrPyModule.cc index 4e8d0d3bf64..218444a861c 100644 --- a/src/mgr/MgrPyModule.cc +++ b/src/mgr/MgrPyModule.cc @@ -79,7 +79,7 @@ int MgrPyModule::serve() gstate = PyGILState_Ensure(); auto pValue = PyObject_CallMethod(pClassInstance, - (const char*)"serve", (const char*)"()"); + const_cast("serve"), nullptr); if (pValue != NULL) { Py_DECREF(pValue); @@ -102,7 +102,7 @@ void MgrPyModule::shutdown() gstate = PyGILState_Ensure(); auto pValue = PyObject_CallMethod(pClassInstance, - (const char*)"shutdown", (const char*)"()"); + const_cast("shutdown"), nullptr); if (pValue != NULL) { Py_DECREF(pValue); @@ -122,7 +122,8 @@ void MgrPyModule::notify(const std::string ¬ify_type, const std::string ¬i gstate = PyGILState_Ensure(); // Execute - auto pValue = PyObject_CallMethod(pClassInstance, (const char*)"notify", "(ss)", + auto pValue = PyObject_CallMethod(pClassInstance, + const_cast("notify"), const_cast("(ss)"), notify_type.c_str(), notify_id.c_str()); if (pValue != NULL) { @@ -195,7 +196,7 @@ int MgrPyModule::handle_command( PyObject *py_cmd = f.get(); auto pResult = PyObject_CallMethod(pClassInstance, - (const char*)"handle_command", (const char*)"(O)", py_cmd); + const_cast("handle_command"), const_cast("(O)"), py_cmd); Py_DECREF(py_cmd); diff --git a/src/mgr/PyModules.cc b/src/mgr/PyModules.cc index be842da382e..de9a4ce24d2 100644 --- a/src/mgr/PyModules.cc +++ b/src/mgr/PyModules.cc @@ -393,7 +393,7 @@ int PyModules::init() } // Drop the GIL - PyThreadState *tstate = PyEval_SaveThread(); + PyEval_SaveThread(); return 0; }