int main(int argc, char **argv)
{
- sg_host_t hostA = NULL;
- sg_host_t hostB = NULL;
+ sg_host_t hostA = nullptr;
+ sg_host_t hostB = nullptr;
double now = -1.0;
int running;
surf_solve(-1.0); /* Takes traces into account. Returns 0.0 */
do {
- surf_action_t action = NULL;
+ surf_action_t action = nullptr;
unsigned int iter;
- surf_model_t model = NULL;
+ surf_model_t model = nullptr;
running = 0;
now = surf_get_clock();
XBT_DEBUG("\t Running that model");
running = 1;
}
- while ((action = surf_model_extract_failed_action_set((surf_model_t)model))) {
+
+ action = surf_model_extract_failed_action_set(static_cast<surf_model_t>(model));
+ while (action != nullptr) {
XBT_INFO(" * Done Action");
XBT_DEBUG("\t * Failed Action: %p", action);
action->unref();
+ action = surf_model_extract_failed_action_set(static_cast<surf_model_t>(model));
}
- while ((action = surf_model_extract_done_action_set((surf_model_t)model))) {
+
+ action = surf_model_extract_done_action_set(static_cast<surf_model_t>(model));
+ while (action != nullptr){
XBT_INFO(" * Done Action");
XBT_DEBUG("\t * Done Action: %p", action);
action->unref();
+ action = surf_model_extract_done_action_set(static_cast<surf_model_t>(model));
}
}
} while (running && surf_solve(-1.0) >= 0.0);