From 1c884abeded1fee3680a3f1db655bf70d3b49e97 Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Wed, 12 Feb 2014 17:14:33 +0000 Subject: include/qemu/host-utils.h: Trivial typo: ctz->cto Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Michael Tokarev --- include/qemu/host-utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h index de85d282d0..285c5fbab8 100644 --- a/include/qemu/host-utils.h +++ b/include/qemu/host-utils.h @@ -217,7 +217,7 @@ static inline int ctz64(uint64_t val) } /** - * ctz64 - count trailing ones in a 64-bit value. + * cto64 - count trailing ones in a 64-bit value. * @val: The value to search * * Returns 64 if the value is -1. -- cgit v1.2.3 From 0064aceb29faea018dfb7cf0bca5d9644272a295 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 19 Feb 2014 06:11:44 +0100 Subject: bswap: Modify prototype of stb_p (avoid type conversions) The function uses an uint8_t value, so show this in the function prototype. Non-optimizing compilers will avoid unnecessary type conversions from (u)int8_t to int and back to uint8_t when generating calls of this inline function. stw_p, stl_p and stq_p already use similar prototypes. Signed-off-by: Stefan Weil Reviewed-by: Laszlo Ersek Signed-off-by: Michael Tokarev --- include/qemu/bswap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 437b8e0a9e..0cc11a5e79 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -228,7 +228,7 @@ static inline int ldsb_p(const void *ptr) return *(int8_t *)ptr; } -static inline void stb_p(void *ptr, int v) +static inline void stb_p(void *ptr, uint8_t v) { *(uint8_t *)ptr = v; } -- cgit v1.2.3 From 55e7c29e46f845f503fda3e8cac3f5e0e8b3d984 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 19 Feb 2014 06:11:45 +0100 Subject: bswap: Modify prototypes of st[wl]_{le, be}_p (avoid type conversions) The functions use uint16_t or uint32_t values, so show this in the function prototypes. Non-optimizing compilers will avoid unnecessary type conversions when generating calls of these inline functions. stq_le_p, stq_be_p already use similar prototypes. Signed-off-by: Stefan Weil Reviewed-by: Laszlo Ersek Signed-off-by: Michael Tokarev --- include/qemu/bswap.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 0cc11a5e79..0cb7c05554 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -300,12 +300,12 @@ static inline uint64_t ldq_le_p(const void *ptr) return le_bswap(ldq_p(ptr), 64); } -static inline void stw_le_p(void *ptr, int v) +static inline void stw_le_p(void *ptr, uint16_t v) { stw_p(ptr, le_bswap(v, 16)); } -static inline void stl_le_p(void *ptr, int v) +static inline void stl_le_p(void *ptr, uint32_t v) { stl_p(ptr, le_bswap(v, 32)); } @@ -365,12 +365,12 @@ static inline uint64_t ldq_be_p(const void *ptr) return be_bswap(ldq_p(ptr), 64); } -static inline void stw_be_p(void *ptr, int v) +static inline void stw_be_p(void *ptr, uint16_t v) { stw_p(ptr, be_bswap(v, 16)); } -static inline void stl_be_p(void *ptr, int v) +static inline void stl_be_p(void *ptr, uint32_t v) { stl_p(ptr, be_bswap(v, 32)); } -- cgit v1.2.3 From aa830cdc28edb69c1fe81c8fd9471ab288ad0926 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Wed, 26 Feb 2014 23:51:46 +0000 Subject: qjson.h: Remove spurious GCC_FMT_ATTR markup from qobject_from_json() declaration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function qobject_from_json() doesn't actually allow its argument to be a format string -- it passes a NULL va_list* to qobject_from_jsonv(), and the parser code will then never actually interpret %-escape sequences (it tests whether the va_list pointer is NULL and will stop with a parse error). The spurious attribute markup causes clang warnings in some of the test cases where we programmatically construct JSON to feed to qobject_from_json(): tests/test-qmp-input-visitor.c:76:35: warning: format string is not a string literal (potentially insecure) [-Wformat-security] data->obj = qobject_from_json(json_string); ^~~~~~~~~~~ Remove the incorrect attribute. Signed-off-by: Peter Maydell Suggested-by: Paolo Bonzini Reviewed-by: Eric Blake Reviewed-by: Andreas Färber Signed-off-by: Michael Tokarev --- include/qapi/qmp/qjson.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/qapi/qmp/qjson.h b/include/qapi/qmp/qjson.h index 73351ed6d6..ee4d31a46a 100644 --- a/include/qapi/qmp/qjson.h +++ b/include/qapi/qmp/qjson.h @@ -19,7 +19,7 @@ #include "qapi/qmp/qobject.h" #include "qapi/qmp/qstring.h" -QObject *qobject_from_json(const char *string) GCC_FMT_ATTR(1, 0); +QObject *qobject_from_json(const char *string); QObject *qobject_from_jsonf(const char *string, ...) GCC_FMT_ATTR(1, 2); QObject *qobject_from_jsonv(const char *string, va_list *ap) GCC_FMT_ATTR(1, 0); -- cgit v1.2.3