Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
instr: please sonar
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 28 Aug 2017 10:05:10 +0000 (12:05 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 28 Aug 2017 10:08:23 +0000 (12:08 +0200)
- Use initialization lists
- Don't have C++ declarations within the extern "C" block

src/instr/instr_paje_types.cpp
src/instr/instr_private.h

index 700a898..6fd9444 100644 (file)
@@ -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);
index 5c06071..4a95ba3 100644 (file)
@@ -14,8 +14,6 @@
 #include "src/internal_config.h"
 #include <set>
 
-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<std::string> created_categories;
 extern XBT_PRIVATE std::set<std::string> declared_marks;
 extern XBT_PRIVATE std::set<std::string> user_host_variables;