]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: squash compiler warnings 11307/head
authorJohn Spray <john.spray@redhat.com>
Tue, 4 Oct 2016 13:07:50 +0000 (14:07 +0100)
committerJohn Spray <john.spray@redhat.com>
Tue, 4 Oct 2016 13:12:59 +0000 (14:12 +0100)
Signed-off-by: John Spray <john.spray@redhat.com>
src/mgr/MgrPyModule.cc
src/mgr/PyModules.cc

index 4e8d0d3bf64e59f8b661a498f5af17bb64b90249..218444a861c95db325e0cec6c3777814413d5592 100644 (file)
@@ -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);
@@ -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);
@@ -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) {
@@ -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);
 
index be842da382e9f9ffb59dd87b597c8840b23820b1..de9a4ce24d22e365046dddc572eee7fb63cecdf6 100644 (file)
@@ -393,7 +393,7 @@ int PyModules::init()
   } 
 
   // Drop the GIL
-  PyThreadState *tstate = PyEval_SaveThread();
+  PyEval_SaveThread();
   
   return 0;
 }