Fix compile warnings.
authorPeng Huang <phuang@phuang.nay.redhat.com>
Tue, 10 Feb 2009 09:30:27 +0000 (17:30 +0800)
committerPeng Huang <phuang@phuang.nay.redhat.com>
Tue, 10 Feb 2009 09:30:27 +0000 (17:30 +0800)
bus/engineproxy.c
bus/inputcontext.c
client/gtk2/ibusimcontext.c
client/x11/main.c
src/ibushotkey.c

index aabcc8a..6fc111f 100644 (file)
@@ -556,11 +556,11 @@ bus_engine_proxy_process_key_event_reply_cb (IBusPendingCall *pending,
         g_warning ("%s: %s", error->name, error->message);
         ibus_message_unref (reply_message);
         ibus_error_free (error);
-        call_data->func(FALSE, call_data->user_data);
+        call_data->func (GINT_TO_POINTER (FALSE), call_data->user_data);
         return;
     }
 
-    call_data->func((gpointer *)retval, call_data->user_data);
+    call_data->func (GINT_TO_POINTER (retval), call_data->user_data);
     g_slice_free (CallData, call_data);
 }
 
@@ -590,7 +590,7 @@ bus_engine_proxy_process_key_event (BusEngineProxy *engine,
     if (!retval) {
         g_warning ("%s: %s", error->name, error->message);
         ibus_error_free (error);
-        return_cb (FALSE, user_data);
+        return_cb (GINT_TO_POINTER (FALSE), user_data);
         return;
     }
 
@@ -606,7 +606,7 @@ bus_engine_proxy_process_key_event (BusEngineProxy *engine,
 
     if (!retval) {
         g_warning ("%s : ProcessKeyEvent", DBUS_ERROR_NO_MEMORY);
-        return_cb (FALSE, user_data);
+        return_cb (GINT_TO_POINTER (FALSE), user_data);
         return;
     }
 }
index a4e3359..c512e82 100644 (file)
@@ -550,16 +550,22 @@ _ibus_introspect (BusInputContext   *context,
 typedef struct {
     BusInputContext *context;
     IBusMessage     *message;
-}CallData;
+} CallData;
 
 static void
-_ic_process_key_event_reply_cb (gboolean  retval,
-                                CallData *call_data)
+_ic_process_key_event_reply_cb (gpointer data,
+                                gpointer user_data)
 {
+    gboolean retval;
+    CallData *call_data;
+
     IBusMessage *reply;
     BusInputContextPrivate *priv;
     priv = BUS_INPUT_CONTEXT_GET_PRIVATE (call_data->context);
 
+    retval = (gboolean) GPOINTER_TO_INT (data);
+    call_data = (CallData *) user_data;
+
     reply = ibus_message_new_method_return (call_data->message);
     ibus_message_append_args (reply,
                               G_TYPE_BOOLEAN, &retval,
index 640d0ea..f622de1 100644 (file)
@@ -292,7 +292,7 @@ ibus_im_context_finalize (GObject *obj)
     g_signal_handlers_disconnect_by_func (_bus, G_CALLBACK (_bus_connected_cb), obj);
 
     if (priv->ibus_context) {
-        ibus_object_destroy (priv->ibus_context);
+        ibus_object_destroy ((IBusObject *)priv->ibus_context);
     }
 
     g_object_unref (priv->slave);
index db29eab..5ef9f30 100644 (file)
@@ -327,7 +327,7 @@ xim_create_ic (XIMS xims, IMChangeICStruct *call_data)
     x11ic->icid = call_data->icid;
     x11ic->connect_id = call_data->connect_id;
     x11ic->conn = (X11ICONN *)g_hash_table_lookup (_connections,
-                        (gconstpointer)(unsigned long)call_data->connect_id);
+                                                   GINT_TO_POINTER (call_data->connect_id));
     if (x11ic->conn == NULL) {
         g_slice_free (X11IC, x11ic);
         g_return_val_if_reached (0);
@@ -367,9 +367,9 @@ xim_create_ic (XIMS xims, IMChangeICStruct *call_data)
     }
 
     g_hash_table_insert (_x11_ic_table,
-                                (gpointer)x11ic->icid, (gpointer)x11ic);
+                         GINT_TO_POINTER (x11ic->icid), (gpointer)x11ic);
     x11ic->conn->clients = g_list_append (x11ic->conn->clients,
-                                (gpointer)x11ic);
+                         (gpointer)x11ic);
     return 1;
 }
 
