[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/13] bswap: Modify prototype of stb_p (avoid type c
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [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;
}
--
1.7.10.4
- [Qemu-devel] [PULL 00/13] Trivial patches for 2014-03-04, Michael Tokarev, 2014/03/04
- [Qemu-devel] [PULL 05/13] tcg: Fix typo in comment (dependancies -> dependencies), Michael Tokarev, 2014/03/04
- [Qemu-devel] [PULL 01/13] include/qemu/host-utils.h: Trivial typo: ctz->cto, Michael Tokarev, 2014/03/04
- [Qemu-devel] [PULL 02/13] object: Report type in error when not user creatable., Michael Tokarev, 2014/03/04
- [Qemu-devel] [PULL 06/13] stubs: Optimize dependencies for gdbstub.c, Michael Tokarev, 2014/03/04
- [Qemu-devel] [PULL 13/13] vl: Remove unneeded include file, Michael Tokarev, 2014/03/04
- [Qemu-devel] [PULL 09/13] util/iov: Use qemu/sockets.h instead of conditional code, Michael Tokarev, 2014/03/04
- [Qemu-devel] [PULL 11/13] qemu-img: Remove unneeded include files, Michael Tokarev, 2014/03/04
- [Qemu-devel] [PULL 03/13] bswap: Modify prototype of stb_p (avoid type conversions),
Michael Tokarev <=
- [Qemu-devel] [PULL 07/13] tests/test-int128: Don't use __noclone__ attribute on clang, Michael Tokarev, 2014/03/04
- [Qemu-devel] [PULL 08/13] qjson.h: Remove spurious GCC_FMT_ATTR markup from qobject_from_json() declaration, Michael Tokarev, 2014/03/04
- [Qemu-devel] [PULL 12/13] qga: Remove unneeded include file, Michael Tokarev, 2014/03/04
- [Qemu-devel] [PULL 04/13] bswap: Modify prototypes of st[wl]_{le, be}_p (avoid type conversions), Michael Tokarev, 2014/03/04
- [Qemu-devel] [PULL 10/13] exec: Remove unneeded include files, Michael Tokarev, 2014/03/04
- Re: [Qemu-devel] [PULL 00/13] Trivial patches for 2014-03-04, Peter Maydell, 2014/03/04