From 2a9dde00db289995b0dec48928c5e1656f7b9323 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 14 Apr 2012 21:27:00 -0500 Subject: Match uint64_t with PRIu64 to avoid warnings on 64 bit builds. --- toys/vmstat.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'toys/vmstat.c') diff --git a/toys/vmstat.c b/toys/vmstat.c index e186961d..2826ced5 100644 --- a/toys/vmstat.c +++ b/toys/vmstat.c @@ -35,14 +35,16 @@ void read_proc_stat(unsigned int * proc_running, unsigned int * proc_blocked, 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); -- cgit v1.2.3