From 67263b33af9506d78558b1edfa5a9bf976dc7b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sat, 22 Aug 2020 20:09:49 +0200 Subject: util/hexdump: Convert to take a void pointer argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Most uses of qemu_hexdump() do not take an array of char as input, forcing use of cast. Since we can use this helper to dump any kind of buffer, use a pointer to void argument instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Edgar E. Iglesias Reviewed-by: Li Qiang Reviewed-by: Stefano Garzarella Message-Id: <20200822180950.1343963-2-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- hw/usb/redirect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/usb') diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 417a60a2e6..09edb0d81c 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -240,7 +240,7 @@ static void usbredir_log_data(USBRedirDevice *dev, const char *desc, if (dev->debug < usbredirparser_debug_data) { return; } - qemu_hexdump((char *)data, stderr, desc, len); + qemu_hexdump(data, stderr, desc, len); } /* -- cgit v1.2.3 From b42581f5bb40489cb172829e9ab0d6d6dfa37026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sat, 22 Aug 2020 20:09:50 +0200 Subject: util/hexdump: Reorder qemu_hexdump() arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qemu_hexdump()'s pointer to the buffer and length of the buffer are closely related arguments but are widely separated in the argument list order (also, the format of function prototypes is usually to have the FILE* argument coming first). Reorder the arguments as "fp, prefix, buf, size" which is more logical. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Reviewed-by: Stefano Garzarella Message-Id: <20200822180950.1343963-3-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- hw/usb/redirect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/usb') diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 09edb0d81c..48f38d3391 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -240,7 +240,7 @@ static void usbredir_log_data(USBRedirDevice *dev, const char *desc, if (dev->debug < usbredirparser_debug_data) { return; } - qemu_hexdump(data, stderr, desc, len); + qemu_hexdump(stderr, desc, data, len); } /* -- cgit v1.2.3