From 6f04d1261b5e973d67dd8f4da9f86559281b67be Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 18 Apr 2011 23:52:00 -0700 Subject: [PATCH] Avoid 0 flag with %p printf format. --- src/ChangeLog | 5 +++-- src/print.c | 2 +- src/xselect.c | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7d63e76c30..1ed289b396 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -29,13 +29,14 @@ * print.c (safe_debug_print, print_object): Likewise. (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT to int. - Use pI instead of if-then-else-abort. Use %p to avoid casts. + Use pI instead of if-then-else-abort. Use %p to avoid casts, + avoiding the 0 flag, which is not portable. * process.c (Fmake_network_process): Use pI to avoid cast. * region-cache.c (pp_cache): Likewise. * xdisp.c (decode_mode_spec): Likewise. * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined behavior on 64-bit hosts with printf arg. - * xselect.c (x_queue_event): Use %p to avoid casts. + * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag. (x_stop_queuing_selection_requests): Likewise. (x_get_window_property): Don't truncate byte count to an 'int' when tracing. diff --git a/src/print.c b/src/print.c index d837a53381..2c9aa9dfd8 100644 --- a/src/print.c +++ b/src/print.c @@ -2004,7 +2004,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag case Lisp_Misc_Save_Value: strout ("#pointer, XSAVE_VALUE (obj)->integer); strout (buf, -1, -1, printcharfun); diff --git a/src/xselect.c b/src/xselect.c index 1141f2c6b6..db00649f24 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -169,7 +169,7 @@ x_queue_event (struct input_event *event) { if (!memcmp (&queue_tmp->event, event, sizeof (*event))) { - TRACE1 ("DECLINE DUP SELECTION EVENT %08p", queue_tmp); + TRACE1 ("DECLINE DUP SELECTION EVENT %p", queue_tmp); x_decline_selection_request (event); return; } @@ -180,7 +180,7 @@ x_queue_event (struct input_event *event) if (queue_tmp != NULL) { - TRACE1 ("QUEUE SELECTION EVENT %08p", queue_tmp); + TRACE1 ("QUEUE SELECTION EVENT %p", queue_tmp); queue_tmp->event = *event; queue_tmp->next = selection_queue; selection_queue = queue_tmp; @@ -213,7 +213,7 @@ x_stop_queuing_selection_requests (void) while (selection_queue != NULL) { struct selection_event_queue *queue_tmp = selection_queue; - TRACE1 ("RESTORE SELECTION EVENT %08p", queue_tmp); + TRACE1 ("RESTORE SELECTION EVENT %p", queue_tmp); kbd_buffer_unget_event (&queue_tmp->event); selection_queue = queue_tmp->next; xfree ((char *)queue_tmp); -- 2.39.2