X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/98a4fb37cf38be98161ec6fc43ed0733eaefcbee..84402e8e2ee2a2d0bef25fdceb0a263ed8b471f6:/examples/deprecated/simdag/scheduling/sd_scheduling.c diff --git a/examples/deprecated/simdag/scheduling/sd_scheduling.c b/examples/deprecated/simdag/scheduling/sd_scheduling.c index c7cd717c58..927e7a52a6 100644 --- a/examples/deprecated/simdag/scheduling/sd_scheduling.c +++ b/examples/deprecated/simdag/scheduling/sd_scheduling.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2019. The SimGrid Team. +/* Copyright (c) 2009-2020. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -22,9 +22,9 @@ struct _HostAttribute { SD_task_t last_scheduled_task; }; -static double sg_host_get_available_at(sg_host_t host) +static double sg_host_get_available_at(const_sg_host_t host) { - HostAttribute attr = (HostAttribute)sg_host_data(host); + const struct _HostAttribute* attr = (HostAttribute)sg_host_data(host); return attr->available_at; } @@ -35,8 +35,9 @@ static void sg_host_set_available_at(sg_host_t host, double time) sg_host_data_set(host, attr); } -static SD_task_t sg_host_get_last_scheduled_task( sg_host_t host){ - HostAttribute attr = (HostAttribute)sg_host_data(host); +static SD_task_t sg_host_get_last_scheduled_task(const_sg_host_t host) +{ + const struct _HostAttribute* attr = (HostAttribute)sg_host_data(host); return attr->last_scheduled_task; } @@ -46,7 +47,7 @@ static void sg_host_set_last_scheduled_task(sg_host_t host, SD_task_t task){ sg_host_data_set(host, attr); } -static xbt_dynar_t get_ready_tasks(xbt_dynar_t dax) +static xbt_dynar_t get_ready_tasks(const_xbt_dynar_t dax) { unsigned int i; xbt_dynar_t ready_tasks; @@ -63,7 +64,7 @@ static xbt_dynar_t get_ready_tasks(xbt_dynar_t dax) return ready_tasks; } -static double finish_on_at(SD_task_t task, sg_host_t host) +static double finish_on_at(const_SD_task_t task, const_sg_host_t host) { double result; @@ -111,7 +112,7 @@ static double finish_on_at(SD_task_t task, sg_host_t host) return result; } -static sg_host_t SD_task_get_best_host(SD_task_t task) +static sg_host_t SD_task_get_best_host(const_SD_task_t task) { sg_host_t *hosts = sg_host_list(); int nhosts = sg_host_count();