From c55c8b24f90e1c6db512769d045b38c5816f26d7 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 12 Feb 2018 16:08:12 -0500 Subject: [PATCH] bitops.h: sextract64() return type should be int64_t, not uint64_t The documentation for sextract64() claims that the return type is an int64_t, but the code itself disagrees. Fix the return type to conform to the documentation and to bring it into line with sextract32(), which returns int32_t. Backports commit 4f9950520a115acf9c0a209f0befa45758ad0215 from qemu --- qemu/include/qemu/bitops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu/include/qemu/bitops.h b/qemu/include/qemu/bitops.h index 4ae468e3..5a616529 100644 --- a/qemu/include/qemu/bitops.h +++ b/qemu/include/qemu/bitops.h @@ -344,7 +344,7 @@ static inline int32_t sextract32(uint32_t value, int start, int length) * Returns: the sign extended value of the bit field extracted from the * input value. */ -static inline uint64_t sextract64(uint64_t value, int start, int length) +static inline int64_t sextract64(uint64_t value, int start, int length) { assert(start >= 0 && length > 0 && length <= 64 - start); /* Note that this implementation relies on right shift of signed