[pygobject] Remove incorrect and unused casts from tp_free calls



commit 3165c17a455652de9a61439428fa40f30120dc6a
Author: Simon Feltman <sfeltman src gnome org>
Date:   Fri Aug 8 02:46:26 2014 -0700

    Remove incorrect and unused casts from tp_free calls
    
    Arguments to Py_TYPE() do not need to be cast since the macro always casts
    to a PyObject* internall.

 gi/pygi-boxed.c     |    2 +-
 gi/pygi-ccallback.c |    2 +-
 gi/pygi-info.c      |    2 +-
 gi/pygi-struct.c    |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gi/pygi-boxed.c b/gi/pygi-boxed.c
index b46cdcc..4fd90d2 100644
--- a/gi/pygi-boxed.c
+++ b/gi/pygi-boxed.c
@@ -39,7 +39,7 @@ _boxed_dealloc (PyGIBoxed *self)
         }
     }
 
-    Py_TYPE( (PyGObject *) self)->tp_free ( (PyObject *) self);
+    Py_TYPE (self)->tp_free ((PyObject *)self);
 }
 
 void *
diff --git a/gi/pygi-ccallback.c b/gi/pygi-ccallback.c
index 98dd773..9c6e47e 100644
--- a/gi/pygi-ccallback.c
+++ b/gi/pygi-ccallback.c
@@ -83,7 +83,7 @@ _ccallback_dealloc (PyGICCallback *self)
         pygi_callable_cache_free ( (PyGICallableCache *)self->cache);
     }
 
-    Py_TYPE ((PyGObject *)self)->tp_free ((PyObject *)self);
+    Py_TYPE (self)->tp_free ((PyObject *)self);
 }
 
 void
diff --git a/gi/pygi-info.c b/gi/pygi-info.c
index fdf12b3..c07d113 100644
--- a/gi/pygi-info.c
+++ b/gi/pygi-info.c
@@ -178,7 +178,7 @@ _base_info_dealloc (PyGIBaseInfo *self)
     if (self->cache != NULL)
         pygi_callable_cache_free ( (PyGICallableCache *) self->cache);
 
-    Py_TYPE( (PyObject *) self)->tp_free ( (PyObject *) self);
+    Py_TYPE (self)->tp_free ((PyObject *)self);
 }
 
 static PyObject *
diff --git a/gi/pygi-struct.c b/gi/pygi-struct.c
index 692068b..adf8e72 100644
--- a/gi/pygi-struct.c
+++ b/gi/pygi-struct.c
@@ -69,7 +69,7 @@ _struct_dealloc (PyGIStruct *self)
         g_base_info_unref (info);
     }
 
-    Py_TYPE( (PyGPointer *) self )->tp_free ( (PyObject *) self);
+    Py_TYPE (self)->tp_free ((PyObject *)self);
 }
 
 static PyObject *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]