Mercurial > hg > toybox
changeset 562:4d802d438983
Match uint64_t with PRIu64 to avoid warnings on 64 bit builds.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 14 Apr 2012 21:27:00 -0500 |
parents | c97e338a4126 |
children | b24c4fe9f4fd |
files | toys/vmstat.c |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/toys/vmstat.c Wed Apr 11 19:11:45 2012 +0200 +++ b/toys/vmstat.c Sat Apr 14 21:27:00 2012 -0500 @@ -35,14 +35,16 @@ off = strstr(toybuf, "cpu "); // Ignoring steal and guest fields for now. - if (off) sscanf(off, "cpu %Lu %Lu %Lu %Lu %Lu %Lu %Lu", &c_user, &c_nice, &c_sys, cpu_idle, cpu_wait, &c_irq, &c_sirq); + if (off) sscanf(off, "cpu %"PRIu64" %"PRIu64" %"PRIu64" %"PRIu64 \ + " %"PRIu64" %"PRIu64" %"PRIu64, &c_user, &c_nice, &c_sys, cpu_idle, + cpu_wait, &c_irq, &c_sirq); *cpu_user = c_user + c_nice; *cpu_sys = c_sys + c_irq + c_sirq; off = strstr(toybuf, "intr"); - if (off) sscanf(off, "intr %Lu", sys_irq); + if (off) sscanf(off, "intr %"PRIu64, sys_irq); off = strstr(toybuf, "ctxt"); - if (off) sscanf(off, "ctxt %Lu", sys_ctxt); + if (off) sscanf(off, "ctxt %"PRIu64, sys_ctxt); off = strstr(toybuf, "procs_running"); if (off) sscanf(off, "procs_running %u", proc_running);