Avoid 0 flag with %p printf format.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Apr 2011 06:52:00 +0000 (23:52 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Apr 2011 06:52:00 +0000 (23:52 -0700)
src/ChangeLog
src/print.c
src/xselect.c

index 7d63e76..1ed289b 100644 (file)
        * 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.
index d837a53..2c9aa9d 100644 (file)
@@ -2004,7 +2004,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
 
        case Lisp_Misc_Save_Value:
          strout ("#<save_value ", -1, -1, printcharfun);
-         sprintf(buf, "ptr=%08p int=%d",
+         sprintf(buf, "ptr=%p int=%d",
                  XSAVE_VALUE (obj)->pointer,
                  XSAVE_VALUE (obj)->integer);
          strout (buf, -1, -1, printcharfun);
index 1141f2c..db00649 100644 (file)
@@ -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);