From 4e1cd68c38372adebe92e59f3f614396c055ff0f Mon Sep 17 00:00:00 2001 From: Quinn Date: Wed, 23 Jul 2025 14:06:45 +0200 Subject: [PATCH] semantic fix, use explicit fallthrough GCC was complaining, and I didn't have a valid counter argument. --- src/dat/nbt.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/dat/nbt.c b/src/dat/nbt.c index facc8ee..4dbf88b 100644 --- a/src/dat/nbt.c +++ b/src/dat/nbt.c @@ -38,11 +38,11 @@ static u8 const *nbt_nexttag(u8 const *restrict buf) { uint mems = 0; switch (*buf) { - case NBT_I8: - case NBT_I16: - case NBT_I32: - case NBT_I64: - case NBT_F32: + case NBT_I8: __attribute__((fallthrough)); + case NBT_I16: __attribute__((fallthrough)); + case NBT_I32: __attribute__((fallthrough)); + case NBT_I64: __attribute__((fallthrough)); + case NBT_F32: __attribute__((fallthrough)); case NBT_F64: nxt += nbt_primsize(*buf); return nxt; @@ -91,9 +91,9 @@ int nbt_primsize(u8 tag) { switch (tag) { case NBT_I8: return 1; case NBT_I16: return 2; - case NBT_I32: + case NBT_I32: __attribute__((fallthrough)); case NBT_F32: return 4; - case NBT_I64: + case NBT_I64: __attribute__((fallthrough)); case NBT_F64: return 8; default: return -1; } @@ -101,11 +101,11 @@ int nbt_primsize(u8 tag) { int nbt_isprim(u8 tag) { switch (tag) { - case NBT_I8: - case NBT_I16: - case NBT_I32: - case NBT_F32: - case NBT_I64: + case NBT_I8: __attribute__((fallthrough)); + case NBT_I16: __attribute__((fallthrough)); + case NBT_I32: __attribute__((fallthrough)); + case NBT_F32: __attribute__((fallthrough)); + case NBT_I64: __attribute__((fallthrough)); case NBT_F64: return 1; default: