diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-12-13 16:58:30 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:56:22 -0300 |
commit | 7b8d2925dd61e2cb1edc78bd10cdda2e8ef19bf2 (patch) | |
tree | 45fc63fc324e245f4b1fabae8d6c36c93f1a63cb | |
parent | c78b4686a1f98273cf4e730efae32fa7f93ebebd (diff) |
Small code style changes.
-rw-r--r-- | libpyside/pysideqflags.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libpyside/pysideqflags.cpp b/libpyside/pysideqflags.cpp index 4fe24b83a..39f8b04e8 100644 --- a/libpyside/pysideqflags.cpp +++ b/libpyside/pysideqflags.cpp @@ -39,7 +39,7 @@ extern "C" { #define PYSIDE_QFLAGS(X) reinterpret_cast<PySideQFlagsObject*>(X) - PyObject* PySideQFlagsNew(PyTypeObject *type, PyObject *args, PyObject *kwds) + PyObject* PySideQFlagsNew(PyTypeObject* type, PyObject* args, PyObject* kwds) { long val = 0; if (PyTuple_GET_SIZE(args)) { @@ -61,13 +61,11 @@ extern "C" { static long getNumberValue(PyObject* v) { - PyObject* number = PyNumber_Long(v); - long result = PyLong_AsLong(number); - Py_XDECREF(number); - return result; + Shiboken::AutoDecRef number(PyNumber_Long(v)); + return PyLong_AsLong(number); } - PyObject* PySideQFlagsRichCompare(PyObject *self, PyObject *other, int op) + PyObject* PySideQFlagsRichCompare(PyObject* self, PyObject* other, int op) { int result = 0; if (!PyNumber_Check(other)) { |