X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5809f0f4cd75ca84bb4b4f47185801ddd054c462..a21681e5aca1a37efb2e9001e5055dec94c5de41:/src/surf/cpu_interface.cpp diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index dd9ee5a276..fa64436210 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -13,7 +13,6 @@ CpuModelPtr surf_cpu_model_vm; void CpuModel::updateActionsStateLazy(double now, double /*delta*/) { - void *_action; CpuActionLmmPtr action; while ((xbt_heap_size(getActionHeap()) > 0) && (double_equals(xbt_heap_maxkey(getActionHeap()), now))) { @@ -44,9 +43,10 @@ void CpuModel::updateActionsStateLazy(double now, double /*delta*/) //defining the last timestamp that we can safely dump to trace file //without losing the event ascending order (considering all CPU's) double smaller = -1; - xbt_swag_t actionSet = getRunningActionSet(); - xbt_swag_foreach(_action, actionSet) { - action = dynamic_cast(static_cast(_action)); + ActionListPtr actionSet = getRunningActionSet(); + for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end()) + ; it != itend ; ++it) { + action = dynamic_cast(&*it); if (smaller < 0) { smaller = action->getLastUpdate(); continue; @@ -65,12 +65,13 @@ void CpuModel::updateActionsStateLazy(double now, double /*delta*/) void CpuModel::updateActionsStateFull(double now, double delta) { - void *_action, *_next_action; CpuActionLmmPtr action = NULL; - xbt_swag_t running_actions = getRunningActionSet(); + ActionListPtr running_actions = getRunningActionSet(); - xbt_swag_foreach_safe(_action, _next_action, running_actions) { - action = dynamic_cast(static_cast(_action)); + for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end()) + ; it != itend ; it=itNext) { + ++itNext; + action = dynamic_cast(&*it); #ifdef HAVE_TRACING if (TRACE_is_enabled()) { CpuPtr x = (CpuPtr) lmm_constraint_id(lmm_get_cnst_from_var