[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PULL 04/13] bswap: Modify prototypes of st[wl]_{le, be}_
From: |
Michael Tokarev |
Subject: |
[Qemu-trivial] [PULL 04/13] bswap: Modify prototypes of st[wl]_{le, be}_p (avoid type conversions) |
Date: |
Tue, 4 Mar 2014 10:15:52 +0400 |
From: Stefan Weil <address@hidden>
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 <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
include/qemu/bswap.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 0cc11a5..0cb7c05 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));
}
--
1.7.10.4
- [Qemu-trivial] [PULL 01/13] include/qemu/host-utils.h: Trivial typo: ctz->cto, (continued)
- [Qemu-trivial] [PULL 01/13] include/qemu/host-utils.h: Trivial typo: ctz->cto, Michael Tokarev, 2014/03/04
- [Qemu-trivial] [PULL 03/13] bswap: Modify prototype of stb_p (avoid type conversions), Michael Tokarev, 2014/03/04
- [Qemu-trivial] [PULL 06/13] stubs: Optimize dependencies for gdbstub.c, Michael Tokarev, 2014/03/04
- [Qemu-trivial] [PULL 09/13] util/iov: Use qemu/sockets.h instead of conditional code, Michael Tokarev, 2014/03/04
- [Qemu-trivial] [PULL 13/13] vl: Remove unneeded include file, Michael Tokarev, 2014/03/04
- [Qemu-trivial] [PULL 11/13] qemu-img: Remove unneeded include files, Michael Tokarev, 2014/03/04
- [Qemu-trivial] [PULL 07/13] tests/test-int128: Don't use __noclone__ attribute on clang, Michael Tokarev, 2014/03/04
- [Qemu-trivial] [PULL 08/13] qjson.h: Remove spurious GCC_FMT_ATTR markup from qobject_from_json() declaration, Michael Tokarev, 2014/03/04
- [Qemu-trivial] [PULL 12/13] qga: Remove unneeded include file, Michael Tokarev, 2014/03/04
- [Qemu-trivial] [PULL 10/13] exec: Remove unneeded include files, Michael Tokarev, 2014/03/04
- [Qemu-trivial] [PULL 04/13] bswap: Modify prototypes of st[wl]_{le, be}_p (avoid type conversions),
Michael Tokarev <=
- [Qemu-trivial] [PULL 02/13] object: Report type in error when not user creatable., Michael Tokarev, 2014/03/04
- Re: [Qemu-trivial] [Qemu-devel] [PULL 00/13] Trivial patches for 2014-03-04, Peter Maydell, 2014/03/04