@@ -383,7 +383,7 @@ xim_destroy_ic (XIMS xims, IMChangeICStruct *call_data)
                 call_data->icid, call_data->connect_id);
 
     x11ic = (X11IC *)g_hash_table_lookup (_x11_ic_table,
-                (gconstpointer)(unsigned long)call_data->icid);
+                                          GINT_TO_POINTER (call_data->icid));
     g_return_val_if_fail (x11ic != NULL, 0);
 
     if (x11ic->context) {
@@ -393,7 +393,7 @@ xim_destroy_ic (XIMS xims, IMChangeICStruct *call_data)
     }
 
     g_hash_table_remove (_x11_ic_table,
-                (gconstpointer)(unsigned long)call_data->icid);
+                         GINT_TO_POINTER (call_data->icid));
     x11ic->conn->clients = g_list_remove (x11ic->conn->clients, (gconstpointer)x11ic);
 
     g_free (x11ic->preedit_string);
@@ -417,8 +417,8 @@ xim_set_ic_focus (XIMS xims, IMChangeFocusStruct *call_data)
     LOG (1, "XIM_SET_IC_FOCUS ic=%d connect_id=%d",
                 call_data->icid, call_data->connect_id);
 
-    x11ic = (X11IC *)g_hash_table_lookup (_x11_ic_table,
-                (gconstpointer)(unsigned long)call_data->icid);
+    x11ic = (X11IC *) g_hash_table_lookup (_x11_ic_table,
+                                           GINT_TO_POINTER (call_data->icid));
     g_return_val_if_fail (x11ic != NULL, 0);
 
     ibus_input_context_focus_in (x11ic->context);
@@ -435,8 +435,8 @@ xim_unset_ic_focus (XIMS xims, IMChangeFocusStruct *call_data)
     LOG (1, "XIM_UNSET_IC_FOCUS ic=%d connect_id=%d",
                 call_data->icid, call_data->connect_id);
 
-    x11ic = (X11IC *)g_hash_table_lookup (_x11_ic_table,
-            (gconstpointer)(unsigned long)call_data->icid);
+    x11ic = (X11IC *) g_hash_table_lookup (_x11_ic_table,
+                                           GINT_TO_POINTER (call_data->icid));
     g_return_val_if_fail (x11ic != NULL, 0);
 
     ibus_input_context_focus_out (x11ic->context);
@@ -455,8 +455,8 @@ xim_forward_event (XIMS xims, IMForwardEventStruct *call_data)
     LOG (1, "XIM_FORWARD_EVENT ic=%d connect_id=%d",
                 call_data->icid, call_data->connect_id);
 
-    x11ic = (X11IC *)g_hash_table_lookup (_x11_ic_table,
-                (gconstpointer)(unsigned long)call_data->icid);
+    x11ic = (X11IC *) g_hash_table_lookup (_x11_ic_table,
+                                           GINT_TO_POINTER (call_data->icid));
     g_return_val_if_fail (x11ic != NULL, 0);
 
     xevent = (XKeyEvent*) &(call_data->event);
@@ -503,8 +503,8 @@ xim_open (XIMS xims, IMOpenStruct *call_data)
     LOG (1, "XIM_OPEN connect_id=%d",
                 call_data->connect_id);
 
-    conn = (X11ICONN *)g_hash_table_lookup (_connections,
-                (gconstpointer)(unsigned long)call_data->connect_id);
+    conn = (X11ICONN *) g_hash_table_lookup (_connections,
+                                             GINT_TO_POINTER (call_data->connect_id));
     g_return_val_if_fail (conn == NULL, 0);
 
     conn = g_slice_new0 (X11ICONN);
@@ -538,7 +538,7 @@ _free_ic (gpointer data, gpointer user_data)
 
     /* Remove the IC from g_client dictionary */
     g_hash_table_remove (_x11_ic_table,
-                (gconstpointer)(unsigned long)x11ic->icid);
+                         GINT_TO_POINTER (x11ic->icid));
 
     g_slice_free (X11IC, x11ic);
 }
