On 10/11/2016 06:20 AM, Marc-André Lureau wrote: > On Mon, Oct 10, 2016 at 5:44 PM Eric Blake wrote: > >> Add pretty printing, where the format intentionally matches that of >> qobject_to_json() (a later patch will then rework qobject-json.c to >> work on top of the JSON visitor). The trickiest part is probably >> that the testsuite now has to honor parameterization on whether >> pretty printing is enabled. >> >> >> static void visitor_output_setup(TestOutputVisitorData *data, >> - const void *unused) >> + const void *arg) >> { >> - data->ov = json_output_visitor_new(&data->str); >> + bool pretty = *(bool *)arg; >> + >> > > Have you considered GPOINTER_TO_INT/GINT_TO_POINTER instead of pointers to > the stack frame? Casting integer values to void* and back requires a lot of typing to pacify all compilers (either explicit casts, or casts hidden inside the lengthy macro names from glib); and fails to work for 64-bit values when void* is only 32 bits. Dereferencing a stack pointer is a lot less thought and less typing, and works regardless of the integer size. > > either way, it's fine. > Good, I won't bother changing it. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org