[pygobject/revert-typecasts] revert closure typecasts from commit 25a5b066



commit b97935dc304716ddf00ae16b6fdd4fe734acbe4a
Author: Dan HorĂ¡k <dan danny cz>
Date:   Fri Sep 14 07:16:39 2018 -0400

    revert closure typecasts from commit 25a5b066

 gi/pygi-closure.c | 30 +++++++++++++++---------------
 meson.build       |  1 +
 setup.py          |  1 +
 3 files changed, 17 insertions(+), 15 deletions(-)
---
diff --git a/gi/pygi-closure.c b/gi/pygi-closure.c
index d8788762..3299d1be 100644
--- a/gi/pygi-closure.c
+++ b/gi/pygi-closure.c
@@ -52,31 +52,31 @@ _pygi_closure_assign_pyobj_to_retval (gpointer retval,
 
     switch (arg_cache->type_tag) {
         case GI_TYPE_TAG_BOOLEAN:
-           *((gboolean *) retval) = arg->v_boolean;
+           *((ffi_sarg *) retval) = arg->v_boolean;
            break;
         case GI_TYPE_TAG_INT8:
-           *((gint8 *) retval) = arg->v_int8;
+           *((ffi_sarg *) retval) = arg->v_int8;
            break;
         case GI_TYPE_TAG_UINT8:
-           *((guint8 *) retval) = arg->v_uint8;
+           *((ffi_arg *) retval) = arg->v_uint8;
            break;
         case GI_TYPE_TAG_INT16:
-           *((gint16 *) retval) = arg->v_int16;
+           *((ffi_sarg *) retval) = arg->v_int16;
            break;
         case GI_TYPE_TAG_UINT16:
-           *((guint16 *) retval) = arg->v_uint16;
+           *((ffi_arg *) retval) = arg->v_uint16;
            break;
         case GI_TYPE_TAG_INT32:
-           *((gint32 *) retval) = arg->v_int32;
+           *((ffi_sarg *) retval) = arg->v_int32;
            break;
         case GI_TYPE_TAG_UINT32:
-           *((guint32 *) retval) = arg->v_uint32;
+           *((ffi_arg *) retval) = arg->v_uint32;
            break;
         case GI_TYPE_TAG_INT64:
-           *((gint64 *) retval) = arg->v_int64;
+           *((ffi_sarg *) retval) = arg->v_int64;
            break;
         case GI_TYPE_TAG_UINT64:
-           *((guint64 *) retval) = arg->v_uint64;
+           *((ffi_arg *) retval) = arg->v_uint64;
            break;
         case GI_TYPE_TAG_FLOAT:
            *((gfloat *) retval) = arg->v_float;
@@ -85,10 +85,10 @@ _pygi_closure_assign_pyobj_to_retval (gpointer retval,
            *((gdouble *) retval) = arg->v_double;
            break;
         case GI_TYPE_TAG_GTYPE:
-           *((gsize *) retval) = arg->v_size;
+           *((ffi_arg *) retval) = arg->v_size;
            break;
         case GI_TYPE_TAG_UNICHAR:
-            *((guint32 *) retval) = arg->v_uint32;
+            *((ffi_arg *) retval) = arg->v_uint32;
             break;
         case GI_TYPE_TAG_INTERFACE:
             {
@@ -98,20 +98,20 @@ _pygi_closure_assign_pyobj_to_retval (gpointer retval,
 
                 switch (g_base_info_get_type (interface_info)) {
                 case GI_INFO_TYPE_ENUM:
-                    *(gint *) retval = arg->v_int;
+                    *(ffi_sarg *) retval = arg->v_int;
                     break;
                 case GI_INFO_TYPE_FLAGS:
-                    *(guint *) retval = arg->v_uint;
+                    *(ffi_arg *) retval = arg->v_uint;
                     break;
                 default:
-                    *(gpointer *) retval = arg->v_pointer;
+                    *(ffi_arg *) retval = arg->v_pointer;
                     break;
                 }
 
                 break;
             }
         default:
-            *(gpointer *) retval = arg->v_pointer;
+            *(ffi_arg *) retval = arg->v_pointer;
             break;
       }
 }
diff --git a/meson.build b/meson.build
index 510e9be3..2620a11f 100644
--- a/meson.build
+++ b/meson.build
@@ -100,6 +100,7 @@ main_c_args += [
   '-Wno-discarded-qualifiers',
   '-Wno-sign-conversion',
   '-Wno-cast-function-type',
+  '-Wno-int-conversion',
 ]
 
 main_c_args += [
diff --git a/setup.py b/setup.py
index eb3b5de8..4ad659dc 100755
--- a/setup.py
+++ b/setup.py
@@ -929,6 +929,7 @@ def add_ext_compiler_flags(ext, compiler, _cache={}):
             "-Wno-discarded-qualifiers",
             "-Wno-sign-conversion",
             "-Wno-cast-function-type",
+            "-Wno-int-conversion",
         ]
 
         # silence clang for unused gcc CFLAGS added by Debian


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