diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:41:54 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:41:58 +0900 |
commit | 4bfc3de521c8d93613e5153028da35406609a64f (patch) | |
tree | 98175ed0ab42bc56bec3d45d69364a988a00de1f /gi/pygpointer.c | |
parent | 5a89ec21697bd9e08c9102b2a7b6c60b4652e66c (diff) | |
download | pygobject2-4bfc3de521c8d93613e5153028da35406609a64f.tar.gz pygobject2-4bfc3de521c8d93613e5153028da35406609a64f.tar.bz2 pygobject2-4bfc3de521c8d93613e5153028da35406609a64f.zip |
Imported Upstream version 3.13.2
Change-Id: Icce9be2c1bf0568fc95f75ff0a714c017e6171ec
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'gi/pygpointer.c')
-rw-r--r-- | gi/pygpointer.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gi/pygpointer.c b/gi/pygpointer.c index 2729695..d728a40 100644 --- a/gi/pygpointer.c +++ b/gi/pygpointer.c @@ -27,6 +27,7 @@ #include "pygpointer.h" #include "pygi.h" +#include "pygi-type.h" GQuark pygpointer_class_key; @@ -43,9 +44,9 @@ static PyObject* pyg_pointer_richcompare(PyObject *self, PyObject *other, int op) { if (Py_TYPE(self) == Py_TYPE(other)) - return _pyglib_generic_ptr_richcompare(((PyGPointer*)self)->pointer, - ((PyGPointer*)other)->pointer, - op); + return _pyglib_generic_ptr_richcompare (pyg_pointer_get_ptr (self), + pyg_pointer_get_ptr (other), + op); else { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; @@ -55,7 +56,7 @@ pyg_pointer_richcompare(PyObject *self, PyObject *other, int op) static long pyg_pointer_hash(PyGPointer *self) { - return (long)self->pointer; + return (long)pyg_pointer_get_ptr (self); } static PyObject * @@ -64,7 +65,7 @@ pyg_pointer_repr(PyGPointer *self) gchar buf[128]; g_snprintf(buf, sizeof(buf), "<%s at 0x%lx>", g_type_name(self->gtype), - (long)self->pointer); + (long)pyg_pointer_get_ptr (self)); return PYGLIB_PyUnicode_FromString(buf); } @@ -76,7 +77,7 @@ pyg_pointer_init(PyGPointer *self, PyObject *args, PyObject *kwargs) if (!PyArg_ParseTuple(args, ":GPointer.__init__")) return -1; - self->pointer = NULL; + pyg_pointer_set_ptr (self, NULL); self->gtype = 0; g_snprintf(buf, sizeof(buf), "%s can not be constructed", @@ -174,7 +175,7 @@ pyg_pointer_new(GType pointer_type, gpointer pointer) if (self == NULL) return NULL; - self->pointer = pointer; + pyg_pointer_set_ptr (self, pointer); self->gtype = pointer_type; return (PyObject *)self; |