[webkit-reviews] review granted: [Bug 209955] [Clang 10] Fix -Wimplicit-int-float-conversion compilation warnings in WTF : [Attachment 395357] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 3 09:40:35 PDT 2020


Darin Adler <darin at apple.com> has granted  review:
Bug 209955: [Clang 10] Fix -Wimplicit-int-float-conversion compilation warnings
in WTF
https://bugs.webkit.org/show_bug.cgi?id=209955

Attachment 395357: Patch

https://bugs.webkit.org/attachment.cgi?id=395357&action=review




--- Comment #4 from Darin Adler <darin at apple.com> ---
Comment on attachment 395357
  --> https://bugs.webkit.org/attachment.cgi?id=395357
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=395357&action=review

>> Source/WTF/wtf/MathExtras.h:405
>> +template<typename T> constexpr float maxPlusOne =
powerOfTwo(countOfNumberBits<T>);
> 
> I think we need this separately for float and double. Just computing the
float one and then converting to double won’t give the correct answer.

Hmm, maybe I am wrong about that. I guess powers of two are particularly well
represented in floating point and perhaps converting the float one to double
works perfectly.

Best way to prove that would be testing, but I am guessing I was wrong.


More information about the webkit-reviews mailing list