X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1062a562502ee5cd09a6577400df729eb60a70c5..79f4c4c467150b3bea841b968cabd629e9d9282a:/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 fb39c8aa0d..17972b6512 100644 --- a/examples/deprecated/simdag/scheduling/sd_scheduling.c +++ b/examples/deprecated/simdag/scheduling/sd_scheduling.c @@ -24,26 +24,26 @@ struct _HostAttribute { static double sg_host_get_available_at(sg_host_t host) { - HostAttribute attr = (HostAttribute) sg_host_user(host); + HostAttribute attr = (HostAttribute)sg_host_data(host); return attr->available_at; } static void sg_host_set_available_at(sg_host_t host, double time) { - HostAttribute attr = (HostAttribute) sg_host_user(host); + HostAttribute attr = (HostAttribute)sg_host_data(host); attr->available_at = time; - sg_host_user_set(host, attr); + 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_user(host); + HostAttribute attr = (HostAttribute)sg_host_data(host); return attr->last_scheduled_task; } static void sg_host_set_last_scheduled_task(sg_host_t host, SD_task_t task){ - HostAttribute attr = (HostAttribute) sg_host_user(host); + HostAttribute attr = (HostAttribute)sg_host_data(host); attr->last_scheduled_task=task; - sg_host_user_set(host, attr); + sg_host_data_set(host, attr); } static xbt_dynar_t get_ready_tasks(xbt_dynar_t dax) @@ -155,11 +155,11 @@ int main(int argc, char **argv) SD_create_environment(argv[1]); /* Allocating the host attribute */ - int total_nhosts = sg_host_count(); + unsigned int total_nhosts = sg_host_count(); sg_host_t *hosts = sg_host_list(); for (cursor = 0; cursor < total_nhosts; cursor++) - sg_host_user_set(hosts[cursor], xbt_new0(struct _HostAttribute, 1)); + sg_host_data_set(hosts[cursor], xbt_new0(struct _HostAttribute, 1)); /* load the DAX file */ xbt_dynar_t dax = SD_daxload(argv[2]); @@ -246,8 +246,8 @@ int main(int argc, char **argv) xbt_dynar_free_container(&dax); for (cursor = 0; cursor < total_nhosts; cursor++) { - free(sg_host_user(hosts[cursor])); - sg_host_user_set(hosts[cursor], NULL); + free(sg_host_data(hosts[cursor])); + sg_host_data_set(hosts[cursor], NULL); } xbt_free(hosts);