build: fix switch/enum coverage warnings

uncovered using clang's -Wswitch-enum
This commit is contained in:
Danny Robson 2016-05-12 17:45:29 +10:00
parent 420e4215ef
commit 640b4aa6ca
3 changed files with 11 additions and 10 deletions

View File

@ -40,9 +40,9 @@ operator<< (std::ostream &os, SHA1::state_t t) {
switch (t) {
case SHA1::READY: os << "READY"; return os;
case SHA1::FINISHED: os << "FINISHED"; return os;
default:
unreachable ();
}
unreachable ();
}

View File

@ -275,7 +275,9 @@ util::operator<< (std::ostream &os, util::uri::component c)
case util::uri::QUERY: return os << "QUERY";
case util::uri::FRAGMENT: return os << "FRAGMENT";
default:
case util::uri::NUM_COMPONENTS:
unreachable ();
}
unreachable ();
}

View File

@ -199,14 +199,13 @@ namespace util {
operator<< (std::ostream& os, const util::version::release_t r)
{
switch (r) {
case version::ALPHA: return os << 'a';
case version::BETA: return os << 'b';
case version::GAMMA: return os << 'g';
case version::PRODUCTION: return os;
default:
unreachable ();
case version::ALPHA: return os << 'a';
case version::BETA: return os << 'b';
case version::GAMMA: return os << 'g';
case version::PRODUCTION: return os;
}
unreachable ();
}
}