aboutsummaryrefslogtreecommitdiff
path: root/sysinfo.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2016-05-26 10:12:17 +0000
committerDmitry V. Levin <ldv@altlinux.org>2016-05-26 14:44:13 +0000
commit84a979c9eea59658aabc9b7d547e642b090922be (patch)
tree8ae0878a7ecc706810ce880acc9f6105d61a1297 /sysinfo.c
parent51507201ea2f6761cea264f026a9b40520e7a14a (diff)
downloadstrace-84a979c9eea59658aabc9b7d547e642b090922be.tar.gz
Fix explicit casts of signed integer types to unsigned long long
* defs.h (widen_to_ull): New macro. * dirent.c (print_old_dirent, SYS_FUNC(getdents)): Use it in place of explicit casts to unsigned long long. * io.c (print_lld_from_low_high_val): Likewise. * lseek.c (SYS_FUNC(llseek)): Likewise. * printsiginfo.c (print_si_info): Likewise. * printstat.h (DO_PRINTSTAT): Likewise. * sysinfo.c (SYS_FUNC(sysinfo)): Likewise. * times.c (SYS_FUNC(times)): Likewise. * fetch_struct_statfs.c (ASSIGN_NUMBER): Remove. (fetch_struct_statfs, fetch_struct_statfs64): Replace ASSIGN_NUMBER with widen_to_ull.
Diffstat (limited to 'sysinfo.c')
-rw-r--r--sysinfo.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sysinfo.c b/sysinfo.c
index e418f95c4..c3cb9adcb 100644
--- a/sysinfo.c
+++ b/sysinfo.c
@@ -59,19 +59,19 @@ SYS_FUNC(sysinfo)
", freehigh=%llu"
", mem_unit=%u"
"}",
- (unsigned long long) si.uptime
- , (unsigned long long) si.loads[0]
- , (unsigned long long) si.loads[1]
- , (unsigned long long) si.loads[2]
- , (unsigned long long) si.totalram
- , (unsigned long long) si.freeram
- , (unsigned long long) si.sharedram
- , (unsigned long long) si.bufferram
- , (unsigned long long) si.totalswap
- , (unsigned long long) si.freeswap
+ widen_to_ull(si.uptime)
+ , widen_to_ull(si.loads[0])
+ , widen_to_ull(si.loads[1])
+ , widen_to_ull(si.loads[2])
+ , widen_to_ull(si.totalram)
+ , widen_to_ull(si.freeram)
+ , widen_to_ull(si.sharedram)
+ , widen_to_ull(si.bufferram)
+ , widen_to_ull(si.totalswap)
+ , widen_to_ull(si.freeswap)
, (unsigned) si.procs
- , (unsigned long long) si.totalhigh
- , (unsigned long long) si.freehigh
+ , widen_to_ull(si.totalhigh)
+ , widen_to_ull(si.freehigh)
, si.mem_unit
);
}