Skip to content

Commit

Permalink
mgr: squash compiler warnings
Browse files Browse the repository at this point in the history
Signed-off-by: John Spray <john.spray@redhat.com>
  • Loading branch information
John Spray committed Oct 4, 2016
1 parent 2d1f164 commit f801429
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/mgr/MgrPyModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int MgrPyModule::serve()
gstate = PyGILState_Ensure();

auto pValue = PyObject_CallMethod(pClassInstance,
(const char*)"serve", (const char*)"()");
const_cast<char*>("serve"), nullptr);

if (pValue != NULL) {
Py_DECREF(pValue);
Expand All @@ -102,7 +102,7 @@ void MgrPyModule::shutdown()
gstate = PyGILState_Ensure();

auto pValue = PyObject_CallMethod(pClassInstance,
(const char*)"shutdown", (const char*)"()");
const_cast<char*>("shutdown"), nullptr);

if (pValue != NULL) {
Py_DECREF(pValue);
Expand All @@ -122,7 +122,8 @@ void MgrPyModule::notify(const std::string &notify_type, const std::string &noti
gstate = PyGILState_Ensure();

// Execute
auto pValue = PyObject_CallMethod(pClassInstance, (const char*)"notify", "(ss)",
auto pValue = PyObject_CallMethod(pClassInstance,
const_cast<char*>("notify"), const_cast<char*>("(ss)"),
notify_type.c_str(), notify_id.c_str());

if (pValue != NULL) {
Expand Down Expand Up @@ -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<char*>("handle_command"), const_cast<char*>("(O)"), py_cmd);

Py_DECREF(py_cmd);

Expand Down
2 changes: 1 addition & 1 deletion src/mgr/PyModules.cc
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ int PyModules::init()
}

// Drop the GIL
PyThreadState *tstate = PyEval_SaveThread();
PyEval_SaveThread();

return 0;
}
Expand Down

0 comments on commit f801429

Please sign in to comment.