diff --git a/hash/murmur/common.cpp b/hash/murmur/common.cpp index e504f76e..8c62ac38 100644 --- a/hash/murmur/common.cpp +++ b/hash/murmur/common.cpp @@ -20,8 +20,8 @@ namespace cruft::hash::murmur { uint32_t h = 0; switch (len % sizeof (uint32_t)) { - case 3: h += bytes[2] << 16; - case 2: h += bytes[1] << 8; + case 3: h += bytes[2] << 16; [[fallthrough]]; + case 2: h += bytes[1] << 8; [[fallthrough]]; case 1: h += bytes[0]; break; @@ -43,12 +43,12 @@ namespace cruft::hash::murmur { uint64_t h = 0; switch (len % sizeof (uint64_t)) { - case 7: h += uint64_t(bytes[6]) << 48; - case 6: h += uint64_t(bytes[5]) << 40; - case 5: h += uint64_t(bytes[4]) << 32; - case 4: h += uint64_t(bytes[3]) << 24; - case 3: h += uint64_t(bytes[2]) << 16; - case 2: h += uint64_t(bytes[1]) << 8; + case 7: h += uint64_t(bytes[6]) << 48; [[fallthrough]]; + case 6: h += uint64_t(bytes[5]) << 40; [[fallthrough]]; + case 5: h += uint64_t(bytes[4]) << 32; [[fallthrough]]; + case 4: h += uint64_t(bytes[3]) << 24; [[fallthrough]]; + case 3: h += uint64_t(bytes[2]) << 16; [[fallthrough]]; + case 2: h += uint64_t(bytes[1]) << 8; [[fallthrough]]; case 1: h += uint64_t(bytes[0]); break; @@ -70,20 +70,20 @@ namespace cruft::hash::murmur { std::array result {0,0,0,0}; switch (len % 16) { - case 15: result[3] |= bytes[14] << 16; - case 14: result[3] |= bytes[13] << 8; - case 13: result[3] |= bytes[12] << 0; - case 12: result[2] |= bytes[11] << 24; - case 11: result[2] |= bytes[10] << 16; - case 10: result[2] |= bytes[ 9] << 8; - case 9: result[2] |= bytes[ 8] << 0; - case 8: result[1] |= bytes[ 7] << 24; - case 7: result[1] |= bytes[ 6] << 16; - case 6: result[1] |= bytes[ 5] << 8; - case 5: result[1] |= bytes[ 4] << 0; - case 4: result[0] |= bytes[ 3] << 24; - case 3: result[0] |= bytes[ 2] << 16; - case 2: result[0] |= bytes[ 1] << 8; + case 15: result[3] |= bytes[14] << 16; [[fallthrough]]; + case 14: result[3] |= bytes[13] << 8; [[fallthrough]]; + case 13: result[3] |= bytes[12] << 0; [[fallthrough]]; + case 12: result[2] |= bytes[11] << 24; [[fallthrough]]; + case 11: result[2] |= bytes[10] << 16; [[fallthrough]]; + case 10: result[2] |= bytes[ 9] << 8; [[fallthrough]]; + case 9: result[2] |= bytes[ 8] << 0; [[fallthrough]]; + case 8: result[1] |= bytes[ 7] << 24; [[fallthrough]]; + case 7: result[1] |= bytes[ 6] << 16; [[fallthrough]]; + case 6: result[1] |= bytes[ 5] << 8; [[fallthrough]]; + case 5: result[1] |= bytes[ 4] << 0; [[fallthrough]]; + case 4: result[0] |= bytes[ 3] << 24; [[fallthrough]]; + case 3: result[0] |= bytes[ 2] << 16; [[fallthrough]]; + case 2: result[0] |= bytes[ 1] << 8; [[fallthrough]]; case 1: result[0] |= bytes[ 0] << 0; break; @@ -106,21 +106,21 @@ namespace cruft::hash::murmur { switch(len & 15) { - case 15: result[1] |= uint64_t{bytes[14]} << 48; - case 14: result[1] |= uint64_t{bytes[13]} << 40; - case 13: result[1] |= uint64_t{bytes[12]} << 32; - case 12: result[1] |= uint64_t{bytes[11]} << 24; - case 11: result[1] |= uint64_t{bytes[10]} << 16; - case 10: result[1] |= uint64_t{bytes[ 9]} << 8; - case 9: result[1] |= uint64_t{bytes[ 8]} << 0; + case 15: result[1] |= uint64_t{bytes[14]} << 48; [[fallthrough]]; + case 14: result[1] |= uint64_t{bytes[13]} << 40; [[fallthrough]]; + case 13: result[1] |= uint64_t{bytes[12]} << 32; [[fallthrough]]; + case 12: result[1] |= uint64_t{bytes[11]} << 24; [[fallthrough]]; + case 11: result[1] |= uint64_t{bytes[10]} << 16; [[fallthrough]]; + case 10: result[1] |= uint64_t{bytes[ 9]} << 8; [[fallthrough]]; + case 9: result[1] |= uint64_t{bytes[ 8]} << 0; [[fallthrough]]; - case 8: result[0] |= uint64_t{bytes[ 7]} << 56; - case 7: result[0] |= uint64_t{bytes[ 6]} << 48; - case 6: result[0] |= uint64_t{bytes[ 5]} << 40; - case 5: result[0] |= uint64_t{bytes[ 4]} << 32; - case 4: result[0] |= uint64_t{bytes[ 3]} << 24; - case 3: result[0] |= uint64_t{bytes[ 2]} << 16; - case 2: result[0] |= uint64_t{bytes[ 1]} << 8; + case 8: result[0] |= uint64_t{bytes[ 7]} << 56; [[fallthrough]]; + case 7: result[0] |= uint64_t{bytes[ 6]} << 48; [[fallthrough]]; + case 6: result[0] |= uint64_t{bytes[ 5]} << 40; [[fallthrough]]; + case 5: result[0] |= uint64_t{bytes[ 4]} << 32; [[fallthrough]]; + case 4: result[0] |= uint64_t{bytes[ 3]} << 24; [[fallthrough]]; + case 3: result[0] |= uint64_t{bytes[ 2]} << 16; [[fallthrough]]; + case 2: result[0] |= uint64_t{bytes[ 1]} << 8; [[fallthrough]]; case 1: result[0] |= uint64_t{bytes[ 0]} << 0; break; diff --git a/parse/si.cpp b/parse/si.cpp index e201d01c..4f477ffe 100644 --- a/parse/si.cpp +++ b/parse/si.cpp @@ -34,6 +34,7 @@ cruft::parse::si (cruft::view const src) case 'G': case 'g': return dst * 1024 * 1024 * 1024; case 'T': case 't': return dst * 1024 * 1024 * 1024 * 1024; } + [[fallthrough]]; default: return cruft::unexpected (std::errc::invalid_argument); diff --git a/types/description.cpp b/types/description.cpp index fe16e667..188f2960 100644 --- a/types/description.cpp +++ b/types/description.cpp @@ -82,6 +82,7 @@ cruft::debug::validator::is_valid ( WARN_RETURN (val.width == 0 || val.width > 8, false); WARN_RETURN (val.arity == 0 || val.arity > 16, false); WARN_RETURN (val.alignment == 0 || val.alignment > 64, false); + return true; // All bets are off. Have fun. case cruft::types::category::NONE: