X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/767a7a537b2ac742705d23b8dcb25d64cd36a2ee..3031d855f96e457fd7bf25e90c10440a39747567:/examples/msg/app-bittorrent/bittorrent.c diff --git a/examples/msg/app-bittorrent/bittorrent.c b/examples/msg/app-bittorrent/bittorrent.c index 4fc3fb19e1..c88b708e5b 100644 --- a/examples/msg/app-bittorrent/bittorrent.c +++ b/examples/msg/app-bittorrent/bittorrent.c @@ -13,7 +13,6 @@ /** Bittorrent example launcher */ int main(int argc, char *argv[]) { - xbt_dynar_t host_list; msg_host_t host; unsigned i; @@ -27,13 +26,12 @@ int main(int argc, char *argv[]) MSG_create_environment(platform_file); - host_list = MSG_hosts_as_dynar(); + xbt_dynar_t host_list = MSG_hosts_as_dynar(); xbt_dynar_foreach(host_list, i, host) { char descr[512]; - RngStream stream; snprintf(descr, sizeof descr, "RngSream<%s>", MSG_host_get_name(host)); - stream = RngStream_CreateStream(descr); - MSG_host_set_property_value(host, "stream", (char*)stream, NULL); + RngStream stream = RngStream_CreateStream(descr); + MSG_host_set_data(host, stream); } MSG_function_register("tracker", tracker); @@ -44,8 +42,9 @@ int main(int argc, char *argv[]) MSG_main(); xbt_dynar_foreach(host_list, i, host) { - RngStream stream = (RngStream) MSG_host_get_property_value(host, "stream"); + RngStream stream = (RngStream)MSG_host_get_data(host); RngStream_DeleteStream(&stream); + MSG_host_set_data(host, NULL); } xbt_dynar_free(&host_list);