summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2014-02-19 06:11:44 +0100
committerMichael Tokarev <mjt@tls.msk.ru>2014-03-02 17:12:41 +0400
commit0064aceb29faea018dfb7cf0bca5d9644272a295 (patch)
treec27ab87cab6179c9f83e765357dd8d97c71abe8b /include
parentde580dafade551cf67607f114ff9b5eeb881cc42 (diff)
downloadqemu-0064aceb29faea018dfb7cf0bca5d9644272a295.tar.gz
qemu-0064aceb29faea018dfb7cf0bca5d9644272a295.tar.bz2
qemu-0064aceb29faea018dfb7cf0bca5d9644272a295.zip
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 <sw@weilnetz.de> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'include')
-rw-r--r--include/qemu/bswap.h2
1 files changed, 1 insertions, 1 deletions
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;
}