summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2012-04-23 21:40:08 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2012-04-26 13:14:57 -0500
commitea7697fcd6edda2e0e54a02653e045003970bfbe (patch)
treeb1eb863ad3ec864f245b2ea4113d1cec8108abf8
parent94b262949416f37116ea6fe456f45405b583c8f7 (diff)
downloadhqemu-ea7697fcd6edda2e0e54a02653e045003970bfbe.zip
hqemu-ea7697fcd6edda2e0e54a02653e045003970bfbe.tar.gz
qtest: Fix more format errors with qtest_sendf
After adding GCC_FMT_ATTR to qtest_sendf, more format errors are reported by the compiler. These are fixed here. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--tests/libqtest.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 1ce6fa1..295c6d4 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -26,6 +26,7 @@
#include <unistd.h>
#include <string.h>
+#include "compiler.h"
#include "osdep.h"
#define MAX_IRQ 256
@@ -130,7 +131,7 @@ void qtest_quit(QTestState *s)
}
}
-static void qtest_sendf(QTestState *s, const char *fmt, ...)
+static void GCC_FMT_ATTR(2, 3) qtest_sendf(QTestState *s, const char *fmt, ...)
{
va_list ap;
gchar *str;
@@ -356,7 +357,7 @@ void qtest_memread(QTestState *s, uint64_t addr, void *data, size_t size)
gchar **args;
size_t i;
- qtest_sendf(s, "read 0x%" PRIx64 " 0x%x\n", addr, size);
+ qtest_sendf(s, "read 0x%" PRIx64 " 0x%zx\n", addr, size);
args = qtest_rsp(s, 2);
for (i = 0; i < size; i++) {
@@ -378,7 +379,7 @@ void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size)
const uint8_t *ptr = data;
size_t i;
- qtest_sendf(s, "write 0x%" PRIx64 " 0x%x 0x", addr, size);
+ qtest_sendf(s, "write 0x%" PRIx64 " 0x%zx 0x", addr, size);
for (i = 0; i < size; i++) {
qtest_sendf(s, "%02x", ptr[i]);
}
OpenPOWER on IntegriCloud