Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
codacy
[simgrid.git] / src / xbt / log.c
index 44af691..9b215b3 100644 (file)
@@ -112,9 +112,7 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(xbt_exception);
   XBT_LOG_CONNECT(xbt_graph);
   XBT_LOG_CONNECT(xbt_heap);
-  XBT_LOG_CONNECT(xbt_lib);
   XBT_LOG_CONNECT(xbt_mallocator);
-  XBT_LOG_CONNECT(xbt_matrix);
   XBT_LOG_CONNECT(xbt_memory_map);
   XBT_LOG_CONNECT(xbt_parmap);
   XBT_LOG_CONNECT(xbt_sync);
@@ -145,8 +143,6 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(instr_resource);
   XBT_LOG_CONNECT(instr_routing);
   XBT_LOG_CONNECT(instr_surf);
-  XBT_LOG_CONNECT(instr_trace);
-  XBT_LOG_CONNECT(instr_TI_trace);
 
   /* jedule */
 #if SIMGRID_HAVE_JEDULE
@@ -203,7 +199,7 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(s4u_channel);
   XBT_LOG_CONNECT(s4u_comm);
   XBT_LOG_CONNECT(s4u_file);
-   
+
   /* sg */
   XBT_LOG_CONNECT(sg_host);
 
@@ -263,7 +259,7 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(surf_trace);
   XBT_LOG_CONNECT(surf_vm);
   XBT_LOG_CONNECT(surf_host);
-   
+
 #endif /* simgrid_EXPORTS */
 }
 
@@ -461,7 +457,6 @@ int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority
 
   unsigned int cursor;
   xbt_log_setting_t setting = NULL;
-  int found = 0;
 
   XBT_DEBUG("Initializing category '%s' (firstChild=%s, nextSibling=%s)", category->name,
          (category->firstChild ? category->firstChild->name : "none"),
@@ -506,6 +501,7 @@ int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority
   if (xbt_log_settings) {
     xbt_assert(category, "NULL category");
     xbt_assert(category->name);
+    int found = 0;
 
     xbt_dynar_foreach(xbt_log_settings, cursor, setting) {
       xbt_assert(setting, "Damnit, NULL cat in the list");
@@ -759,10 +755,8 @@ void xbt_log_control_set(const char *control_string)
 
   /* Parse each entry and either use it right now (if the category was already created), or store it for further use */
   xbt_dynar_foreach(set_strings, cpt, str) {
-    xbt_log_category_t cat = NULL;
-
     set = _xbt_log_parse_setting(str);
-    cat = _xbt_log_cat_searchsub(&_XBT_LOGV(XBT_LOG_ROOT_CAT), set->catname);
+    xbt_log_category_t cat = _xbt_log_cat_searchsub(&_XBT_LOGV(XBT_LOG_ROOT_CAT), set->catname);
 
     if (cat) {
       XBT_DEBUG("Apply directly");