You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2016/03/12 03:55:34 UTC

[6/7] mesos git commit: Replaced `const string` slave constants with `constexpr char[]`.

Replaced `const string` slave constants with `constexpr char[]`.

Per style guide.

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


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

Branch: refs/heads/master
Commit: 716b47f0498ff05fb994bba16c00d468e200be80
Parents: d431f63
Author: Neil Conway <ne...@gmail.com>
Authored: Fri Mar 11 18:30:40 2016 -0800
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Fri Mar 11 18:30:40 2016 -0800

----------------------------------------------------------------------
 src/slave/constants.hpp | 6 +++---
 src/slave/flags.cpp     | 7 +++----
 2 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/716b47f0/src/slave/constants.hpp
----------------------------------------------------------------------
diff --git a/src/slave/constants.hpp b/src/slave/constants.hpp
index 7301ab2..4110061 100644
--- a/src/slave/constants.hpp
+++ b/src/slave/constants.hpp
@@ -71,7 +71,7 @@ constexpr Bytes DEFAULT_MEM = Gigabytes(1);
 constexpr Bytes DEFAULT_DISK = Gigabytes(10);
 
 // Default ports range offered by the slave.
-const std::string DEFAULT_PORTS = "[31000-32000]";
+constexpr char DEFAULT_PORTS[] = "[31000-32000]";
 
 // Default cpu resource given to a command executor.
 constexpr double DEFAULT_EXECUTOR_CPUS = 0.1;
@@ -98,7 +98,7 @@ constexpr Duration DOCKER_INSPECT_DELAY = Seconds(1);
 constexpr Duration DOCKER_VERSION_WAIT_TIMEOUT = Seconds(5);
 
 // Name of the default, CRAM-MD5 authenticatee.
-const std::string DEFAULT_AUTHENTICATEE = "crammd5";
+constexpr char DEFAULT_AUTHENTICATEE[] = "crammd5";
 
 // Default maximum storage space to be used by the fetcher cache.
 constexpr Bytes DEFAULT_FETCHER_CACHE_SIZE = Gigabytes(2);
@@ -112,7 +112,7 @@ constexpr int DOCKER_PS_MAX_INSPECT_CALLS = 100;
 Duration DEFAULT_MASTER_PING_TIMEOUT();
 
 // Container path that the slave sets to mount the command executor rootfs to.
-const std::string COMMAND_EXECUTOR_ROOTFS_CONTAINER_PATH = ".rootfs";
+constexpr char COMMAND_EXECUTOR_ROOTFS_CONTAINER_PATH[] = ".rootfs";
 
 } // namespace slave {
 } // namespace internal {

http://git-wip-us.apache.org/repos/asf/mesos/blob/716b47f0/src/slave/flags.cpp
----------------------------------------------------------------------
diff --git a/src/slave/flags.cpp b/src/slave/flags.cpp
index eb47015..5bacf10 100644
--- a/src/slave/flags.cpp
+++ b/src/slave/flags.cpp
@@ -27,6 +27,7 @@
 
 #include "slave/constants.hpp"
 
+using std::string;
 
 mesos::internal::slave::Flags::Flags()
 {
@@ -656,10 +657,8 @@ mesos::internal::slave::Flags::Flags()
   add(&Flags::authenticatee,
       "authenticatee",
       "Authenticatee implementation to use when authenticating against the\n"
-      "master. Use the default `" +
-        DEFAULT_AUTHENTICATEE +
-        "`, or\n"
-        "load an alternate authenticatee module using `--modules`.",
+      "master. Use the default `" + string(DEFAULT_AUTHENTICATEE) + "`, or\n"
+      "load an alternate authenticatee module using `--modules`.",
       DEFAULT_AUTHENTICATEE);
 
   add(&Flags::hooks,