From 0a98fa4bac26588eb237170bf45e9a44df01262a Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Thu, 7 Feb 2019 04:00:00 +0100 Subject: [PATCH] Fix codacy issues --- fairmq/plugins/PMIx/PMIx.hpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fairmq/plugins/PMIx/PMIx.hpp b/fairmq/plugins/PMIx/PMIx.hpp index 795d0846..ff4f55de 100644 --- a/fairmq/plugins/PMIx/PMIx.hpp +++ b/fairmq/plugins/PMIx/PMIx.hpp @@ -46,9 +46,11 @@ struct rank wildcard = PMIX_RANK_WILDCARD, local_node = PMIX_RANK_LOCAL_NODE }; - rank(pmix_rank_t r) + + explicit rank(pmix_rank_t r) : m_value(r) {} + operator pmix_rank_t() { return m_value; } private: @@ -59,6 +61,7 @@ struct proc : pmix_proc_t { proc() { PMIX_PROC_CONSTRUCT(static_cast(this)); } ~proc() { PMIX_PROC_DESTRUCT(static_cast(this)); } + proc(pmix::nspace ns, pmix::rank r) { PMIX_PROC_LOAD(static_cast(this), ns, static_cast(r)); @@ -80,16 +83,19 @@ struct value : pmix_value_t // { // PMIX_VALUE_LOAD(static_cast(this), const_cast(val), dt); // } + template - value(T) + explicit value(T) { throw runtime_error("Given value type not supported or not yet implemented."); } - value(const char* val) + + explicit value(const char* val) { PMIX_VALUE_LOAD(static_cast(this), const_cast(val), PMIX_STRING); } - value(const std::string& val) + + explicit value(const std::string& val) { PMIX_VALUE_LOAD( static_cast(this), const_cast(val.c_str()), PMIX_STRING);