[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-trivial] [PULL 03/13] bswap: Modify prototype of stb_p (avoid type

From: Michael Tokarev
Subject: [Qemu-trivial] [PULL 03/13] bswap: Modify prototype of stb_p (avoid type conversions)
Date: Tue, 4 Mar 2014 10:15:51 +0400

From: Stefan Weil <address@hidden>

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 <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
 include/qemu/bswap.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 437b8e0..0cc11a5 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;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]