gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Thu, 28 Jun 2012 17:07:34 +0000 (17:07 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Thu, 28 Jun 2012 17:07:34 +0000 (17:07 +0000)
* common/buffer.c: Include inttypes.h and stdint.h.
(buffer_xml_printf): Use PRId64, PRIu64, PRIx64 and PRIo64.

gdb/ChangeLog
gdb/common/buffer.c

index 17808621dd05e89e161e2e495e21ee82827f0686..4b20ff43628421277ce07cb060970d534d5588cf 100644 (file)
@@ -1,3 +1,8 @@
+2012-06-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * common/buffer.c: Include inttypes.h and stdint.h.
+       (buffer_xml_printf): Use PRId64, PRIu64, PRIx64 and PRIo64.
+
 2012-06-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
            Pedro Alves  <palves@redhat.com>
 
index 810173ba4c71fdd5284fd92ffee521b9a1666709..2f63eecaebce84f455e558f45773d75a133c53ec 100644 (file)
 
 #include "xml-utils.h"
 #include "buffer.h"
+#include "inttypes.h"
 
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
+#include <stdint.h>
 
 void
 buffer_grow (struct buffer *buffer, const char *data, size_t size)
@@ -139,16 +141,20 @@ buffer_xml_printf (struct buffer *buffer, const char *format, ...)
                  switch (*f)
                    {
                    case 'd':
-                     sprintf (str, "%lld", va_arg (ap, long long));
+                     sprintf (str, "%" PRId64,
+                              (int64_t) va_arg (ap, long long));
                      break;
                    case 'u':
-                     sprintf (str, "%llu", va_arg (ap, unsigned long long));
+                     sprintf (str, "%" PRIu64,
+                              (uint64_t) va_arg (ap, unsigned long long));
                      break;
                    case 'x':
-                     sprintf (str, "%llx", va_arg (ap, unsigned long long));
+                     sprintf (str, "%" PRIx64,
+                              (uint64_t) va_arg (ap, unsigned long long));
                      break;
                    case 'o':
-                     sprintf (str, "%llo", va_arg (ap, unsigned long long));
+                     sprintf (str, "%" PRIo64,
+                              (uint64_t) va_arg (ap, unsigned long long));
                      break;
                    default:
                      str = 0;