Silence compile warning about Undef not being handled in switch()
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 17 Oct 2011 08:54:37 +0000 (10:54 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 17 Oct 2011 08:54:37 +0000 (10:54 +0200)
src/tribool.cpp

index 403d3c8..0981fee 100644 (file)
@@ -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;
 }
 
 /**