Remove stale comments
[deliverable/binutils-gdb.git] / gdb / common / buffer.c
index 059dd6823b125420fec5cce996ebaac91e01f255..e9eee09c7dd914cc04b97be2cf9a8dcae4661ac3 100644 (file)
@@ -1,6 +1,6 @@
 /* A simple growing buffer for GDB.
   
-   Copyright (C) 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2009-2016 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
-
+#include "common-defs.h"
 #include "xml-utils.h"
 #include "buffer.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
+#include "inttypes.h"
 void
 buffer_grow (struct buffer *buffer, const char *data, size_t size)
 {
@@ -46,9 +37,7 @@ buffer_grow (struct buffer *buffer, const char *data, size_t size)
 
   while (buffer->used_size + size > new_buffer_size)
     new_buffer_size *= 2;
-  new_buffer = xrealloc (buffer->buffer, new_buffer_size);
-  if (!new_buffer)
-    abort ();
+  new_buffer = (char *) xrealloc (buffer->buffer, new_buffer_size);
   memcpy (new_buffer + buffer->used_size, data, size);
   buffer->buffer = new_buffer;
   buffer->buffer_size = new_buffer_size;
@@ -141,16 +130,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;
This page took 0.024243 seconds and 4 git commands to generate.