-/* 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
void PJ_type_free (type_t type)
{
- val_t value;
+ value* val;
char *value_name;
xbt_dict_cursor_t cursor = nullptr;
- xbt_dict_foreach(type->values, cursor, value_name, value) {
- XBT_DEBUG("free value %s, child of %s", value->name, value->father->name);
- xbt_free(value->name);
- xbt_free(value->color);
- xbt_free(value->id);
- xbt_free(value);
+ xbt_dict_foreach (type->values, cursor, value_name, val) {
+ XBT_DEBUG("free value %s, child of %s", val->name, val->father->name);
+ xbt_free(val);
}
xbt_dict_free (&type->values);
xbt_free (type->name);
THROWF (tracing_error, 0, "can't create a container type with a nullptr name");
}
- type_t ret = nullptr;
-
- ret = newType (name, name, nullptr, TYPE_CONTAINER, father);
- if (father == nullptr){
+ type_t ret = newType(name, name, nullptr, TYPE_CONTAINER, father);
+ if (father == nullptr) {
rootType = ret;
- }
-
- if(father){
+ } else {
XBT_DEBUG("ContainerType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
DefineContainerEvent(ret);
}
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);