- Prefer using ansi prototypes rather than C prototypes
- Keep type on separate line from name of function
- Try to keep things const where possible. This will help get to WARNS=6
- switch to "bool" where it makes sense
Some users prefer seeing the TID when viewing individual threads. This
makes sense as the PID will be the same for multiple entries. An attempt
was made to include both, but there is insufficient room. As such, using
the TID.
While here, rename the header variables to be more understandable.
Discussed with: mmacy
Reported on: 2009-10-07
This corrects a warning issues by gcc9:
/srv/src/freebsd/head/usr.bin/top/machine.c:988:22: warning: '%5zu'
directive writing between 5 and 20 bytes into a
region of size 15 [-Wformat-overflow=]
sprintf(status, "?%5zu", state);
Remove 'top.local.hs'. This was not noticed since
/srv/obj/fbsd/srv/src/freebsd/svn/head/amd64.amd64/usr.bin/top/top.local.h
existed locally on my machine despite "make clean". Only fully removing
the objdir allowed me to observe the error directly.
Pointyhat to: me
This leaves at WARNS=6:
35 warnings in top.c
88 warnings in machine.c
all of which are either "incompatible-pointer-types-discards-qualifiers"
or "cast-qual"
- Replace caddr_t with "void *". This reduces
the number of warnings at WARNS=6
- use "static" where possible
- sprinkle const where possible
This leaves at WARNS=6:
35 warnings in top.c
88 warnings in machine.c
7 warnings in commands.c
all of which are either "incompatible-pointer-types-discards-qualifiers"
or "cast-qual"
- Replace caddr_t with "void *". This reduces
the number of warnings at WARNS=6
- use "static" where possible
- sprinkle const where possible
This leaves at WARNS=6:
35 warnings in top.c
72 warnings in machine.c
5 warnings in commands.c
all of which are either "incompatible-pointer-types-discards-qualifiers"
or "cast-qual"
This changes previous behavior of calculating it at startup based on
the current max username length.
This is done because:
- it is in theory possible for the max length to change at run-time
(e.g., a new user is added after top starts running)
- on machines with many users this delays startup significantly
PR: 20799
PR: 89762
Reported by: ob@e-Gitt.NET
Reported by: wkwu@Kavalan.csie.NCTU.edu.tw
Reported on: 2000-08-23 and 2005-11-30
This is all warnings at level six (6) that are not
char-subscripts, incompatible-pointer-types,
sign-compare, switch, int-conversion,
missing-variable-declarations, cast-qual, cast-align
Some warnings that are fixed by this commit are:
shadow, strict-prototypes, missing-prototypes, pointer-arith,
unused-parameter, unused-const-variable, and several others
We've been maintaining top(1) for a long time, and the upstream
hasn't existed/been used in similarly as long. Make it clear that we own
top(1)
Tested with 'make universe'. Everything passed except MIPS which failed
for unrelated reasons. Install also tested for amd64.
Reviewed by: sbruno
No objections: imp, mmacy
Differential Revision: https://reviews.freebsd.org/D15387
handle.
Keep both pagesize and the new swap_maxpages in the static variables
to save sysctl calls.
Submitted by: ota@j.email.ne.jp
PR: 223149
MFC after: 2 weeks
Based on feedback from OpenZFS developers Matt Ahrens and George Wilson,
the calculation of the ratio no longer takes in to account overhead.
The old formula could result in reporting a negative compression ratio
This could confuse the user or give a false impression that there would be
an advantage to disabling the compressed ARC feature.
The new formula will more closely match an average of the on-disk
compression ratio, as reported by the ZFS property 'compressratio'
MFC after: 3 days
Sponsored by: ScaleEngine Inc.