Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use correct type for variables, and avoid loosing precision.
[simgrid.git] / teshsuite / simdag / basic-parsing-test / basic-parsing-test.c
index 4a075a8..5464341 100644 (file)
@@ -37,11 +37,11 @@ int main(int argc, char **argv)
       xbt_dynar_free_container(&route);
     }
     if (!strcmp(argv[2], "FULL_LINK")) {
-      int list_size = sg_host_count();
-      for (int i = 0; i < list_size; i++) {
+      size_t list_size = sg_host_count();
+      for (size_t i = 0; i < list_size; i++) {
         const_sg_host_t h1 = hosts[i];
         const char *name1 = sg_host_get_name(h1);
-        for (int j = 0; j < list_size; j++) {
+        for (size_t j = 0; j < list_size; j++) {
           const_sg_host_t h2 = hosts[j];
           const char *name2 = sg_host_get_name(h2);
           fprintf(stderr, "Route between %s and %s\n", name1, name2);