[perl-Glib-Object-Introspection] Fix a few signed/unsigned mismatches



commit 1dd588ac8af3a9d8dface2bd533e22c3dacb3216
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sun Jan 19 14:32:40 2014 +0100

    Fix a few signed/unsigned mismatches
    
    They could conceivably cause misbehavior but did not do so under gcc.

 GObjectIntrospection.xs       |    6 +++---
 NEWS                          |    5 +++++
 gperl-i11n-invoke-c.c         |    4 ++--
 gperl-i11n-marshal-callback.c |    2 +-
 4 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/GObjectIntrospection.xs b/GObjectIntrospection.xs
index 1a59acb..9e275b8 100644
--- a/GObjectIntrospection.xs
+++ b/GObjectIntrospection.xs
@@ -52,8 +52,8 @@ typedef struct {
        gboolean swap_data;
        SV *args_converter;
 
-       guint data_pos;
-       guint destroy_pos;
+       gint data_pos;
+       gint destroy_pos;
 
        gboolean free_after_use;
 
@@ -80,7 +80,7 @@ typedef struct {
 
 typedef struct {
        gsize length;
-       guint length_pos;
+       gint length_pos;
 } GPerlI11nArrayInfo;
 
 /* This stores information that the different marshallers might need to
diff --git a/NEWS b/NEWS
index 000f3b0..b2f6ce9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+Overview of changes in Glib::Object::Introspection <next>
+========================================================
+
+* Fix a few internal signed/unsigned integer mismatches.
+
 Overview of changes in Glib::Object::Introspection 0.019
 ========================================================
 
diff --git a/gperl-i11n-invoke-c.c b/gperl-i11n-invoke-c.c
index 342011c..19f6317 100644
--- a/gperl-i11n-invoke-c.c
+++ b/gperl-i11n-invoke-c.c
@@ -522,7 +522,7 @@ _handle_automatic_arg (guint pos,
        /* array length */
        for (l = invocation_info->array_infos; l != NULL; l = l->next) {
                GPerlI11nArrayInfo *ainfo = l->data;
-               if (pos == ainfo->length_pos) {
+               if (((gint) pos) == ainfo->length_pos) {
                        dwarn ("  setting automatic arg %d (array length) to %"G_GSIZE_FORMAT"\n",
                               pos, ainfo->length);
                        /* FIXME: Is it OK to always use v_size here? */
@@ -534,7 +534,7 @@ _handle_automatic_arg (guint pos,
        /* callback destroy notify */
        for (l = invocation_info->callback_infos; l != NULL; l = l->next) {
                GPerlI11nPerlCallbackInfo *cinfo = l->data;
-               if (pos == cinfo->destroy_pos) {
+               if (((gint) pos) == cinfo->destroy_pos) {
                        dwarn ("  setting automatic arg %d (destroy notify for calllback %p)\n",
                               pos, cinfo);
                        /* If the code pointer is NULL, then the user actually
diff --git a/gperl-i11n-marshal-callback.c b/gperl-i11n-marshal-callback.c
index ab05630..b313813 100644
--- a/gperl-i11n-marshal-callback.c
+++ b/gperl-i11n-marshal-callback.c
@@ -67,7 +67,7 @@ sv_to_callback_data (SV * sv,
                return NULL;
        for (l = invocation_info->callback_infos; l != NULL; l = l->next) {
                GPerlI11nPerlCallbackInfo *callback_info = l->data;
-               if (callback_info->data_pos == invocation_info->current_pos) {
+               if (callback_info->data_pos == ((gint) invocation_info->current_pos)) {
                        dwarn ("      user data for Perl callback %p\n",
                               callback_info);
                        attach_perl_callback_data (callback_info, sv);


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