mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd: static_assertion for critical unsigned mode mask value.
This commit is contained in:
parent
3589a763e8
commit
5994fa3f21
1 changed files with 3 additions and 0 deletions
|
@ -57,6 +57,8 @@ mask(const mode_table<T> &table,
|
||||||
const char *buf,
|
const char *buf,
|
||||||
mask_t &val)
|
mask_t &val)
|
||||||
{
|
{
|
||||||
|
static_assert(std::is_unsigned<mask_t>(), "");
|
||||||
|
|
||||||
mask_t add(-1);
|
mask_t add(-1);
|
||||||
if(buf) for(; *buf; ++buf) switch(*buf)
|
if(buf) for(; *buf; ++buf) switch(*buf)
|
||||||
{
|
{
|
||||||
|
@ -227,6 +229,7 @@ find_slot(const mode_table<T> &table,
|
||||||
const std::nothrow_t)
|
const std::nothrow_t)
|
||||||
{
|
{
|
||||||
using mask_t = typename mode_table<T>::mask_t;
|
using mask_t = typename mode_table<T>::mask_t;
|
||||||
|
static_assert(std::is_unsigned<mask_t>(), "");
|
||||||
|
|
||||||
const auto mask(mask_table(table));
|
const auto mask(mask_table(table));
|
||||||
for(mask_t i(1); i; i <<= 1)
|
for(mask_t i(1); i; i <<= 1)
|
||||||
|
|
Loading…
Reference in a new issue