From: Martin Quinson Date: Mon, 28 Aug 2017 10:05:10 +0000 (+0200) Subject: instr: please sonar X-Git-Tag: v3_17~196 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c96825e4f16cdc4c25162b5a11d8b8514344444d instr: please sonar - Use initialization lists - Don't have C++ declarations within the extern "C" block --- diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index 700a8986fe..6fd944404f 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -22,14 +22,13 @@ simgrid::instr::Type* PJ_type_get_root() simgrid::instr::Type::Type(const char* typeNameBuff, const char* key, const char* color, e_entity_types kind, Type* father) + : kind_(kind), father_(father) { if (typeNameBuff == nullptr || key == nullptr){ THROWF(tracing_error, 0, "can't create a new type with name or key equal nullptr"); } this->name_ = xbt_strdup(typeNameBuff); - this->father_ = father; - this->kind_ = kind; this->children_ = xbt_dict_new_homogeneous(nullptr); this->values_ = xbt_dict_new_homogeneous(nullptr); this->color_ = xbt_strdup(color); diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index 5c060711d0..4a95ba3e87 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -14,8 +14,6 @@ #include "src/internal_config.h" #include -SG_BEGIN_DECL() - /* Need to define function drand48 for Windows */ /* FIXME: use _drand48() defined in src/surf/random_mgr.c instead */ #ifdef _WIN32 @@ -283,6 +281,8 @@ class NewEvent : public PajeEvent { } // namespace simgrid::instr typedef simgrid::instr::s_container* container_t; +SG_BEGIN_DECL() + extern XBT_PRIVATE std::set created_categories; extern XBT_PRIVATE std::set declared_marks; extern XBT_PRIVATE std::set user_host_variables;