X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/61e155ac26178e40e46c04728680a1cbd426cad4..585eeb393ae78877bab30573f224a2171074a6ca:/src/surf/maxmin.cpp diff --git a/src/surf/maxmin.cpp b/src/surf/maxmin.cpp index 095d6e0dca..72d2005543 100644 --- a/src/surf/maxmin.cpp +++ b/src/surf/maxmin.cpp @@ -16,11 +16,11 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_maxmin, surf, "Logging specific to SURF (maxmin)"); -typedef struct s_dyn_light { +struct s_dyn_light_t { int *data; int pos; int size; -} s_dyn_light_t; +}; typedef s_dyn_light_t* dyn_light_t; double sg_maxmin_precision = 0.00001; /* Change this with --cfg=maxmin/precision:VALUE */ @@ -298,7 +298,7 @@ int lmm_constraint_sharing_policy(lmm_constraint_t cnst) } /* @brief Remove a constraint - * Currently this is dead code, but it is exposed in maxmin.h + * Currently this is dead code, but it is exposed in maxmin.hpp * Apparently, this call was designed assuming that constraint would no more have elements in it. * If not the case, assertion will fail, and you need to add calls e.g. to lmm_shrink before effectively removing it. */ @@ -333,7 +333,7 @@ lmm_variable_t lmm_variable_new(lmm_system_t sys, simgrid::surf::Action* id, dou lmm_variable_t var = (lmm_variable_t)xbt_mallocator_get(sys->variable_mallocator); var->id = id; var->id_int = Global_debug_id++; - var->cnsts = (s_lmm_element_t *) xbt_realloc(var->cnsts, number_of_constraints * sizeof(s_lmm_element_t)); + var->cnsts = static_cast(xbt_realloc(var->cnsts, number_of_constraints * sizeof(s_lmm_element_t))); for (int i = 0; i < number_of_constraints; i++) { var->cnsts[i].enabled_element_set_hookup.next = nullptr; var->cnsts[i].enabled_element_set_hookup.prev = nullptr; @@ -774,8 +774,8 @@ void lmm_solve(lmm_system_t sys) } } - s_lmm_constraint_light_t *cnst_light_tab = - (s_lmm_constraint_light_t *)xbt_malloc0(xbt_swag_size(cnst_list)*sizeof(s_lmm_constraint_light_t)); + s_lmm_constraint_light_t* cnst_light_tab = + static_cast(xbt_malloc0(xbt_swag_size(cnst_list) * sizeof(s_lmm_constraint_light_t))); int cnst_light_num = 0; dyn_light_t saturated_constraint_set = xbt_new0(s_dyn_light_t,1); saturated_constraint_set->size = 5;