top(8): use designated initializers for sorted_state[]

Also correct comments for individual state, duplicating the S* constants
descriptions from sys/proc.h [*].

Reviewed by:	kevans (previous version)
Noted by:	Mark Millard <marklmi@yahoo.com> [*]
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D40607
This commit is contained in:
Konstantin Belousov 2023-06-19 16:52:05 +03:00
parent 5c6393451f
commit bc2ac2585a

View file

@ -1262,13 +1262,12 @@ compare_tid(const void *p1, const void *p2)
*/
static const int sorted_state[] = {
0, /* not used */
3, /* sleep */
1, /* ABANDONED (WAIT) */
6, /* run */
5, /* start */
2, /* zombie */
4 /* stop */
[SIDL] = 3, /* being created */
[SRUN] = 1, /* running/runnable */
[SSLEEP] = 6, /* sleeping */
[SSTOP] = 5, /* stopped/suspended */
[SZOMB] = 2, /* zombie */
[SWAIT] = 4, /* intr */
};