diff options
author | jhb <jhb@FreeBSD.org> | 2003-04-16 19:46:26 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-04-16 19:46:26 +0000 |
commit | 2adf0f9f0c086e0ef046c800c8fccd9f392b846e (patch) | |
tree | 225932477b725c3bc11bd22301585dc25d061668 /sys | |
parent | d726ddfb83352958f1c92cacd8f25b978e0f28be (diff) | |
download | FreeBSD-src-2adf0f9f0c086e0ef046c800c8fccd9f392b846e.zip FreeBSD-src-2adf0f9f0c086e0ef046c800c8fccd9f392b846e.tar.gz |
Fix multiple printf warnings on Alpha:
- Prefer long long to quad_t to match printf args.
- Use uintmax_t and %j to print segsz_t and vm_size_t values.
- Fix others in Alpha-specific code.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 1f3e85f..cd86bba 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -116,9 +116,9 @@ linprocfs_domeminfo(PFS_FILL_ARGS) unsigned long memfree; /* free memory in bytes */ unsigned long memshared; /* shared memory ??? */ unsigned long buffers, cached; /* buffer / cache memory ??? */ - u_quad_t swaptotal; /* total swap space in bytes */ - u_quad_t swapused; /* used swap space in bytes */ - u_quad_t swapfree; /* free swap space in bytes */ + unsigned long long swaptotal; /* total swap space in bytes */ + unsigned long long swapused; /* used swap space in bytes */ + unsigned long long swapfree; /* free swap space in bytes */ vm_object_t object; memtotal = physmem * PAGE_SIZE; @@ -209,20 +209,20 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) "cpu\t\t\t: Alpha\n" "cpu model\t\t: %s\n" "cpu variation\t\t: %ld\n" - "cpu revision\t\t: %ld\n" + "cpu revision\t\t: %d\n" "cpu serial number\t: %s\n" "system type\t\t: %s\n" "system variation\t: %s\n" - "system revision\t\t: %ld\n" + "system revision\t\t: %d\n" "system serial number\t: %s\n" "cycle frequency [Hz]\t: %lu\n" - "timer frequency [Hz]\t: %lu\n" + "timer frequency [Hz]\t: %u\n" "page size [bytes]\t: %ld\n" "phys. address bits\t: %ld\n" "max. addr. space #\t: %ld\n" - "BogoMIPS\t\t: %lu.%02lu\n" - "kernel unaligned acc\t: %ld (pc=%lx,va=%lx)\n" - "user unaligned acc\t: %ld (pc=%lx,va=%lx)\n" + "BogoMIPS\t\t: %u.%02u\n" + "kernel unaligned acc\t: %d (pc=%x,va=%x)\n" + "user unaligned acc\t: %d (pc=%x,va=%x)\n" "platform string\t\t: %s\n" "cpus detected\t\t: %d\n" , @@ -421,7 +421,7 @@ linprocfs_dostat(PFS_FILL_ARGS) cnt.v_swappgsout, cnt.v_intr, cnt.v_swtch, - (quad_t)boottime.tv_sec); + (long long)boottime.tv_sec); return (0); } @@ -435,7 +435,7 @@ linprocfs_douptime(PFS_FILL_ARGS) getmicrouptime(&tv); sbuf_printf(sb, "%lld.%02ld %ld.%02ld\n", - (quad_t)tv.tv_sec, tv.tv_usec / 10000, + (long long)tv.tv_sec, tv.tv_usec / 10000, T2S(cp_time[CP_IDLE]), T2J(cp_time[CP_IDLE]) % 100); return (0); } @@ -514,8 +514,8 @@ linprocfs_doprocstat(PFS_FILL_ARGS) PS_ADD("timeout", "%u", 0); /* XXX */ PS_ADD("itrealvalue", "%u", 0); /* XXX */ PS_ADD("starttime", "%d", 0); /* XXX */ - PS_ADD("vsize", "%u", kp.ki_size); - PS_ADD("rss", "%u", P2K(kp.ki_rssize)); + PS_ADD("vsize", "%ju", (uintmax_t)kp.ki_size); + PS_ADD("rss", "%ju", P2K((uintmax_t)kp.ki_rssize)); PS_ADD("rlim", "%u", 0); /* XXX */ PS_ADD("startcode", "%u", (unsigned)0); PS_ADD("endcode", "%u", 0); /* XXX */ @@ -625,15 +625,15 @@ linprocfs_doprocstatus(PFS_FILL_ARGS) * could also compute VmLck, but I don't really care enough to * implement it. Submissions are welcome. */ - sbuf_printf(sb, "VmSize:\t%8u kB\n", B2K(kp.ki_size)); + sbuf_printf(sb, "VmSize:\t%8ju kB\n", B2K((uintmax_t)kp.ki_size)); sbuf_printf(sb, "VmLck:\t%8u kB\n", P2K(0)); /* XXX */ - sbuf_printf(sb, "VmRss:\t%8u kB\n", P2K(kp.ki_rssize)); - sbuf_printf(sb, "VmData:\t%8u kB\n", P2K(kp.ki_dsize)); - sbuf_printf(sb, "VmStk:\t%8u kB\n", P2K(kp.ki_ssize)); - sbuf_printf(sb, "VmExe:\t%8u kB\n", P2K(kp.ki_tsize)); + sbuf_printf(sb, "VmRss:\t%8ju kB\n", P2K((uintmax_t)kp.ki_rssize)); + sbuf_printf(sb, "VmData:\t%8ju kB\n", P2K((uintmax_t)kp.ki_dsize)); + sbuf_printf(sb, "VmStk:\t%8ju kB\n", P2K((uintmax_t)kp.ki_ssize)); + sbuf_printf(sb, "VmExe:\t%8ju kB\n", P2K((uintmax_t)kp.ki_tsize)); lsize = B2P(kp.ki_size) - kp.ki_dsize - kp.ki_ssize - kp.ki_tsize - 1; - sbuf_printf(sb, "VmLib:\t%8u kB\n", P2K(lsize)); + sbuf_printf(sb, "VmLib:\t%8ju kB\n", P2K((uintmax_t)lsize)); /* * Signal masks |