aboutsummaryrefslogtreecommitdiffhomepage
path: root/python/google/protobuf/pyext/descriptor.cc
diff options
context:
space:
mode:
authorGravatar Josh Haberman <jhaberman@gmail.com>2015-10-06 14:13:09 -0700
committerGravatar Josh Haberman <jhaberman@gmail.com>2015-10-28 17:05:47 -0700
commit00700b72191d620402d5eb0390b5460b35c93e05 (patch)
treedbf199b487dadb402ae52c401ab95c81f437a9ef /python/google/protobuf/pyext/descriptor.cc
parent12fb61b292d7ec4cb14b0d60e58ed5c35adda3b7 (diff)
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/descriptor.cc')
-rw-r--r--python/google/protobuf/pyext/descriptor.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/google/protobuf/pyext/descriptor.cc b/python/google/protobuf/pyext/descriptor.cc
index b238fd02..61a3d237 100644
--- a/python/google/protobuf/pyext/descriptor.cc
+++ b/python/google/protobuf/pyext/descriptor.cc
@@ -232,7 +232,7 @@ static PyObject* GetOrBuildOptions(const DescriptorClass *descriptor) {
}
// Cache the result.
- Py_INCREF(value);
+ Py_INCREF(value.get());
(*pool->descriptor_options)[descriptor] = value.get();
return value.release();
@@ -1489,7 +1489,8 @@ static bool AddEnumValues(PyTypeObject *type,
if (obj == NULL) {
return false;
}
- if (PyDict_SetItemString(type->tp_dict, value->name().c_str(), obj) < 0) {
+ if (PyDict_SetItemString(type->tp_dict, value->name().c_str(), obj.get()) <
+ 0) {
return false;
}
}
@@ -1498,7 +1499,7 @@ static bool AddEnumValues(PyTypeObject *type,
static bool AddIntConstant(PyTypeObject *type, const char* name, int value) {
ScopedPyObjectPtr obj(PyInt_FromLong(value));
- if (PyDict_SetItemString(type->tp_dict, name, obj) < 0) {
+ if (PyDict_SetItemString(type->tp_dict, name, obj.get()) < 0) {
return false;
}
return true;