Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove useless length modifier 'l' in %l[efg] for printf.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 14 Feb 2014 15:37:47 +0000 (16:37 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 18 Feb 2014 13:34:34 +0000 (14:34 +0100)
It's indeed wrong in C90, and useless in C99.

contrib/benchmarking_code_block/bench.h
examples/msg/cloud/bound.c
src/msg/msg_vm.c
src/surf/cpu_interface.cpp
src/surf/cpu_ti.cpp
src/surf/maxmin.cpp
src/surf/network_cm02.cpp
src/surf/surf_c_bindings.cpp
src/surf/surf_interface.cpp
src/surf/vm_workstation_hl13.cpp

index da60519..568a931 100644 (file)
@@ -97,7 +97,7 @@ static inline int bench_end_block(char* block_id)
                clock_gettime(CLOCK_REALTIME, &mybench->end_time);
                struct timespec interval;
                xbt_diff_time(&mybench->start_time, &mybench->end_time, &interval);
-               fprintf(mybench->output, "%s %lf %lf %lf\n", block_id, xbt_get_time(&mybench->start_time), xbt_get_time(&mybench->end_time), xbt_get_time(&interval));
+               fprintf(mybench->output, "%s %f %f %f\n", block_id, xbt_get_time(&mybench->start_time), xbt_get_time(&mybench->end_time), xbt_get_time(&interval));
                return 0;
        }
 }
@@ -133,7 +133,7 @@ static inline int xbt_bench_end(char* block_id)
        if(mybench->block_id == NULL)
                strcat (mybench->block_id, "NONAME");
 
-       fprintf(mybench->output, "%s %lf %lf %lf\n", mybench->block_id, xbt_get_time(&mybench->start_time), xbt_get_time(&mybench->end_time), xbt_get_time(&interval));
+       fprintf(mybench->output, "%s %f %f %f\n", mybench->block_id, xbt_get_time(&mybench->start_time), xbt_get_time(&mybench->end_time), xbt_get_time(&interval));
        return 0;
 }
 
