[java-atk-wrapper] JNI: fix jawimpl type error



commit 52180106585550b1fc549bb75f90efa8933fa518
Author: Magdalen Berns <m berns thismagpie com>
Date:   Sat May 30 01:50:54 2015 +0100

    JNI: fix jawimpl type error
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=750128

 jni/src/jawimpl.c |   16 ++++++++++++++--
 jni/src/jawimpl.h |    1 +
 2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/jni/src/jawimpl.c b/jni/src/jawimpl.c
index 6d7ee5f..db92970 100644
--- a/jni/src/jawimpl.c
+++ b/jni/src/jawimpl.c
@@ -28,6 +28,14 @@
 #include "jawtoplevel.h"
 #include "jawobject.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef GTYPE_TO_POINTER
+  #define GTYPE_TO_POINTER (x) (GSIZE_TO_POINTER (x))
+#endif
+
 static void jaw_impl_class_init (JawImplClass *klass);
 //static void                  jaw_impl_init                           (JawImpl                *impl);
 static void jaw_impl_dispose(GObject *gobject);
@@ -384,7 +392,7 @@ jaw_impl_get_type (guint tflag)
     typeTable = g_hash_table_new( NULL, NULL );
   }
 
-  type = (GType)g_hash_table_lookup(typeTable, (gpointer)&tflag);
+  type = (GType)g_hash_table_lookup(typeTable, GINT_TO_POINTER(tflag));
   if (type == 0) {
     GTypeInfo tinfo = {
       sizeof(JawImplClass),
@@ -431,7 +439,7 @@ jaw_impl_get_type (guint tflag)
     if (tflag & INTERFACE_TABLE)
       g_type_add_interface_static (type, ATK_TYPE_TABLE, &atk_table_info);
 
-    g_hash_table_insert(typeTable, (gpointer)&tflag, (gpointer)type);
+    g_hash_table_insert(typeTable, GINT_TO_POINTER(tflag), (gpointer)type);
   }
 
   return type;
@@ -774,3 +782,7 @@ jaw_impl_ref_relation_set (AtkObject *atk_obj)
   return atk_obj->relation_set;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/jni/src/jawimpl.h b/jni/src/jawimpl.h
index d904535..dbca582 100644
--- a/jni/src/jawimpl.h
+++ b/jni/src/jawimpl.h
@@ -20,6 +20,7 @@
 #ifndef _JAW_IMPL_H_
 #define _JAW_IMPL_H_
 
+#include <glib-object.h>
 #include "jawobject.h"
 
 G_BEGIN_DECLS


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