Resolve a good chunk of windows compiler warnings

Mostly revolved around the new MSVC check for functions that don't cover all paths (ie. a switch statement without a default case).  It appears to not see an assert as a valid default case.

I switched assert(false) to exceptions in these cases.  I believe this should also abort the program, but will also provide a hopefully useful message?  Hopefully this is an improvement.

Resolves #32
This commit is contained in:
Tyler Wilding
2020-09-13 21:10:43 -04:00
parent 28cd6a7e65
commit 345b8e30d8
22 changed files with 49 additions and 43 deletions
+2 -1
View File
@@ -5,6 +5,7 @@
#include "Register.h"
#include <cassert>
#include <stdexcept>
////////////////////////////
// Register Name Constants
@@ -126,7 +127,7 @@ const char* Register::to_charp() const {
case Reg::PCR:
return pcr_to_charp(get_pcr());
default:
assert(false);
throw std::runtime_error("Unsupported Register");
}
}