index e721f3a..ee5fc49 100644 (file)
@@ -54,9 +54,9 @@ static void launch_worker(msg_host_t host, const char *pr_name, double computati
 {
   char **argv = xbt_new(char *, 5);
   argv[0] = xbt_strdup(pr_name);
-  argv[1] = bprintf("%lf", computation_amount);
+  argv[1] = bprintf("%f", computation_amount);
   argv[2] = bprintf("%d", use_bound);
-  argv[3] = bprintf("%lf", bound);
+  argv[3] = bprintf("%f", bound);
   argv[4] = NULL;
 
   MSG_process_create_with_arguments(pr_name, worker_main, NULL, host, 4, argv);
index 240d299..44bd5ca 100644 (file)
@@ -578,8 +578,8 @@ static void launch_deferred_exec_process(msg_host_t host, double computation, do
   int nargvs = 4;
   char **argv = xbt_new(char *, nargvs);
   argv[0] = pr_name;
-  argv[1] = bprintf("%lf", computation);
-  argv[2] = bprintf("%lf", prio);
+  argv[1] = bprintf("%f", computation);
+  argv[2] = bprintf("%f", prio);
   argv[3] = NULL;
 
   MSG_process_create_with_arguments(pr_name, deferred_exec_fun, NULL, host, nargvs - 1, argv);
index e735c61..736b29e 100644 (file)
@@ -224,7 +224,7 @@ void CpuAction::updateRemainingLazy(double now)
   delta = now - m_lastUpdate;
 
   if (m_remains > 0) {
-    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains was %lf, last_update was: %lf", this, m_remains, m_lastUpdate);
+    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains was %f, last_update was: %f", this, m_remains, m_lastUpdate);
     double_update(&(m_remains), m_lastValue * delta);
 
 #ifdef HAVE_TRACING
@@ -233,7 +233,7 @@ void CpuAction::updateRemainingLazy(double now)
       TRACE_surf_host_set_utilization(cpu->getName(), getCategory(), m_lastValue, m_lastUpdate, now - m_lastUpdate);
     }
 #endif
-    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains is now %lf", this, m_remains);
+    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains is now %f", this, m_remains);
   }
 
   m_lastUpdate = now;
index 7893a03..af08127 100644 (file)
@@ -318,7 +318,7 @@ CpuTiTgmr::CpuTiTgmr(tmgr_trace_t power_trace, double value)
   if (!power_trace) {
     m_type = TRACE_FIXED;
     m_value = value;
-    XBT_DEBUG("No availability trace. Constant value = %lf", value);
+    XBT_DEBUG("No availability trace. Constant value = %f", value);
     return;
   }
 
@@ -341,7 +341,7 @@ CpuTiTgmr::CpuTiTgmr(tmgr_trace_t power_trace, double value)
   m_lastTime = total_time;
   m_total = p_trace->integrateSimple(0, total_time);
 
-  XBT_DEBUG("Total integral %lf, last_time %lf ",
+  XBT_DEBUG("Total integral %f, last_time %f ",
             m_total, m_lastTime);
 }
 
@@ -579,7 +579,7 @@ CpuTi::CpuTi(CpuTiModelPtr model, const char *name, xbt_dynar_t powerPeak,
   tmgr_trace_t empty_trace;            
   s_tmgr_event_t val;          
   xbt_assert(core==1,"Multi-core not handled with this model yet");
-  XBT_DEBUG("power scale %lf", powerScale);
+  XBT_DEBUG("power scale %f", powerScale);
   p_availTrace = new CpuTiTgmr(powerTrace, powerScale);
 
   CpuTiActionPtr action = NULL;
@@ -626,7 +626,7 @@ void CpuTi::updateState(tmgr_trace_event_t event_type,
     CpuTiTgmrPtr trace;
     s_tmgr_event_t val;
 
-    XBT_DEBUG("Finish trace date: %f value %lf date %f", surf_get_clock(),
+    XBT_DEBUG("Finish trace date: %f value %f date %f", surf_get_clock(),
            value, date);
     /* update remaining of actions and put in modified cpu swag */
     updateRemainingAmount(date);
index bfdc22c..cb60858 100644 (file)
@@ -306,7 +306,7 @@ void lmm_shrink(lmm_system_t sys, lmm_constraint_t cnst,
 
   sys->modified = 1;
 
-  XBT_DEBUG("remove elem(value %lf, cnst %p, var %p) in var %p",
+  XBT_DEBUG("remove elem(value %f, cnst %p, var %p) in var %p",
       elem->value, elem->constraint, elem->variable, var);
 
 
index b3fa7e3..b80ddfd 100644 (file)
@@ -630,10 +630,10 @@ void NetworkCm02Action::updateRemainingLazy(double now)
   delta = now - m_lastUpdate;
 
   if (m_remains > 0) {
-    XBT_DEBUG("Updating action(%p): remains was %lf, last_update was: %lf", this, m_remains, m_lastUpdate);
+    XBT_DEBUG("Updating action(%p): remains was %f, last_update was: %f", this, m_remains, m_lastUpdate);
     double_update(&(m_remains), m_lastValue * delta);
 
-    XBT_DEBUG("Updating action(%p): remains is now %lf", this, m_remains);
+    XBT_DEBUG("Updating action(%p): remains is now %f", this, m_remains);
   }
 
   if (m_maxDuration != NO_MAX_DURATION)
index ded3bb9..1bcc47f 100644 (file)
@@ -171,7 +171,7 @@ double surf_solve(double max_date)
       }
       /* update state of model_obj according to new value. Does not touch lmm.
          It will be modified if needed when updating actions */
-      XBT_DEBUG("Calling update_resource_state for resource %s with min %lf",
+      XBT_DEBUG("Calling update_resource_state for resource %s with min %f",
              resource->getName(), surf_min);
       resource->updateState(event, value, next_event_date);
     }
index 729aa65..4b1889a 100644 (file)
@@ -558,14 +558,14 @@ double Model::shareResourcesLazy(double now)
       max_dur_flag = 1;
     }
 
-    XBT_DEBUG("Action(%p) Start %lf Finish %lf Max_duration %lf", action,
+    XBT_DEBUG("Action(%p) Start %f Finish %f Max_duration %f", action,
         action->getStartTime(), now + value,
         action->getMaxDuration());
 
     if (min != -1) {
       action->heapRemove(p_actionHeap);
       action->heapInsert(p_actionHeap, min, max_dur_flag ? MAX_DURATION : NORMAL);
-      XBT_DEBUG("Insert at heap action(%p) min %lf now %lf", action, min,
+      XBT_DEBUG("Insert at heap action(%p) min %f now %f", action, min,
                 now);
     } else DIE_IMPOSSIBLE;
   }
@@ -576,7 +576,7 @@ double Model::shareResourcesLazy(double now)
   else
     min = -1;
 
-  XBT_DEBUG("The minimum with the HEAP %lf", min);
+  XBT_DEBUG("The minimum with the HEAP %f", min);
 
   return min;
 }
index 054e349..baad9ae 100644 (file)
@@ -420,7 +420,7 @@ void WorkstationVMHL13::migrate(surf_resource_t ind_dst_pm)
      /* keep the bound value of the cpu action of the VM. */
      double old_bound = p_action->getBound();
      if (old_bound != 0) {
-       XBT_INFO("migrate VM(%s): set bound (%lf) at %s", vm_name, old_bound, pm_name_dst);
+       XBT_INFO("migrate VM(%s): set bound (%f) at %s", vm_name, old_bound, pm_name_dst);
        new_cpu_action->setBound(old_bound);
      }