@@ -551,8 +551,8 @@ xim_close (XIMS ims, IMCloseStruct *call_data)
     LOG (1, "XIM_CLOSE connect_id=%d",
                 call_data->connect_id);
 
-    conn = (X11ICONN *)g_hash_table_lookup (_connections,
-                (gconstpointer)(unsigned long)call_data->connect_id);
+    conn = (X11ICONN *) g_hash_table_lookup (_connections,
+                                             GINT_TO_POINTER (call_data->connect_id));
     g_return_val_if_fail (conn != NULL, 0);
 
     g_list_foreach (conn->clients, _free_ic, NULL);
@@ -560,7 +560,7 @@ xim_close (XIMS ims, IMCloseStruct *call_data)
     g_list_free (conn->clients);
 
     g_hash_table_remove (_connections,
-            (gconstpointer)(unsigned long)call_data->connect_id);
+                         GINT_TO_POINTER (call_data->connect_id));
 
     g_slice_free (X11ICONN, conn);
 
@@ -620,8 +620,8 @@ xim_set_ic_values (XIMS xims, IMChangeICStruct *call_data)
     LOG (1, "XIM_SET_IC_VALUES ic=%d connect_id=%d",
                 call_data->icid, call_data->connect_id);
 
-    x11ic = (X11IC *)g_hash_table_lookup (_x11_ic_table,
-                (gconstpointer)(unsigned long)call_data->icid);
+    x11ic = (X11IC *) g_hash_table_lookup (_x11_ic_table,
+                                           GINT_TO_POINTER (call_data->icid));
     g_return_val_if_fail (x11ic != NULL, 0);
 
     i = _xim_store_ic_values (x11ic, call_data);
@@ -642,8 +642,8 @@ xim_get_ic_values (XIMS xims, IMChangeICStruct *call_data)
     LOG (1, "XIM_GET_IC_VALUES ic=%d connect_id=%d",
                 call_data->icid, call_data->connect_id);
 
-    x11ic = (X11IC *)g_hash_table_lookup (_x11_ic_table,
-                (gconstpointer)(unsigned long)call_data->icid);
+    x11ic = (X11IC *) g_hash_table_lookup (_x11_ic_table,
+                                           GINT_TO_POINTER (call_data->icid));
     g_return_val_if_fail (x11ic != NULL, 0);
 
     XICAttribute *ic_attr = call_data->ic_attr;
@@ -669,8 +669,8 @@ xim_reset_ic (XIMS xims, IMResetICStruct *call_data)
     LOG (1, "XIM_RESET_IC ic=%d connect_id=%d",
                 call_data->icid, call_data->connect_id);
 
-    x11ic = (X11IC *)g_hash_table_lookup (_x11_ic_table,
-                (gconstpointer)(unsigned long)call_data->icid);
+    x11ic = (X11IC *) g_hash_table_lookup (_x11_ic_table,
+                                           GINT_TO_POINTER (call_data->icid));
     g_return_val_if_fail (x11ic != NULL, 0);
 
     ibus_input_context_reset (x11ic->context);
index 16aad70..eca7666 100644 (file)
@@ -344,7 +344,7 @@ ibus_hotkey_profile_add_hotkey (IBusHotkeyProfile *profile,
         g_return_val_if_reached (FALSE);
     }
 
-    g_tree_insert (priv->hotkeys, hotkey, (gpointer)event);
+    g_tree_insert (priv->hotkeys, (gpointer) hotkey, GUINT_TO_POINTER (event));
 
     gint i;
     IBusHotkeyEvent *p = NULL;
@@ -469,7 +469,7 @@ ibus_hotkey_profile_filter_key_event (IBusHotkeyProfile *profile,
         modifiers : modifiers & priv->mask,
     };
 
-    GQuark event = (GQuark) g_tree_lookup (priv->hotkeys, &hotkey);
+    GQuark event = (GQuark) GPOINTER_TO_UINT (g_tree_lookup (priv->hotkeys, &hotkey));
 
     if (event != 0) {
         g_signal_emit (profile, profile_signals[TRIGGER], event, event, user_data);