Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Indent include and src using this command:
[simgrid.git] / src / instr / variables_instr.c
index aed99a1..303eada 100644 (file)
 
 extern routing_global_t global_routing;
 
-void TRACE_user_link_variable (double time, const char *src, const char *dst, const char *variable, double value, const char *what)
+void TRACE_user_link_variable(double time, const char *src,
+                              const char *dst, const char *variable,
+                              double value, const char *what)
 {
-  if (!IS_TRACING || !IS_TRACING_PLATFORM) return;
+  if (!IS_TRACING || !IS_TRACING_PLATFORM)
+    return;
 
   char valuestr[100];
-  snprintf (valuestr, 100, "%g", value);
+  snprintf(valuestr, 100, "%g", value);
 
-  if (strcmp (what, "declare") == 0){
-    pajeDefineVariableType (variable, "LINK", variable);
+  if (strcmp(what, "declare") == 0) {
+    pajeDefineVariableType(variable, "LINK", variable);
     return;
   }
 
-  if (!global_routing) return;
+  if (!global_routing)
+    return;
 
   xbt_dynar_t route = global_routing->get_route(src, dst);
   unsigned int i;
   void *link_ptr;
   xbt_dynar_foreach(route, i, link_ptr) {
     char resource[100];
-    snprintf (resource, 100, "%p", link_ptr);
+    snprintf(resource, 100, "%p", link_ptr);
 
-    if (strcmp (what, "set") == 0){
-      pajeSetVariable (time, variable, resource, valuestr);
-    }else if (strcmp (what, "add") == 0){
-      pajeAddVariable (time, variable, resource, valuestr);
-    }else if (strcmp (what, "sub") == 0){
-      pajeSubVariable (time, variable, resource, valuestr);
+    if (strcmp(what, "set") == 0) {
+      pajeSetVariable(time, variable, resource, valuestr);
+    } else if (strcmp(what, "add") == 0) {
+      pajeAddVariable(time, variable, resource, valuestr);
+    } else if (strcmp(what, "sub") == 0) {
+      pajeSubVariable(time, variable, resource, valuestr);
     }
   }
 }
 
-void TRACE_user_host_variable (double time, const char *variable, double value, const char *what)
+void TRACE_user_host_variable(double time, const char *variable,
+                              double value, const char *what)
 {
   char valuestr[100];
-  if (!IS_TRACING || !IS_TRACING_PLATFORM) return;
+  if (!IS_TRACING || !IS_TRACING_PLATFORM)
+    return;
 
-  snprintf (valuestr, 100, "%g", value);
+  snprintf(valuestr, 100, "%g", value);
 
-  if (strcmp (what, "declare") == 0){
-    pajeDefineVariableType (variable, "HOST", variable);
-  }else if (strcmp (what, "set") == 0){
-    pajeSetVariable (time, variable, MSG_host_self()->name, valuestr);
-  }else if (strcmp (what, "add") == 0){
-    pajeAddVariable (time, variable, MSG_host_self()->name, valuestr);
-  }else if (strcmp (what, "sub") == 0){
-    pajeSubVariable (time, variable, MSG_host_self()->name, valuestr);
+  if (strcmp(what, "declare") == 0) {
+    pajeDefineVariableType(variable, "HOST", variable);
+  } else if (strcmp(what, "set") == 0) {
+    pajeSetVariable(time, variable, MSG_host_self()->name, valuestr);
+  } else if (strcmp(what, "add") == 0) {
+    pajeAddVariable(time, variable, MSG_host_self()->name, valuestr);
+  } else if (strcmp(what, "sub") == 0) {
+    pajeSubVariable(time, variable, MSG_host_self()->name, valuestr);
   }
 }
 
-#endif /* HAVE_TRACING */
+#endif                          /* HAVE_TRACING */