You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/08/12 17:53:16 UTC

mesos git commit: Removed `default` case from `switch` over enum value.

Repository: mesos
Updated Branches:
  refs/heads/master 736d73267 -> 514cfc5f4


Removed `default` case from `switch` over enum value.

Compilers can typically warn about enum values not handled in a
`switch`. If one adds a `default` case, even if the enum is extended
later, all cases will already be covered.

Instead do not use a `default` case so that we are warned whenever the
definition of the enum and our pattern matching against its value get
out of sync.

Review: https://reviews.apache.org/r/51041/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/514cfc5f
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/514cfc5f
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/514cfc5f

Branch: refs/heads/master
Commit: 514cfc5f4f57cbf9dba0103c3549e682dfea5d03
Parents: 736d732
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Fri Aug 12 10:52:58 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Fri Aug 12 10:52:58 2016 -0700

----------------------------------------------------------------------
 src/linux/capabilities.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/514cfc5f/src/linux/capabilities.cpp
----------------------------------------------------------------------
diff --git a/src/linux/capabilities.cpp b/src/linux/capabilities.cpp
index 5f21dd4..bbd1bb3 100644
--- a/src/linux/capabilities.cpp
+++ b/src/linux/capabilities.cpp
@@ -155,8 +155,9 @@ void ProcessCapabilities::set(
     case PERMITTED:   permitted = capabilities;
     case INHERITABLE: inheritable = capabilities;
     case BOUNDING:    bounding = capabilities;
-    default:          UNREACHABLE();
   }
+
+  UNREACHABLE();
 }