qemu/qapi
Michael Roth 173bbb754f qapi: String visitor, use %f representation for floats
Currently string-output-visitor formats floats as %g, which is nice in
that trailing 0's are automatically truncated, but otherwise this causes
some issues:

 - it uses 6 significant figures instead of 6 decimal places, which
   means something like 155777.5 (which even has an exact floating point
   representation) will be rounded to 155778 when converted to a string.

 - output will be presented in scientific notation when the normalized
   form requires a 10^x multiplier. Not a huge deal, but arguably less
   readable for command-line arguments.

 - due to using scientific notation for numbers requiring more than 6
   significant figures, instead of hard-defined decimal places, it
   fails a lot of the test-visitor-serialization unit tests for floats.

Instead, let's just use %f, which is what the QJSON and the QMP visitors
use.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-06-08 16:11:14 +02:00
..
Makefile.objs build: move qapi/ objects to nested Makefile.objs 2012-06-07 09:21:15 +02:00
qapi-dealloc-visitor.c qapi: dealloc visitor, support freeing of nested lists 2011-10-04 11:00:46 -03:00
qapi-dealloc-visitor.h qapi: add QAPI dealloc visitor 2011-07-21 16:48:13 -03:00
qapi-types-core.h qapi: add code generation support for middle mode 2011-10-04 11:00:46 -03:00
qapi-visit-core.c qapi: Add Visitor interfaces for uint*_t and int*_t 2012-06-08 16:11:14 +02:00
qapi-visit-core.h qapi: Add Visitor interfaces for uint*_t and int*_t 2012-06-08 16:11:14 +02:00
qapi-visit-impl.h qapi: allow sharing enum implementation across visitors 2012-02-21 10:21:05 +01:00
qmp-core.h qapi: add support for command options 2012-05-15 09:15:16 -05:00
qmp-dispatch.c qapi: add support for command options 2012-05-15 09:15:16 -05:00
qmp-input-visitor.c qapi: QMP input visitor, handle floats parsed as ints 2012-05-14 10:08:39 -03:00
qmp-input-visitor.h qapi: add strict mode to input visitor 2012-03-27 09:15:13 -03:00
qmp-output-visitor.c qapi: fix double free in qmp_output_visitor_cleanup() 2012-03-27 09:11:00 -03:00
qmp-output-visitor.h qapi: add QMP output visitor 2011-07-21 16:48:13 -03:00
qmp-registry.c qapi: add support for command options 2012-05-15 09:15:16 -05:00
string-input-visitor.c qapi: add string-based visitors 2012-02-21 10:21:05 +01:00
string-input-visitor.h qapi: add string-based visitors 2012-02-21 10:21:05 +01:00
string-output-visitor.c qapi: String visitor, use %f representation for floats 2012-06-08 16:11:14 +02:00
string-output-visitor.h qapi: add string-based visitors 2012-02-21 10:21:05 +01:00