From fc0870c180872d0f40e63507cc6bf8565ffd8d98 Mon Sep 17 00:00:00 2001 From: Roman Kiryanov Date: Tue, 18 Jun 2024 15:45:28 -0700 Subject: [PATCH] exec: Make the MemOp enum cast explicit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the MemOp enum cast explicit to use the QEMU headers with a C++ compiler. Signed-off-by: Roman Kiryanov Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240618224528.878425-1-rkir@google.com> Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memop.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/exec/memop.h b/include/exec/memop.h index 06417ff361..f881fe7af4 100644 --- a/include/exec/memop.h +++ b/include/exec/memop.h @@ -161,7 +161,7 @@ static inline MemOp size_memop(unsigned size) /* Power of 2 up to 8. */ assert((size & (size - 1)) == 0 && size >= 1 && size <= 8); #endif - return ctz32(size); + return (MemOp)ctz32(size); } /* Big endianness from MemOp. */