]> git.proxmox.com Git - mirror_qemu.git/commitdiff
bswap: Modify prototypes of st[wl]_{le, be}_p (avoid type conversions)
authorStefan Weil <sw@weilnetz.de>
Wed, 19 Feb 2014 05:11:45 +0000 (06:11 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Sun, 2 Mar 2014 13:12:41 +0000 (17:12 +0400)
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 <sw@weilnetz.de>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
include/qemu/bswap.h

index 0cc11a5e79cb7c9ce613f2fdaba1946aa66f024d..0cb7c05554a3df31fdf0e074bd491a90716eb91e 100644 (file)
@@ -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));
 }