diff options
author | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2016-01-28 16:36:23 +0100 |
---|---|---|
committer | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2016-01-29 23:48:58 +0100 |
commit | bbf0582342437d8deec7a42f395a33b0f09a1ed7 (patch) | |
tree | 6fe5a5a8a097f16231b7f7cc2663165ac0d36941 /src/erasure-code | |
parent | rgw/rgw_rest.cc: fix -Wsign-compare (diff) | |
download | ceph-bbf0582342437d8deec7a42f395a33b0f09a1ed7.tar.xz ceph-bbf0582342437d8deec7a42f395a33b0f09a1ed7.zip |
make ctors with one argument explicit
Use explicit keyword for constructors with one argument to
prevent implicit usage as conversion functions.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Diffstat (limited to 'src/erasure-code')
-rw-r--r-- | src/erasure-code/jerasure/ErasureCodeJerasure.h | 6 | ||||
-rw-r--r-- | src/erasure-code/lrc/ErasureCodeLrc.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/erasure-code/jerasure/ErasureCodeJerasure.h b/src/erasure-code/jerasure/ErasureCodeJerasure.h index df60dac6a35..67fc360a67e 100644 --- a/src/erasure-code/jerasure/ErasureCodeJerasure.h +++ b/src/erasure-code/jerasure/ErasureCodeJerasure.h @@ -36,7 +36,7 @@ public: string ruleset_failure_domain; bool per_chunk_alignment; - ErasureCodeJerasure(const char *_technique) : + explicit ErasureCodeJerasure(const char *_technique) : k(0), DEFAULT_K("2"), m(0), @@ -155,7 +155,7 @@ public: int **schedule; int packetsize; - ErasureCodeJerasureCauchy(const char *technique) : + explicit ErasureCodeJerasureCauchy(const char *technique) : ErasureCodeJerasure(technique), bitmatrix(0), schedule(0) @@ -208,7 +208,7 @@ public: int **schedule; int packetsize; - ErasureCodeJerasureLiberation(const char *technique = "liberation") : + explicit ErasureCodeJerasureLiberation(const char *technique = "liberation") : ErasureCodeJerasure(technique), bitmatrix(0), schedule(0) diff --git a/src/erasure-code/lrc/ErasureCodeLrc.h b/src/erasure-code/lrc/ErasureCodeLrc.h index ffc7748c0c9..e54688a97bb 100644 --- a/src/erasure-code/lrc/ErasureCodeLrc.h +++ b/src/erasure-code/lrc/ErasureCodeLrc.h @@ -49,7 +49,7 @@ public: static const string DEFAULT_KML; struct Layer { - Layer(string _chunks_map) : chunks_map(_chunks_map) { } + explicit Layer(string _chunks_map) : chunks_map(_chunks_map) { } ErasureCodeInterfaceRef erasure_code; vector<int> data; vector<int> coding; @@ -74,7 +74,7 @@ public: }; vector<Step> ruleset_steps; - ErasureCodeLrc(const std::string &dir) + explicit ErasureCodeLrc(const std::string &dir) : directory(dir), chunk_count(0), data_chunk_count(0), ruleset_root("default") { |