From a22bb9cb75ccfbbb270f591f68a92f8258bf6f4a Mon Sep 17 00:00:00 2001 From: John Spray Date: Tue, 4 Oct 2016 14:07:50 +0100 Subject: [PATCH] mgr: squash compiler warnings Signed-off-by: John Spray --- src/mgr/MgrPyModule.cc | 9 +++++---- src/mgr/PyModules.cc | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mgr/MgrPyModule.cc b/src/mgr/MgrPyModule.cc index 4e8d0d3bf64e5..218444a861c95 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 be842da382e9f..de9a4ce24d22e 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; } -- 2.39.5