A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't store raw objects as host properties, which must be strings
[simgrid.git]
/
examples
/
msg
/
app-bittorrent
/
bittorrent.c
diff --git
a/examples/msg/app-bittorrent/bittorrent.c
b/examples/msg/app-bittorrent/bittorrent.c
index
4fc3fb1
..
c88b708
100644
(file)
--- 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[])
{
/** Bittorrent example launcher */
int main(int argc, char *argv[])
{
- xbt_dynar_t host_list;
msg_host_t host;
unsigned i;
msg_host_t host;
unsigned i;
@@
-27,13
+26,12
@@
int main(int argc, char *argv[])
MSG_create_environment(platform_file);
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];
xbt_dynar_foreach(host_list, i, host) {
char descr[512];
- RngStream stream;
snprintf(descr, sizeof descr, "RngSream<%s>", MSG_host_get_name(host));
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);
}
MSG_function_register("tracker", tracker);
@@
-44,8
+42,9
@@
int main(int argc, char *argv[])
MSG_main();
xbt_dynar_foreach(host_list, i, host) {
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);
RngStream_DeleteStream(&stream);
+ MSG_host_set_data(host, NULL);
}
xbt_dynar_free(&host_list);
}
xbt_dynar_free(&host_list);