~cmiller/ubuntu/trusty/icewm/translations-cause-crash-lp447883

« back to all changes in this revision

Viewing changes to src/acpustatus.cc

  • Committer: Bazaar Package Importer
  • Author(s): Eduard Bloch
  • Date: 2009-01-26 00:18:14 UTC
  • mfrom: (1.3.1 upstream) (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090126001814-ea5ceoy4uroruz72
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
207
207
#ifdef linux
208
208
    char load[31];
209
209
    struct sysinfo sys;
210
 
    float l1, l5, l15;
 
210
    double l1, l5, l15;
211
211
 
212
212
    sysinfo(&sys);
213
 
    l1 = (float)sys.loads[0] / 65536.0;
214
 
    l5 = (float)sys.loads[1] / 65536.0;
215
 
    l15 = (float)sys.loads[2] / 65536.0;
 
213
    l1 = sys.loads[0] / 65536.0;
 
214
    l5 = sys.loads[1] / 65536.0;
 
215
    l15 = sys.loads[2] / 65536.0;
216
216
    sprintf(load, "%3.2f %3.2f %3.2f, %d",
217
217
            l1, l5, l15, sys.procs);
218
218
    char *loadmsg = strJoin(_("CPU Load: "), load, _(" processes."), NULL);
445
445
    for (i = 0; i < CPU_STATES; i++)
446
446
        cp_pct[i] =
447
447
            ((total_change > 0) ?
448
 
             ((int)(((1000.0 * (float)cp_pct[i]) / total_change) + 0.5)) :
 
448
             ((int)(((1000.0 * cp_pct[i]) / total_change) + 0.5)) :
449
449
             ((i == CPU_IDLE) ? (1000) : (0)));
450
450
 
451
451
    /* OK, we've got the data. Now copy it to cpu[][] */