[clang][SourceManager] Fix -Wparentheses warning (NFC)
GCC warning: ``` /llvm-project/clang/lib/Basic/SourceManager.cpp: In instantiation of ‘constexpr T likelyhasbetween(T, unsigned char, unsigned char) [with T = long unsigned int]’: /llvm-project/clang/lib/Basic/SourceManager.cpp:1292:52: required from here /llvm-project/clang/lib/Basic/SourceManager.cpp:1264:48: warning: suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses] 1264 | (x & ~static_cast<T>(0) / 255 * 127) + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 1265 | (~static_cast<T>(0) / 255 * (127 - (m - 1)))) & | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```
This commit is contained in:
parent
49c79e3b56
commit
ca55f05116
@ -1261,8 +1261,8 @@ template <class T>
|
||||
static constexpr inline T likelyhasbetween(T x, unsigned char m,
|
||||
unsigned char n) {
|
||||
return ((x - ~static_cast<T>(0) / 255 * (n + 1)) & ~x &
|
||||
(x & ~static_cast<T>(0) / 255 * 127) +
|
||||
(~static_cast<T>(0) / 255 * (127 - (m - 1)))) &
|
||||
((x & ~static_cast<T>(0) / 255 * 127) +
|
||||
(~static_cast<T>(0) / 255 * (127 - (m - 1))))) &
|
||||
~static_cast<T>(0) / 255 * 128;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user