Lots of various changes suggested by the code analysis tools.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2018-11-27 22:36:54 +00:00
parent 555423d10a
commit a673a64c3f
14 changed files with 87 additions and 83 deletions
+3 -3
View File
@@ -12,7 +12,7 @@ namespace EightBit {
int countBits(uint8_t value);
bool oddParity(uint8_t value);
int findFirstSet(int value);
void assume(int expression);
constexpr void assume(int expression);
}
inline int EightBit::countBits(const uint8_t value) {
@@ -52,7 +52,7 @@ inline int EightBit::findFirstSet(const int value) {
#endif
}
inline void EightBit::assume(const int expression) {
inline constexpr void EightBit::assume(const int expression) {
#ifdef _MSC_VER
__assume(expression);
#elif defined(__GNUG__)
@@ -72,7 +72,7 @@ inline void EightBit::assume(const int expression) {
# define PARITY(x) EightBit::oddParity(x)
# define UNREACHABLE { ASSUME(0); throw new std::exception("unreachable"); }
# define UNREACHABLE { ASSUME(0); throw std::exception("unreachable"); }
#elif defined(__GNUG__)