From: Stefan Weil Date: Wed, 19 Feb 2014 05:11:45 +0000 (+0100) Subject: bswap: Modify prototypes of st[wl]_{le, be}_p (avoid type conversions) X-Git-Tag: v2.0.0-rc0~42^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55e7c29e46f845f503fda3e8cac3f5e0e8b3d984;p=thirdparty%2Fqemu.git bswap: Modify prototypes of st[wl]_{le, be}_p (avoid type conversions) 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 Reviewed-by: Laszlo Ersek Signed-off-by: Michael Tokarev --- diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 0cc11a5e79c..0cb7c05554a 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)); }