1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-27 01:31:42 +00:00

Adds exceptions for bad enumeration values.

This commit is contained in:
Thomas Harte 2017-11-24 19:27:49 -05:00
parent b4f3c41aae
commit 2008dec1ed
2 changed files with 8 additions and 0 deletions

View File

@ -8,6 +8,7 @@
#include "IntermediateShader.hpp" #include "IntermediateShader.hpp"
#include <cassert>
#include <cstring> #include <cstring>
#include <sstream> #include <sstream>
@ -21,6 +22,9 @@ std::string IntermediateShader::get_input_name(Input input) {
case Input::OutputStart: return "outputStart"; case Input::OutputStart: return "outputStart";
case Input::Ends: return "ends"; case Input::Ends: return "ends";
case Input::PhaseTimeAndAmplitude: return "phaseTimeAndAmplitude"; case Input::PhaseTimeAndAmplitude: return "phaseTimeAndAmplitude";
// Intended to be unreachable.
default: assert(false);
} }
} }

View File

@ -8,6 +8,7 @@
#include "OutputShader.hpp" #include "OutputShader.hpp"
#include <cassert>
#include <cmath> #include <cmath>
#include <sstream> #include <sstream>
@ -17,6 +18,9 @@ std::string OutputShader::get_input_name(Input input) {
switch(input) { switch(input) {
case Input::Horizontal: return "horizontal"; case Input::Horizontal: return "horizontal";
case Input::Vertical: return "vertical"; case Input::Vertical: return "vertical";
// Intended to be unreachable.
default: assert(false);
} }
} }