<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 13, 2014 at 8:55 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":2p8" class="a3s" style="overflow:hidden"> uint64_t Shift = 64 - EmissionSize * 8;<br>
- assert(Shift < std::numeric_limits<unsigned long long>::digits &&<br>
+ assert(Shift < static_cast<unsigned>(<br>
+ std::numeric_limits<unsigned long long>::digits) &&</div></blockquote></div><br>The LHS is a 64-bit number here, it seems odd to cast to a (potentially) 32-bit number.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Why couldn't all of these be signed integers, and we get UBSan failures if the math is wrong? I really dislike this use of unsigned here, and I feel that numeric_limits got this right -- these are small "numbers" and "int" seems like a really nice type for them. =]</div></div>