X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b08257d400b0767a4e90203480b050c28efa3299..91d05079e37bf2fdd32ee099cff06e2cae7c74cd:/teshsuite/simdag/availability/availability.c diff --git a/teshsuite/simdag/availability/availability.c b/teshsuite/simdag/availability/availability.c index 1a0bfafcf6..20867eeba7 100644 --- a/teshsuite/simdag/availability/availability.c +++ b/teshsuite/simdag/availability/availability.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2015. The SimGrid Team. +/* Copyright (c) 2013-2020. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -12,17 +12,17 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test,"Logging for the current example"); static int name_compare_hosts(const void *n1, const void *n2) { - return strcmp(sg_host_get_name(*(sg_host_t *) n1), sg_host_get_name(*(sg_host_t *) n2)); + return strcmp(sg_host_get_name(*(const sg_host_t*)n1), sg_host_get_name(*(const sg_host_t*)n2)); } -static void scheduleDAX(xbt_dynar_t dax) +static void scheduleDAX(const_xbt_dynar_t dax) { unsigned int cursor; SD_task_t task; sg_host_t *hosts = sg_host_list(); - int totalHosts = sg_host_count(); - qsort((void *) hosts, totalHosts, sizeof(sg_host_t), name_compare_hosts); + size_t totalHosts = sg_host_count(); + qsort(hosts, totalHosts, sizeof(sg_host_t), name_compare_hosts); xbt_dynar_foreach(dax, cursor, task) { if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) { @@ -51,6 +51,7 @@ int main(int argc, char *argv[]) scheduleDAX(dax); XBT_INFO("DAX scheduled"); SD_simulate(-1); + XBT_INFO("Simulation done."); // Free memory @@ -59,6 +60,5 @@ int main(int argc, char *argv[]) SD_task_destroy(task); } xbt_dynar_free(&dax); - SD_exit(); return 0; }