diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-06-28 17:07:34 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-06-28 17:07:34 +0000 |
commit | da2d6d3da4803d5b9cea064d11e3e4b5361d5236 (patch) | |
tree | 394800755d3497148feffe869d436c1d38e50b26 /gdb | |
parent | 6034aab8a1f9f470398ca1f99ccc0811ece2087e (diff) | |
download | gdb-da2d6d3da4803d5b9cea064d11e3e4b5361d5236.zip gdb-da2d6d3da4803d5b9cea064d11e3e4b5361d5236.tar.gz gdb-da2d6d3da4803d5b9cea064d11e3e4b5361d5236.tar.bz2 |
gdb/
* common/buffer.c: Include inttypes.h and stdint.h.
(buffer_xml_printf): Use PRId64, PRIu64, PRIx64 and PRIo64.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/common/buffer.c | 14 |
2 files changed, 15 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1780862..4b20ff4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,4 +1,9 @@ 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> * gdbthread.h (ALL_THREADS): New macro. diff --git a/gdb/common/buffer.c b/gdb/common/buffer.c index 810173b..2f63eec 100644 --- a/gdb/common/buffer.c +++ b/gdb/common/buffer.c @@ -25,10 +25,12 @@ #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; |