From: Arnaud Legrand Date: Mon, 5 Mar 2012 10:09:57 +0000 (+0100) Subject: Cosmetics + warning X-Git-Tag: v3_7~315^2~27^2~7 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a56eb951f2c264a3a1c8d8955c64903b75f62c02?ds=sidebyside Cosmetics + warning --- diff --git a/src/surf/cpu_cas01.c b/src/surf/cpu_cas01.c index c94bf46744..3d00787367 100644 --- a/src/surf/cpu_cas01.c +++ b/src/surf/cpu_cas01.c @@ -314,15 +314,12 @@ static double cpu_share_resources_lazy(double now) GENERIC_ACTION(action).start, now + value, GENERIC_ACTION(action).max_duration); - if (action->index_heap >= 0) { - heap_remove(action); - } - if (min != -1) { + heap_remove(action); heap_insert(action, min, max_dur_flag ? MAX_DURATION : NORMAL); XBT_DEBUG("Insert at heap action(%p) min %lf now %lf", action, min, now); - } + } else DIE_IMPOSSIBLE; } //hereafter must have already the min value for this resource model diff --git a/src/surf/network.c b/src/surf/network.c index e2d92fd8b9..0e1bcab338 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -509,15 +509,12 @@ static double net_share_resources_lazy(double now) GENERIC_ACTION(action).start, now + value, GENERIC_ACTION(action).max_duration); - if (action->index_heap >= 0) { - heap_remove(action); - } - if (min != -1) { + heap_remove(action); heap_insert(action, min, max_dur_flag ? MAX_DURATION : NORMAL); XBT_DEBUG("Insert at heap action(%p) min %lf now %lf", action, min, now); - } + } else DIE_IMPOSSIBLE; } //hereafter must have already the min value for this resource model