Fix a FIXME in mi-out.c
authorTom Tromey <tromey@adacore.com>
Tue, 2 Jul 2019 15:13:53 +0000 (09:13 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 15 Jul 2019 15:31:19 +0000 (09:31 -0600)
This removes a FIXME comment from mi_ui_out::do_field_int, by
replacing a printf with a use of plongest.

2019-07-15  Tom Tromey  <tromey@adacore.com>

* mi/mi-out.c (mi_ui_out::do_field_int): Use plongest.

gdb/ChangeLog
gdb/mi/mi-out.c

index 1b08595..bb2e8d1 100644 (file)
@@ -1,5 +1,9 @@
 2019-07-15  Tom Tromey  <tromey@adacore.com>
 
+       * mi/mi-out.c (mi_ui_out::do_field_int): Use plongest.
+
+2019-07-15  Tom Tromey  <tromey@adacore.com>
+
        * mi/mi-out.h (class mi_ui_out) <do_field_unsigned>: Declare.
        * mi/mi-out.c (mi_ui_out::do_field_unsigned): New method.
        * cli-out.h (class cli_ui_out) <do_field_unsigned>: Declare.
index dd99a2b..75e3f03 100644 (file)
@@ -98,10 +98,7 @@ void
 mi_ui_out::do_field_int (int fldno, int width, ui_align alignment,
                         const char *fldname, int value)
 {
-  char buffer[20];     /* FIXME: how many chars long a %d can become? */
-
-  xsnprintf (buffer, sizeof (buffer), "%d", value);
-  do_field_string (fldno, width, alignment, fldname, buffer,
+  do_field_string (fldno, width, alignment, fldname, plongest (value),
                   ui_out_style_kind::DEFAULT);
 }