diff options
| author | Simon Feltman <sfeltman@src.gnome.org> | 2014-05-16 14:19:47 -0700 |
|---|---|---|
| committer | Simon Feltman <sfeltman@src.gnome.org> | 2014-05-16 14:25:52 -0700 |
| commit | 92fe52243d819ffe91597744a6a1c2362a295bce (patch) | |
| tree | 0158311a877df2acae375be8f7fa95ad2256ee65 /gi/pygi-boxed.c | |
| parent | 0a4f13a571cb9bd110f435f8b23ed942e3b007b0 (diff) | |
| download | pygobject-92fe52243d819ffe91597744a6a1c2362a295bce.tar.gz | |
Use accessors for getting and setting PyGBoxed pointers
Add pyg_boxed_get_ptr and pyg_boxed_set_ptr macros for getting and setting
the boxed pointer field. This is preliminary cleanup work for supporting
fundamental types.
https://bugzilla.gnome.org/show_bug.cgi?id=631901
Diffstat (limited to 'gi/pygi-boxed.c')
| -rw-r--r-- | gi/pygi-boxed.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gi/pygi-boxed.c b/gi/pygi-boxed.c index c52858bb..b46cdcc5 100644 --- a/gi/pygi-boxed.c +++ b/gi/pygi-boxed.c @@ -32,10 +32,10 @@ _boxed_dealloc (PyGIBoxed *self) if ( ( (PyGBoxed *) self)->free_on_dealloc) { if (self->slice_allocated) { - g_slice_free1 (self->size, ( (PyGBoxed *) self)->boxed); + g_slice_free1 (self->size, pyg_boxed_get_ptr (self)); } else { g_type = pyg_type_from_object ( (PyObject *) self); - g_boxed_free (g_type, ( (PyGBoxed *) self)->boxed); + g_boxed_free (g_type, pyg_boxed_get_ptr (self)); } } @@ -158,8 +158,8 @@ _pygi_boxed_new (PyTypeObject *type, } ( (PyGBoxed *) self)->gtype = pyg_type_from_object ( (PyObject *) type); - ( (PyGBoxed *) self)->boxed = boxed; ( (PyGBoxed *) self)->free_on_dealloc = free_on_dealloc; + pyg_boxed_set_ptr (self, boxed); if (allocated_slice > 0) { self->size = allocated_slice; self->slice_allocated = TRUE; |
