From b4b78f6684f68475ec9c7b63af21f733ff04a435 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 14 Feb 2014 16:37:47 +0100 Subject: [PATCH] Remove useless length modifier 'l' in %l[efg] for printf. It's indeed wrong in C90, and useless in C99. --- contrib/benchmarking_code_block/bench.h | 4 ++-- examples/msg/cloud/bound.c | 4 ++-- src/msg/msg_vm.c | 4 ++-- src/surf/cpu_interface.cpp | 4 ++-- src/surf/cpu_ti.cpp | 8 ++++---- src/surf/maxmin.cpp | 2 +- src/surf/network_cm02.cpp | 4 ++-- src/surf/surf_c_bindings.cpp | 2 +- src/surf/surf_interface.cpp | 6 +++--- src/surf/vm_workstation_hl13.cpp | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/contrib/benchmarking_code_block/bench.h b/contrib/benchmarking_code_block/bench.h index da60519c64..568a931168 100644 --- a/contrib/benchmarking_code_block/bench.h +++ b/contrib/benchmarking_code_block/bench.h @@ -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; } diff --git a/examples/msg/cloud/bound.c b/examples/msg/cloud/bound.c index e721f3ac98..ee5fc4971a 100644 --- a/examples/msg/cloud/bound.c +++ b/examples/msg/cloud/bound.c @@ -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); diff --git a/src/msg/msg_vm.c b/src/msg/msg_vm.c index 240d299f8c..44bd5cad2e 100644 --- a/src/msg/msg_vm.c +++ b/src/msg/msg_vm.c @@ -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); diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index e735c61f7e..736b29ee87 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -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; diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 7893a03073..af08127e14 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -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); diff --git a/src/surf/maxmin.cpp b/src/surf/maxmin.cpp index bfdc22c83c..cb6085876a 100644 --- a/src/surf/maxmin.cpp +++ b/src/surf/maxmin.cpp @@ -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); diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index b3fa7e3daa..b80ddfd255 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -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) diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index ded3bb9ad9..1bcc47f1d9 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -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); } diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 729aa65e20..4b1889a43c 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -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; } diff --git a/src/surf/vm_workstation_hl13.cpp b/src/surf/vm_workstation_hl13.cpp index 054e3498da..baad9aeb82 100644 --- a/src/surf/vm_workstation_hl13.cpp +++ b/src/surf/vm_workstation_hl13.cpp @@ -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); } -- 2.20.1