From: Thomas Jarosch Date: Mon, 17 Oct 2011 08:54:37 +0000 (+0200) Subject: Silence compile warning about Undef not being handled in switch() X-Git-Tag: v2.6~36 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=751c68b481b966d7a3dcf5215929ce46c53546c1;p=libi2ncommon Silence compile warning about Undef not being handled in switch() --- diff --git a/src/tribool.cpp b/src/tribool.cpp index 403d3c8..0981fee 100644 --- a/src/tribool.cpp +++ b/src/tribool.cpp @@ -113,15 +113,22 @@ bool Tribool::operator!=(const Tribool& x) const **/ Tribool Tribool::operator !() const { + enum State rtn = Undef; + switch (Value) { case True: - return False; + rtn = False; + break; case False: - return True; + rtn = True; + break; + case Undef: + default: + break; } //lint !e787 - return Undef; + return rtn; } /**