aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2006-10-16 14:20:38 +0000
committerJan Djärv2006-10-16 14:20:38 +0000
commitb43da35222d41421027d9e0918ee3315abf0fb71 (patch)
tree45f141181d666a5c4e423a598de58e578a0b20d9 /src
parentff07e0ac40be03f60ebf675e10eb38491c4f95b6 (diff)
downloademacs-b43da35222d41421027d9e0918ee3315abf0fb71.tar.gz
emacs-b43da35222d41421027d9e0918ee3315abf0fb71.zip
* gtkutil.c (get_utf8_string): Remove warnings with casts.
(xg_tool_bar_button_cb): Ditto (xg_tool_bar_callback): Ditto.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/gtkutil.c18
2 files changed, 16 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4c79b1cfaa7..ce3c7d1435b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12006-10-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * gtkutil.c (get_utf8_string): Remove warnings with casts.
4 (xg_tool_bar_button_cb): Ditto
5 (xg_tool_bar_callback): Ditto.
6
12006-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 72006-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 8
3 * dispnew.c (adjust_frame_glyphs_for_frame_redisplay): Remove unused 9 * dispnew.c (adjust_frame_glyphs_for_frame_redisplay): Remove unused
diff --git a/src/gtkutil.c b/src/gtkutil.c
index fb3c9447f84..07cc883fb83 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -523,8 +523,8 @@ get_utf8_string (str)
523 char *cp, *up; 523 char *cp, *up;
524 GError *error = NULL; 524 GError *error = NULL;
525 525
526 while (! (cp = g_locale_to_utf8 (p, -1, &bytes_read, 526 while (! (cp = g_locale_to_utf8 ((char *)p, -1, &bytes_read,
527 &bytes_written, &error)) 527 &bytes_written, &error))
528 && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE) 528 && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
529 { 529 {
530 ++nr_bad; 530 ++nr_bad;
@@ -541,13 +541,13 @@ get_utf8_string (str)
541 if (cp) g_free (cp); 541 if (cp) g_free (cp);
542 542
543 up = utf8_str = xmalloc (strlen (str) + nr_bad * 4 + 1); 543 up = utf8_str = xmalloc (strlen (str) + nr_bad * 4 + 1);
544 p = str; 544 p = (unsigned char *)str;
545 545
546 while (! (cp = g_locale_to_utf8 (p, -1, &bytes_read, 546 while (! (cp = g_locale_to_utf8 ((char *)p, -1, &bytes_read,
547 &bytes_written, &error)) 547 &bytes_written, &error))
548 && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE) 548 && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
549 { 549 {
550 strncpy (up, p, bytes_written); 550 strncpy (up, (char *)p, bytes_written);
551 sprintf (up + bytes_written, "\\%03o", p[bytes_written]); 551 sprintf (up + bytes_written, "\\%03o", p[bytes_written]);
552 up[bytes_written+4] = '\0'; 552 up[bytes_written+4] = '\0';
553 up += bytes_written+4; 553 up += bytes_written+4;
@@ -3362,8 +3362,9 @@ xg_tool_bar_button_cb (widget, event, user_data)
3362 GdkEventButton *event; 3362 GdkEventButton *event;
3363 gpointer user_data; 3363 gpointer user_data;
3364{ 3364{
3365 g_object_set_data (G_OBJECT (user_data), XG_TOOL_BAR_LAST_MODIFIER, 3365 /* Casts to avoid warnings when gpointer is 64 bits and int is 32 bits */
3366 (gpointer) event->state); 3366 gpointer ptr = (gpointer) (EMACS_INT) event->state;
3367 g_object_set_data (G_OBJECT (user_data), XG_TOOL_BAR_LAST_MODIFIER, ptr);
3367 return FALSE; 3368 return FALSE;
3368} 3369}
3369 3370
@@ -3375,7 +3376,8 @@ xg_tool_bar_callback (w, client_data)
3375{ 3376{
3376 /* The EMACS_INT cast avoids a warning. */ 3377 /* The EMACS_INT cast avoids a warning. */
3377 int idx = (int) (EMACS_INT) client_data; 3378 int idx = (int) (EMACS_INT) client_data;
3378 int mod = (int) g_object_get_data (G_OBJECT (w), XG_TOOL_BAR_LAST_MODIFIER); 3379 int mod = (int) (EMACS_INT) g_object_get_data (G_OBJECT (w),
3380 XG_TOOL_BAR_LAST_MODIFIER);
3379 3381
3380 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); 3382 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA);
3381 Lisp_Object key, frame; 3383 Lisp_Object key, frame;