On 20/10/22 13:52, Richard Henderson wrote:
The count is not itself an enumerator. Move it outside to
prevent the compiler from considering it with -Wswitch-enum.
Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
include/tcg/tcg.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index afa18986b1..a631e0bc80 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -294,8 +294,6 @@ typedef enum TCGType {
TCG_TYPE_V128,
TCG_TYPE_V256,
- TCG_TYPE_COUNT, /* number of different types */
-
/* An alias for the size of the host register. */
#if TCG_TARGET_REG_BITS == 32
TCG_TYPE_REG = TCG_TYPE_I32,
@@ -318,6 +316,9 @@ typedef enum TCGType {
#endif
} TCGType;
+/* Number of different types */
+#define TCG_TYPE_COUNT (TCG_TYPE_V256 + 1)
Eventually add the definition at the same place within the enum,
so we don't forget to update it when adding a new type?
Regardless:
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>
+
/**
* get_alignment_bits
* @memop: MemOp value