/* a generic DYNamic ARray implementation. */
-/* Copyright (c) 2004-2014. The SimGrid Team.
+/* Copyright (c) 2004-2015. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
/* 1. Populate the dynar */
for (cpt = 0; cpt < NB_ELEM; cpt++) {
sprintf(buf, "%d", cpt);
- s1 = strdup(buf);
+ s1 = xbt_strdup(buf);
xbt_dynar_push(d, &s1);
}
for (cpt = 0; cpt < NB_ELEM; cpt++) {
sprintf(buf, "%d", cpt);
- s1 = strdup(buf);
+ s1 = xbt_strdup(buf);
xbt_dynar_replace(d, cpt, &s1);
}
for (cpt = 0; cpt < NB_ELEM; cpt++) {
sprintf(buf, "%d", cpt);
- s1 = strdup(buf);
+ s1 = xbt_strdup(buf);
xbt_dynar_replace(d, cpt, &s1);
}
for (cpt = 0; cpt < NB_ELEM; cpt++) {
sprintf(buf, "%d", cpt);
- s1 = strdup(buf);
+ s1 = xbt_strdup(buf);
xbt_dynar_replace(d, cpt, &s1);
}
for (cpt = 0; cpt < NB_ELEM; cpt++) {
d = xbt_dynar_new(sizeof(char **), &xbt_free_ref);
for (cpt = 0; cpt < NB_ELEM; cpt++) {
sprintf(buf, "%d", cpt);
- s1 = strdup(buf);
+ s1 = xbt_strdup(buf);
xbt_dynar_unshift(d, &s1);
}
/* 2. Traverse the dynar with the macro */
d = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
for (cpt = 0; cpt < NB_ELEM; cpt++) {
sprintf(buf, "%d", cpt);
- s1 = strdup(buf);
+ s1 = xbt_strdup(buf);
xbt_dynar_push(d, &s1);
}
for (cpt = 0; cpt < NB_ELEM / 5; cpt++) {
sprintf(buf, "%d", cpt);
- s1 = strdup(buf);
+ s1 = xbt_strdup(buf);
xbt_dynar_insert_at(d, NB_ELEM / 2, &s1);
}
d = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
for (cpt = 0; cpt < NB_ELEM; cpt++) {
sprintf(buf, "%d", cpt);
- s1 = strdup(buf);
+ s1 = xbt_strdup(buf);
xbt_dynar_push(d, &s1);
}
for (cpt = 2 * (NB_ELEM / 5); cpt < 4 * (NB_ELEM / 5); cpt++) {