diff options
author | Josh Haberman <jhaberman@gmail.com> | 2015-10-06 14:13:09 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2015-10-28 17:05:47 -0700 |
commit | 00700b72191d620402d5eb0390b5460b35c93e05 (patch) | |
tree | dbf199b487dadb402ae52c401ab95c81f437a9ef /python/google/protobuf/pyext/repeated_composite_container.cc | |
parent | 12fb61b292d7ec4cb14b0d60e58ed5c35adda3b7 (diff) | |
download | protobuf-00700b72191d620402d5eb0390b5460b35c93e05.tar.gz protobuf-00700b72191d620402d5eb0390b5460b35c93e05.tar.bz2 protobuf-00700b72191d620402d5eb0390b5460b35c93e05.zip |
Removed all warnings from the Python/C++ build.
Also made the Travis build ensure that no warnings
are present.
These builds were previously spewing many warnings,
which was hiding warnings for important things like
accidentally using C++11-only features.
Change-Id: I56caeee9db48bc78756a3e8d7c14874630627037
Diffstat (limited to 'python/google/protobuf/pyext/repeated_composite_container.cc')
-rw-r--r-- | python/google/protobuf/pyext/repeated_composite_container.cc | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/python/google/protobuf/pyext/repeated_composite_container.cc b/python/google/protobuf/pyext/repeated_composite_container.cc index fe2e600b..b01123b4 100644 --- a/python/google/protobuf/pyext/repeated_composite_container.cc +++ b/python/google/protobuf/pyext/repeated_composite_container.cc @@ -116,7 +116,7 @@ static int UpdateChildMessages(RepeatedCompositeContainer* self) { cmsg->owner = self->owner; cmsg->message = const_cast<Message*>(&sub_message); cmsg->parent = self->parent; - if (PyList_Append(self->child_messages, py_cmsg) < 0) { + if (PyList_Append(self->child_messages, py_cmsg.get()) < 0) { return -1; } } @@ -202,8 +202,8 @@ PyObject* Extend(RepeatedCompositeContainer* self, PyObject* value) { return NULL; } ScopedPyObjectPtr next; - while ((next.reset(PyIter_Next(iter))) != NULL) { - if (!PyObject_TypeCheck(next, &CMessage_Type)) { + while ((next.reset(PyIter_Next(iter.get()))) != NULL) { + if (!PyObject_TypeCheck(next.get(), &CMessage_Type)) { PyErr_SetString(PyExc_TypeError, "Not a cmessage"); return NULL; } @@ -212,7 +212,8 @@ PyObject* Extend(RepeatedCompositeContainer* self, PyObject* value) { return NULL; } CMessage* new_cmessage = reinterpret_cast<CMessage*>(new_message.get()); - if (ScopedPyObjectPtr(cmessage::MergeFrom(new_cmessage, next)) == NULL) { + if (ScopedPyObjectPtr(cmessage::MergeFrom(new_cmessage, next.get())) == + NULL) { return NULL; } } @@ -294,7 +295,7 @@ static PyObject* Remove(RepeatedCompositeContainer* self, PyObject* value) { return NULL; } ScopedPyObjectPtr py_index(PyLong_FromLong(index)); - if (AssignSubscript(self, py_index, NULL) < 0) { + if (AssignSubscript(self, py_index.get(), NULL) < 0) { return NULL; } Py_RETURN_NONE; @@ -318,17 +319,17 @@ static PyObject* RichCompare(RepeatedCompositeContainer* self, if (full_slice == NULL) { return NULL; } - ScopedPyObjectPtr list(Subscript(self, full_slice)); + ScopedPyObjectPtr list(Subscript(self, full_slice.get())); if (list == NULL) { return NULL; } ScopedPyObjectPtr other_list( - Subscript( - reinterpret_cast<RepeatedCompositeContainer*>(other), full_slice)); + Subscript(reinterpret_cast<RepeatedCompositeContainer*>(other), + full_slice.get())); if (other_list == NULL) { return NULL; } - return PyObject_RichCompare(list, other_list, opid); + return PyObject_RichCompare(list.get(), other_list.get(), opid); } else { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; @@ -365,7 +366,7 @@ static int SortPythonMessages(RepeatedCompositeContainer* self, ScopedPyObjectPtr m(PyObject_GetAttrString(self->child_messages, "sort")); if (m == NULL) return -1; - if (PyObject_Call(m, args, kwds) == NULL) + if (PyObject_Call(m.get(), args, kwds) == NULL) return -1; if (self->message != NULL) { ReorderAttached(self); @@ -429,7 +430,7 @@ static PyObject* Pop(RepeatedCompositeContainer* self, return NULL; } ScopedPyObjectPtr py_index(PyLong_FromSsize_t(index)); - if (AssignSubscript(self, py_index, NULL) < 0) { + if (AssignSubscript(self, py_index.get(), NULL) < 0) { return NULL; } return item; |