[gok] Fix compile warnings on x64 platforms - bgo#595680



commit b835c35c3954e696b1c626cf08eb908812407dab
Author: Gerd Kohlberger <gerdk src gnome org>
Date:   Sat Sep 26 15:03:19 2009 +0200

    Fix compile warnings on x64 platforms - bgo#595680

 gok/create-branching-keyboard.c |    6 +++---
 gok/gok-output.c                |   12 ++++++------
 gok/gok-utf8-word-complete.c    |   11 +++++------
 3 files changed, 14 insertions(+), 15 deletions(-)
---
diff --git a/gok/create-branching-keyboard.c b/gok/create-branching-keyboard.c
index c4031f5..ea343eb 100644
--- a/gok/create-branching-keyboard.c
+++ b/gok/create-branching-keyboard.c
@@ -36,7 +36,7 @@ gint
 read_branch_count (GIOChannel *infile)
 {
     gchar *line;
-    guint len;
+    gsize len;
     gint count = 0;
     GIOStatus status;
 
@@ -69,7 +69,7 @@ kbd_file_create (gchar *name, gint maxcols)
     kbd->maxcol = maxcols;
     utf8name = g_strconcat (name, ".kbd", NULL);
     fname = g_filename_from_utf8 (utf8name, -1, &stored, &bytz, NULL);
-    g_message ("[%d] creating %s", stored, fname);
+    g_message ("[%" G_GSIZE_FORMAT "] creating %s", stored, fname);
     kbd->io = g_io_channel_new_file (fname, "w", NULL);
     buf = g_strconcat ("<?xml version=\"1.0\"?>\n",
 		       "<GOK:GokFile xmlns:GOK=\"http://www.gnome.org/GOK\";>\n\n",
@@ -145,7 +145,7 @@ static void
 create_kbd_from_file (GIOChannel *infile, gchar *kbd_name, gint columns)
 {
     gchar *line;
-    guint len;
+    gsize len;
     GError *error = NULL;
     GIOStatus status;
     KbdFile *branch_kbd = kbd_file_create (kbd_name, columns);
diff --git a/gok/gok-output.c b/gok/gok-output.c
index b2ff106..6aa3c56 100644
--- a/gok/gok-output.c
+++ b/gok/gok-output.c
@@ -69,7 +69,7 @@ gok_output_update_predictions (GokOutput    *output,
 		case OUTPUT_KEYCODE:
 		case OUTPUT_KEYSYM:
 			prediction_list = gok_wordcomplete_process_and_predict (complete,
-										(gunichar) data,
+										GPOINTER_TO_UINT (data),
 										gok_data_get_num_predictions ());
 			part = gok_wordcomplete_get_word_part (complete);
 			if (gok_wordcomplete_validate_word (complete, part)) { 
@@ -364,13 +364,13 @@ void gok_output_send_to_system (GokOutput* pOutput, gboolean bWordCompletion)
 				if (last_dead_key && unichar) {
 					gchar *s;
 					s = gok_wordcomplete_process_unichar (gok_wordcomplete_get_default (), unichar);
-					gok_output_update_predictions (pOutput, 
-								       (gpointer) gok_output_unichar_postfix_from_deadkey (last_dead_key));
+					gok_output_update_predictions (pOutput,
+								       GUINT_TO_POINTER (gok_output_unichar_postfix_from_deadkey (last_dead_key)));
 					last_dead_key = 0;
 				}
 				else if (unichar) {
 					gok_output_update_predictions (pOutput, 
-								       (gpointer) unichar);
+								       GUINT_TO_POINTER (unichar));
 				}
 			}
 		}
@@ -408,12 +408,12 @@ void gok_output_send_to_system (GokOutput* pOutput, gboolean bWordCompletion)
 					gchar *s;
 					s = gok_wordcomplete_process_unichar (gok_wordcomplete_get_default (), unichar);
 					gok_output_update_predictions (pOutput, 
-								       (gpointer) gok_output_unichar_postfix_from_deadkey (last_dead_key));
+								       GUINT_TO_POINTER (gok_output_unichar_postfix_from_deadkey (last_dead_key)));
 					last_dead_key = 0;
 				}
 				else if (unichar) {
 					gok_output_update_predictions (pOutput, 
-								       (gpointer) unichar);
+								       GUINT_TO_POINTER (unichar));
 				}
 			}
 		}
diff --git a/gok/gok-utf8-word-complete.c b/gok/gok-utf8-word-complete.c
index 3a0ceaf..f2efc8d 100644
--- a/gok/gok-utf8-word-complete.c
+++ b/gok/gok-utf8-word-complete.c
@@ -233,7 +233,7 @@ utf8_wordcomplete_predict_string (GokWordComplete *complete, const gchar* word,
 		GList *start, *end;
 		gunichar unicode_char = g_utf8_get_char (word);
 		if (utf8_complete->unicode_start_hash)
-			start = g_hash_table_lookup (utf8_complete->unicode_start_hash, (gpointer) unicode_char);
+			start = g_hash_table_lookup (utf8_complete->unicode_start_hash, GUINT_TO_POINTER (unicode_char));
 		if (start)
 		{
 			utf8_complete->start_search = start;
@@ -241,14 +241,13 @@ utf8_wordcomplete_predict_string (GokWordComplete *complete, const gchar* word,
 		else
 			utf8_complete->start_search = utf8_complete->word_list;
 		if (utf8_complete->unicode_end_hash)
-			end = g_hash_table_lookup (utf8_complete->unicode_end_hash, (gpointer) unicode_char);
+			end = g_hash_table_lookup (utf8_complete->unicode_end_hash, GUINT_TO_POINTER (unicode_char));
 		if (end)
 		{
 			utf8_complete->end_search = end;
 		}
 		else
 			utf8_complete->end_search = utf8_complete->word_list_end;
-;
 	}
 
 	word_predict_list = g_new0 (gchar *, num_predictions + 1); /* NULL-terminated */
@@ -710,13 +709,13 @@ utf8_wordcomplete_create_unicode_hash (GokUTF8WordComplete *complete)
 		{
 			/* search for previous entry, just in case locale's collation 
 			   sequence puts things in an 'unusual' order */
-			if (!g_hash_table_lookup (complete->unicode_start_hash, (gpointer) unicode_char)) 
+			if (!g_hash_table_lookup (complete->unicode_start_hash, GUINT_TO_POINTER (unicode_char)))
 			{
-				g_hash_table_insert (complete->unicode_start_hash, (gpointer) unicode_char, next);
+				g_hash_table_insert (complete->unicode_start_hash, GUINT_TO_POINTER (unicode_char), next);
 			}
 			if (prev_char)
 			{
-				g_hash_table_insert (complete->unicode_end_hash, (gpointer) prev_char, next);
+				g_hash_table_insert (complete->unicode_end_hash, GUINT_TO_POINTER (prev_char), next);
 			}
 			prev_char = unicode_char;
 		}



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