]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6497: --resolve fix for loop initial declaration not allowed
authorMichael Jerris <mike@jerris.com>
Wed, 30 Apr 2014 16:16:02 +0000 (12:16 -0400)
committerMichael Jerris <mike@jerris.com>
Wed, 30 Apr 2014 16:16:02 +0000 (12:16 -0400)
src/switch_profile.c

index 11f76ba1cf174e0f489e6445186671bcb7517f39..b7dca2f68cb7ffbed0d99c593e73a5f7b6fb174f 100644 (file)
@@ -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 usertime, kerneltime, idletime, totaltime, halftime;
+       int x;
 
        *idle_percentage = 100.0;
        if (p->disabled) {
@@ -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->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]);
          p->last_percentage_of_idle_time += p->percentage_of_idle_time_ring[x];
        }