diff options
author | Bernard Normier <bernard@zeroc.com> | 2018-10-26 17:17:11 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2018-10-26 17:17:11 -0400 |
commit | 42c905a3ca29a1e911e7def9c2d9d9b8e95383cd (patch) | |
tree | 1b704d084e39c0acd15859f2dd258eff7aaa7fc6 /python/modules/IcePy/Connection.cpp | |
parent | Do not use time.clock() with Python >= 3.3 as it is deprecated (diff) | |
download | ice-42c905a3ca29a1e911e7def9c2d9d9b8e95383cd.tar.bz2 ice-42c905a3ca29a1e911e7def9c2d9d9b8e95383cd.tar.xz ice-42c905a3ca29a1e911e7def9c2d9d9b8e95383cd.zip |
Extra C++ warning flags with clang and g++.
Fixes 223.
Diffstat (limited to 'python/modules/IcePy/Connection.cpp')
-rw-r--r-- | python/modules/IcePy/Connection.cpp | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/python/modules/IcePy/Connection.cpp b/python/modules/IcePy/Connection.cpp index f083e6ced6b..9f0b54de55c 100644 --- a/python/modules/IcePy/Connection.cpp +++ b/python/modules/IcePy/Connection.cpp @@ -107,20 +107,9 @@ public: Py_DECREF(_con); } - virtual void closed(const Ice::ConnectionPtr& con) - { - invoke(con); - } - -private: - - void invoke(const Ice::ConnectionPtr& con) + virtual void closed(const Ice::ConnectionPtr&) { AdoptThread adoptThread; // Ensure the current thread is able to call into Python. -#ifndef NDEBUG - ConnectionObject* c = reinterpret_cast<ConnectionObject*>(_con); - assert(con == *(c->connection)); -#endif PyObjectHandle args = Py_BuildValue(STRCAST("(O)"), _con); assert(_cb); @@ -141,6 +130,8 @@ private: } } +private: + PyObject* _cb; PyObject* _con; }; @@ -164,20 +155,9 @@ public: Py_DECREF(_con); } - virtual void heartbeat(const Ice::ConnectionPtr& con) - { - invoke(con); - } - -private: - - void invoke(const Ice::ConnectionPtr& con) + virtual void heartbeat(const Ice::ConnectionPtr&) { AdoptThread adoptThread; // Ensure the current thread is able to call into Python. -#ifndef NDEBUG - ConnectionObject* c = reinterpret_cast<ConnectionObject*>(_con); - assert(con == *(c->connection)); -#endif PyObjectHandle args = Py_BuildValue(STRCAST("(O)"), _con); assert(_cb); @@ -198,6 +178,8 @@ private: } } +private: + PyObject* _cb; PyObject* _con; }; @@ -642,9 +624,9 @@ connectionBeginFlushBatchRequests(ConnectionObject* self, PyObject* args, PyObje result = (*self->connection)->begin_flushBatchRequests(cb); } } - catch(const Ice::Exception& ex) + catch(const Ice::Exception& e) { - setPythonException(ex); + setPythonException(e); return 0; } @@ -845,9 +827,9 @@ connectionBeginHeartbeat(ConnectionObject* self, PyObject* args, PyObject* kwds) result = (*self->connection)->begin_heartbeat(); } } - catch(const Ice::Exception& ex) + catch(const Ice::Exception& e) { - setPythonException(ex); + setPythonException(e); return 0; } |