libretro / bsnes2014

Libretro fork of bsnes. As close to upstream as possible.
GNU General Public License v3.0
9 stars 17 forks source link

Silence -Wparentheses warnings #31

Closed orbea closed 7 years ago

orbea commented 7 years ago

If compiled with -Wall this will silence the following -Wparentheses warnings.

./nall/atoi.hpp: In function ‘constexpr uintmax_t nall::binary_(const char*, uintmax_t)’:
./nall/atoi.hpp:10:61: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
     *s == '0' || *s == '1' ? binary_(s + 1, (sum << 1) | *s - '0') :
                                                             ^
./nall/atoi.hpp: In function ‘constexpr uintmax_t nall::octal_(const char*, uintmax_t)’:
./nall/atoi.hpp:18:60: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
     *s >= '0' && *s <= '7' ? octal_(s + 1, (sum << 3) | *s - '0') :
                                                            ^
./nall/atoi.hpp: In function ‘constexpr uintmax_t nall::hex_(const char*, uintmax_t)’:
./nall/atoi.hpp:34:64: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
     *s >= 'A' && *s <= 'F' ? hex_(s + 1, (sum << 4) | *s - 'A' + 10) :
                                                                ^
./nall/atoi.hpp:35:64: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
     *s >= 'a' && *s <= 'f' ? hex_(s + 1, (sum << 4) | *s - 'a' + 10) :
                                                                ^
./nall/atoi.hpp:36:58: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
     *s >= '0' && *s <= '9' ? hex_(s + 1, (sum << 4) | *s - '0') :
                                                          ^