Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reduce scope of variables (please Codacy).
[simgrid.git] / src / instr / instr_paje_types.cpp
index 389ff98..792fc4c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2014-2015. The SimGrid Team.
+/* Copyright (c) 2012, 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@ void PJ_type_free (type_t type)
   xbt_dict_cursor_t cursor = nullptr;
   xbt_dict_foreach (type->values, cursor, value_name, val) {
     XBT_DEBUG("free value %s, child of %s", val->name, val->father->name);
-    delete val;
+    xbt_free(val);
   }
   xbt_dict_free (&type->values);
   xbt_free (type->name);
@@ -142,8 +142,8 @@ type_t PJ_type_variable_new (const char *name, const char *color, type_t father)
 
   type_t ret = nullptr;
 
-  char white[INSTR_DEFAULT_STR_SIZE] = "1 1 1";
   if (not color) {
+    char white[INSTR_DEFAULT_STR_SIZE] = "1 1 1";
     ret = newType (name, name, white, TYPE_VARIABLE, father);
   }else{
     ret = newType (name, name, color, TYPE_VARIABLE, father);