提交 e57484af authored 作者: Michael Jerris's avatar Michael Jerris

FS-6497: --resolve fix for loop initial declaration not allowed

上级 0ebc7945
...@@ -163,6 +163,7 @@ SWITCH_DECLARE(switch_bool_t) switch_get_system_idle_time(switch_profile_timer_t ...@@ -163,6 +163,7 @@ SWITCH_DECLARE(switch_bool_t) switch_get_system_idle_time(switch_profile_timer_t
{ {
unsigned long long user, nice, system, idle, iowait, irq, softirq, steal; unsigned long long user, nice, system, idle, iowait, irq, softirq, steal;
unsigned long long usertime, kerneltime, idletime, totaltime, halftime; unsigned long long usertime, kerneltime, idletime, totaltime, halftime;
int x;
*idle_percentage = 100.0; *idle_percentage = 100.0;
if (p->disabled) { if (p->disabled) {
...@@ -217,7 +218,7 @@ SWITCH_DECLARE(switch_bool_t) switch_get_system_idle_time(switch_profile_timer_t ...@@ -217,7 +218,7 @@ SWITCH_DECLARE(switch_bool_t) switch_get_system_idle_time(switch_profile_timer_t
p->percentage_of_idle_time_ring[p->last_idle_time_index] = ((100 * idletime + halftime) / totaltime); p->percentage_of_idle_time_ring[p->last_idle_time_index] = ((100 * idletime + halftime) / totaltime);
p->last_percentage_of_idle_time = 0; p->last_percentage_of_idle_time = 0;
for ( int x = 0; x < p->cpu_idle_smoothing_depth; x++ ) { for ( x = 0; x < p->cpu_idle_smoothing_depth; x++ ) {
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "IDLE TIME: (%d)[%lf]\n", x, p->percentage_of_idle_time_ring[x]); //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "IDLE TIME: (%d)[%lf]\n", x, p->percentage_of_idle_time_ring[x]);
p->last_percentage_of_idle_time += p->percentage_of_idle_time_ring[x]; p->last_percentage_of_idle_time += p->percentage_of_idle_time_ring[x];
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论