build: fix warnings from -Wparentheses
This commit is contained in:
parent
5642ff43b8
commit
4f10505d09
@ -39,7 +39,7 @@ namespace util {
|
||||
constexpr T
|
||||
rotatel [[gnu::pure]] (const T value, std::size_t magnitude)
|
||||
{
|
||||
return (value << magnitude) | (value >> sizeof (value) * 8 - magnitude);
|
||||
return (value << magnitude) | (value >> (sizeof (value) * 8 - magnitude));
|
||||
}
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ namespace util {
|
||||
constexpr T
|
||||
rotater [[gnu::pure]] (const T value, std::size_t magnitude)
|
||||
{
|
||||
return (value >> magnitude) | (value << sizeof (value) * 8 - magnitude);
|
||||
return (value >> magnitude) | (value << (sizeof (value) * 8 - magnitude));
|
||||
}
|
||||
|
||||
|
||||
|
@ -145,7 +145,7 @@ template <typename T, unsigned I, unsigned E> \
|
||||
fixed<T,I,E> \
|
||||
fixed<T,I,E>::operator OP (integer_type val) const \
|
||||
{ \
|
||||
return fixed<T,I,E>::from_native (m_value OP val << E); \
|
||||
return fixed<T,I,E>::from_native (m_value OP (native_type{val} << E)); \
|
||||
}
|
||||
|
||||
SIMPLE_INTEGER_LIT(+)
|
||||
|
10
fixed.hpp
10
fixed.hpp
@ -24,7 +24,15 @@
|
||||
#include <iosfwd>
|
||||
|
||||
namespace util {
|
||||
template <typename T, unsigned I, unsigned E>
|
||||
template <
|
||||
// whether the type is signed or unsigned. supply an appropriately
|
||||
// signed type here; it won't be used for anything else.
|
||||
typename T,
|
||||
// how many bits total are used for the integral component
|
||||
unsigned I,
|
||||
// how many bits are used for the fractional component
|
||||
unsigned E
|
||||
>
|
||||
class [[gnu::packed]] fixed {
|
||||
public:
|
||||
static_assert (I > 0);
|
||||
|
@ -76,9 +76,9 @@ jsonish::parse_number (const std::function<callback_t> &cb,
|
||||
++cursor;
|
||||
|
||||
auto digit_start = cursor;
|
||||
while (cursor != last && ('0' <= *cursor && *cursor <= '9' ||
|
||||
'a' <= *cursor && *cursor <= 'f' ||
|
||||
'A' <= *cursor && *cursor <= 'F'))
|
||||
while (cursor != last && ((('0' <= *cursor) && (*cursor <= '9')) ||
|
||||
(('a' <= *cursor) && (*cursor <= 'f')) ||
|
||||
(('A' <= *cursor) && (*cursor <= 'F'))))
|
||||
++cursor;
|
||||
if (digit_start == cursor)
|
||||
throw parse_error {cursor};
|
||||
|
Loading…
Reference in New Issue
Block a user