From 5994fa3f215b021e156dc761885de6fe90f9a0a0 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 28 Aug 2016 05:43:51 -0700 Subject: [PATCH] ircd: static_assertion for critical unsigned mode mask value. --- include/ircd/mode_table.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/ircd/mode_table.h b/include/ircd/mode_table.h index d896a163b..9db632d62 100644 --- a/include/ircd/mode_table.h +++ b/include/ircd/mode_table.h @@ -57,6 +57,8 @@ mask(const mode_table &table, const char *buf, mask_t &val) { + static_assert(std::is_unsigned(), ""); + mask_t add(-1); if(buf) for(; *buf; ++buf) switch(*buf) { @@ -227,6 +229,7 @@ find_slot(const mode_table &table, const std::nothrow_t) { using mask_t = typename mode_table::mask_t; + static_assert(std::is_unsigned(), ""); const auto mask(mask_table(table)); for(mask_t i(1); i; i <<= 1)