Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
our code is so entertaining
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 27 Feb 2016 22:25:02 +0000 (23:25 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 27 Feb 2016 22:25:02 +0000 (23:25 +0100)
teshsuite/simdag/platforms/flatifier.cpp

index 690a21d..22d747a 100644 (file)
@@ -166,9 +166,7 @@ int main(int argc, char **argv)
           for(i=0;i<xbt_dynar_length(route) ;i++){
             void *link = xbt_dynar_get_as(route,i,void *);
 
-            char *link_name = xbt_strdup(surf_resource_name((surf_cpp_resource_t)link));
-            printf("<%s id=\"%s\"/>",link_ctn,link_name);
-            free(link_name);
+            printf("<%s id=\"%s\"/>",link_ctn,surf_resource_name((surf_cpp_resource_t)link));
           }
           printf("\n  </route>\n");
         }
@@ -200,9 +198,7 @@ int main(int argc, char **argv)
             for(i=0;i<xbt_dynar_length(route) ;i++){
               void *link = xbt_dynar_get_as(route,i,void *);
 
-              char *link_name = xbt_strdup(surf_resource_name((surf_cpp_resource_t)link));
-              printf("<%s id=\"%s\"/>",link_ctn,link_name);
-              free(link_name);
+              printf("<%s id=\"%s\"/>",link_ctn,surf_resource_name((surf_cpp_resource_t)link));
             }
             printf("\n  </route>\n");
           }
@@ -215,9 +211,7 @@ int main(int argc, char **argv)
           for(i=0;i<xbt_dynar_length(route) ;i++){
             void *link = xbt_dynar_get_as(route,i,void *);
 
-            char *link_name = xbt_strdup(surf_resource_name((surf_cpp_resource_t)link));
-            printf("<%s id=\"%s\"/>",link_ctn,link_name);
-            free(link_name);
+            printf("<%s id=\"%s\"/>",link_ctn,surf_resource_name((surf_cpp_resource_t)link));
           }
           printf("\n  </route>\n");
         }