mesos: Fixed break before braces style for 'enum'. Review: https://reviews.apache.org/r/37260
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9d4ac11e Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9d4ac11e Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9d4ac11e Branch: refs/heads/master Commit: 9d4ac11ed757aa5869da440dfe5343a61b07199a Parents: 2307a9e Author: Michael Park <[email protected]> Authored: Mon Aug 10 12:17:05 2015 +0200 Committer: Till Toenshoff <[email protected]> Committed: Mon Aug 10 14:08:09 2015 +0200 ---------------------------------------------------------------------- docs/clang-format.md | 2 -- docs/mesos-c++-style-guide.md | 2 +- src/authentication/cram_md5/authenticatee.cpp | 3 ++- src/authentication/cram_md5/authenticator.cpp | 3 ++- src/examples/event_call_framework.cpp | 3 ++- src/linux/cgroups.hpp | 3 ++- src/log/coordinator.cpp | 3 ++- src/slave/containerizer/composing.cpp | 3 ++- src/slave/containerizer/docker.hpp | 3 ++- src/slave/slave.hpp | 9 ++++++--- src/state/zookeeper.cpp | 4 +++- src/tests/containerizer/docker_containerizer_tests.cpp | 3 ++- src/zookeeper/group.hpp | 3 ++- 13 files changed, 28 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/9d4ac11e/docs/clang-format.md ---------------------------------------------------------------------- diff --git a/docs/clang-format.md b/docs/clang-format.md index ce51a61..e8f593f 100644 --- a/docs/clang-format.md +++ b/docs/clang-format.md @@ -88,8 +88,6 @@ This binds the function `clang-format-region` to `C-M-tab`, which then formats t ## Known Limitations -* The braces after `namespace`s should not be wrapped. -* The braces after `struct`s and `union`s should be wrapped. * Parameters and arguments should be indented by 4 spaces rather than 2. * Should not follow Google's style of wrapping on open parentheses, we should try to reduce "jaggedness" in the code. http://git-wip-us.apache.org/repos/asf/mesos/blob/9d4ac11e/docs/mesos-c++-style-guide.md ---------------------------------------------------------------------- diff --git a/docs/mesos-c++-style-guide.md b/docs/mesos-c++-style-guide.md index 857f3dc..9c1a00c 100644 --- a/docs/mesos-c++-style-guide.md +++ b/docs/mesos-c++-style-guide.md @@ -50,7 +50,7 @@ void Slave::statusUpdate(StatusUpdate update, const UPID& pid) * For trailing comments, leave one space. ## Breaks -* Break before braces on function, class, struct and union definitions. (Google attaches braces to the surrounding context) +* Break before braces on enum, function, and record (i.e. struct, class, union) definitions. ## Indentation http://git-wip-us.apache.org/repos/asf/mesos/blob/9d4ac11e/src/authentication/cram_md5/authenticatee.cpp ---------------------------------------------------------------------- diff --git a/src/authentication/cram_md5/authenticatee.cpp b/src/authentication/cram_md5/authenticatee.cpp index 63ae17e..b03b44a 100644 --- a/src/authentication/cram_md5/authenticatee.cpp +++ b/src/authentication/cram_md5/authenticatee.cpp @@ -348,7 +348,8 @@ private: sasl_callback_t callbacks[5]; - enum { + enum + { READY, STARTING, STEPPING, http://git-wip-us.apache.org/repos/asf/mesos/blob/9d4ac11e/src/authentication/cram_md5/authenticator.cpp ---------------------------------------------------------------------- diff --git a/src/authentication/cram_md5/authenticator.cpp b/src/authentication/cram_md5/authenticator.cpp index 6a84e91..6632b23 100644 --- a/src/authentication/cram_md5/authenticator.cpp +++ b/src/authentication/cram_md5/authenticator.cpp @@ -339,7 +339,8 @@ private: } } - enum { + enum + { READY, STARTING, STEPPING, http://git-wip-us.apache.org/repos/asf/mesos/blob/9d4ac11e/src/examples/event_call_framework.cpp ---------------------------------------------------------------------- diff --git a/src/examples/event_call_framework.cpp b/src/examples/event_call_framework.cpp index 02c24c2..b1187aa 100644 --- a/src/examples/event_call_framework.cpp +++ b/src/examples/event_call_framework.cpp @@ -334,7 +334,8 @@ private: const ExecutorInfo executor; scheduler::Mesos mesos; - enum State { + enum State + { INITIALIZING = 0, SUBSCRIBED = 1, DISCONNECTED = 2 http://git-wip-us.apache.org/repos/asf/mesos/blob/9d4ac11e/src/linux/cgroups.hpp ---------------------------------------------------------------------- diff --git a/src/linux/cgroups.hpp b/src/linux/cgroups.hpp index a4a2cae..91ccfd0 100644 --- a/src/linux/cgroups.hpp +++ b/src/linux/cgroups.hpp @@ -573,7 +573,8 @@ Try<Nothing> disable( // Memory pressure counters. namespace pressure { -enum Level { +enum Level +{ LOW, MEDIUM, CRITICAL http://git-wip-us.apache.org/repos/asf/mesos/blob/9d4ac11e/src/log/coordinator.cpp ---------------------------------------------------------------------- diff --git a/src/log/coordinator.cpp b/src/log/coordinator.cpp index da689fa..5500bca 100644 --- a/src/log/coordinator.cpp +++ b/src/log/coordinator.cpp @@ -118,7 +118,8 @@ private: // election and has filled all existing positions. A coordinator is // put in electing state after it decides to go for an election and // before it is elected. - enum { + enum + { INITIAL, ELECTING, ELECTED, http://git-wip-us.apache.org/repos/asf/mesos/blob/9d4ac11e/src/slave/containerizer/composing.cpp ---------------------------------------------------------------------- diff --git a/src/slave/containerizer/composing.cpp b/src/slave/containerizer/composing.cpp index a6a170c..8c3a235 100644 --- a/src/slave/containerizer/composing.cpp +++ b/src/slave/containerizer/composing.cpp @@ -113,7 +113,8 @@ private: // The states that the composing containerizer cares about for the // container it is asked to launch. - enum State { + enum State + { LAUNCHING, LAUNCHED, DESTROYED http://git-wip-us.apache.org/repos/asf/mesos/blob/9d4ac11e/src/slave/containerizer/docker.hpp ---------------------------------------------------------------------- diff --git a/src/slave/containerizer/docker.hpp b/src/slave/containerizer/docker.hpp index e43d300..e7436d0 100644 --- a/src/slave/containerizer/docker.hpp +++ b/src/slave/containerizer/docker.hpp @@ -394,7 +394,8 @@ private: // for discarding, then we won't need to make pull be it's own // state anymore, although it doesn't hurt since it gives us // better error messages. - enum State { + enum State + { FETCHING = 1, PULLING = 2, RUNNING = 3, http://git-wip-us.apache.org/repos/asf/mesos/blob/9d4ac11e/src/slave/slave.hpp ---------------------------------------------------------------------- diff --git a/src/slave/slave.hpp b/src/slave/slave.hpp index 02b7115..09172f7 100644 --- a/src/slave/slave.hpp +++ b/src/slave/slave.hpp @@ -260,7 +260,8 @@ public: // Made public for testing purposes. void detected(const process::Future<Option<MasterInfo>>& pid); - enum State { + enum State + { RECOVERING, // Slave is doing recovery. DISCONNECTED, // Slave is not connected to the master. RUNNING, // Slave has (re-)registered. @@ -571,7 +572,8 @@ struct Executor // Returns true if this is a command executor. bool isCommandExecutor() const; - enum State { + enum State + { REGISTERING, // Executor is launched but not (re-)registered yet. RUNNING, // Executor has (re-)registered. TERMINATING, // Executor is being shutdown/killed. @@ -649,7 +651,8 @@ struct Framework const FrameworkID id() const { return info.id(); } - enum State { + enum State + { RUNNING, // First state of a newly created framework. TERMINATING, // Framework is shutting down in the cluster. } state; http://git-wip-us.apache.org/repos/asf/mesos/blob/9d4ac11e/src/state/zookeeper.cpp ---------------------------------------------------------------------- diff --git a/src/state/zookeeper.cpp b/src/state/zookeeper.cpp index 54ee88c..03bca42 100644 --- a/src/state/zookeeper.cpp +++ b/src/state/zookeeper.cpp @@ -113,7 +113,9 @@ private: Watcher* watcher; ZooKeeper* zk; - enum State { // ZooKeeper connection state. + // ZooKeeper connection state. + enum State + { DISCONNECTED, CONNECTING, CONNECTED, http://git-wip-us.apache.org/repos/asf/mesos/blob/9d4ac11e/src/tests/containerizer/docker_containerizer_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/containerizer/docker_containerizer_tests.cpp b/src/tests/containerizer/docker_containerizer_tests.cpp index fb86cfe..c8c27a6 100644 --- a/src/tests/containerizer/docker_containerizer_tests.cpp +++ b/src/tests/containerizer/docker_containerizer_tests.cpp @@ -183,7 +183,8 @@ public: slave::DOCKER_NAME_SEPERATOR + containerId.value(); } - enum ContainerState { + enum ContainerState + { EXISTS, RUNNING }; http://git-wip-us.apache.org/repos/asf/mesos/blob/9d4ac11e/src/zookeeper/group.hpp ---------------------------------------------------------------------- diff --git a/src/zookeeper/group.hpp b/src/zookeeper/group.hpp index 8021e3b..738210f 100644 --- a/src/zookeeper/group.hpp +++ b/src/zookeeper/group.hpp @@ -278,7 +278,8 @@ private: // the client's "progress" in setting up the group is preserved // across reconnections. This means authenticate() and create() are // only successfully executed once in one ZooKeeper session. - enum State { + enum State + { DISCONNECTED, // The initial state. CONNECTING, // ZooKeeper connecting. CONNECTED, // ZooKeeper connected but before group setup.
