From: Arnaud Giersch Date: Mon, 14 Nov 2011 10:21:06 +0000 (+0100) Subject: Use defined interface for accessing to lib properties. X-Git-Tag: exp_20120216~308 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a28a695108f7e9ae7dafc83a2d39d17778f5fc98 Use defined interface for accessing to lib properties. --- diff --git a/src/msg/msg_host.c b/src/msg/msg_host.c index 9b6688ca5f..bcd8b8f79e 100644 --- a/src/msg/msg_host.c +++ b/src/msg/msg_host.c @@ -148,7 +148,7 @@ void __MSG_host_destroy(m_host_t host) */ int MSG_get_host_number(void) { - return host_lib->count; + return xbt_lib_length(host_lib); } /** \ingroup m_host_management @@ -162,10 +162,10 @@ m_host_t *MSG_get_host_table(void) char *key; void **data; - if (host_lib->count == 0) + if (xbt_lib_length(host_lib) == 0) return NULL; else - array = xbt_new0(void *, host_lib->count); + array = xbt_new0(void *, xbt_lib_length(host_lib)); xbt_lib_foreach(host_lib, cursor, key, data) { if(routing_get_network_element_type(key) == SURF_NETWORK_ELEMENT_HOST) diff --git a/src/simdag/sd_dotloader.c b/src/simdag/sd_dotloader.c index 801315ed4f..25795b68eb 100644 --- a/src/simdag/sd_dotloader.c +++ b/src/simdag/sd_dotloader.c @@ -318,7 +318,7 @@ void dot_add_task(Agnode_t * dag_node) computer = xbt_dynar_new(sizeof(SD_task_t), NULL); xbt_dict_set(computers, char_performer, computer, NULL); } - if(performer < host_lib->count){ + if(performer < xbt_lib_length(host_lib)){ // the wanted computer is available SD_task_t *task_test = NULL; if(order < computer->used) diff --git a/src/simdag/sd_link.c b/src/simdag/sd_link.c index 5308684d18..2cf0faa24e 100644 --- a/src/simdag/sd_link.c +++ b/src/simdag/sd_link.c @@ -51,7 +51,7 @@ const SD_link_t *SD_link_get_list(void) int i; if (sd_global->link_list == NULL) { /* this is the first time the function is called */ - sd_global->link_list = xbt_new(SD_link_t, link_lib->count); + sd_global->link_list = xbt_new(SD_link_t, xbt_lib_length(link_lib)); i = 0; xbt_lib_foreach(link_lib, cursor, key, data) { @@ -69,7 +69,7 @@ const SD_link_t *SD_link_get_list(void) */ int SD_link_get_number(void) { - return link_lib->count; + return xbt_lib_length(link_lib); } /** diff --git a/src/simdag/sd_workstation.c b/src/simdag/sd_workstation.c index 938e2236b7..1f15df9603 100644 --- a/src/simdag/sd_workstation.c +++ b/src/simdag/sd_workstation.c @@ -70,7 +70,7 @@ const SD_workstation_t *SD_workstation_get_list(void) if (sd_global->workstation_list == NULL) { /* this is the first time the function is called */ sd_global->workstation_list = - xbt_new(SD_workstation_t, host_lib->count); + xbt_new(SD_workstation_t, xbt_lib_length(host_lib)); i = 0; xbt_lib_foreach(host_lib, cursor, key, data) { @@ -89,7 +89,7 @@ const SD_workstation_t *SD_workstation_get_list(void) */ int SD_workstation_get_number(void) { - return host_lib->count; + return xbt_lib_length(host_lib); } /**