Received: from eggs.gnu.org ([2001:4830:134:3::10]:60428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKimJ-0001Ar-Mq for qemu-devel@nongnu.org; Tue, 04 Mar 2014 01:24:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKimF-00049O-2q for qemu-devel@nongnu.org; Tue, 04 Mar 2014 01:24:35 -0500 From: Michael Tokarev Date: Tue, 4 Mar 2014 10:15:51 +0400 Message-Id: <1393913761-16516-4-git-send-email-mjt@msgid.tls.msk.ru> In-Reply-To: <1393913761-16516-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1393913761-16516-1-git-send-email-mjt@msgid.tls.msk.ru> Subject: [Qemu-devel] [PULL 03/13] bswap: Modify prototype of stb_p (avoid type conversions) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Stefan Weil , Michael Tokarev From: Stefan Weil 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 Reviewed-by: Laszlo Ersek Signed-off-by: Michael Tokarev --- 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