comparison src/gtkutil.c @ 90645:7eeafaaa9eab

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 476-489) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 153-160) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-127
author Miles Bader <miles@gnu.org>
date Mon, 30 Oct 2006 08:54:41 +0000
parents bb0e318b7c53 7b5c0104efb0
children 02cf29720f31
comparison
equal deleted inserted replaced
90644:9b62e05dedf6 90645:7eeafaaa9eab
521 gsize bytes_written; 521 gsize bytes_written;
522 unsigned char *p = (unsigned char *)str; 522 unsigned char *p = (unsigned char *)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;
531 p += bytes_written+1; 531 p += bytes_written+1;
532 g_error_free (error); 532 g_error_free (error);
539 error = NULL; 539 error = NULL;
540 } 540 }
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;
554 p += bytes_written+1; 554 p += bytes_written+1;
555 g_error_free (error); 555 g_error_free (error);
3360 xg_tool_bar_button_cb (widget, event, user_data) 3360 xg_tool_bar_button_cb (widget, event, user_data)
3361 GtkWidget *widget; 3361 GtkWidget *widget;
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
3370 3371
3371 static void 3372 static void
3373 GtkWidget *w; 3374 GtkWidget *w;
3374 gpointer client_data; 3375 gpointer 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;
3382 struct input_event event; 3384 struct input_event event;
3383 EVENT_INIT (event); 3385 EVENT_INIT (event);