top: do not lie about purported alphabetical orderings

Excluding those special X_XON/X_XOF enums, which might
not even be present, restore strict collating order of
all the case labels in the task_show switch statement.

Also, adjust a few sort callbacks for the same reason.

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2013-11-29 00:00:00 -06:00 committed by Jaromir Capik
parent 9f3cfd7c36
commit 57ab5eed15

View File

@ -246,9 +246,9 @@ SCB_NUM1(CPU, pcpu)
SCB_NUM1(DAT, drs) SCB_NUM1(DAT, drs)
SCB_NUM1(DRT, dt) SCB_NUM1(DRT, dt)
SCB_STRS(ENV, environ[0]) SCB_STRS(ENV, environ[0])
SCB_NUM1(FLG, flags)
SCB_NUM1(FL1, maj_flt) SCB_NUM1(FL1, maj_flt)
SCB_NUM1(FL2, min_flt) SCB_NUM1(FL2, min_flt)
SCB_NUM1(FLG, flags)
SCB_NUM1(FV1, maj_delta) SCB_NUM1(FV1, maj_delta)
SCB_NUM1(FV2, min_delta) SCB_NUM1(FV2, min_delta)
SCB_NUMx(GID, egid) SCB_NUMx(GID, egid)
@ -5220,15 +5220,15 @@ static const char *task_show (const WIN_t *q, const proc_t *p) {
case P_ENV: case P_ENV:
makeVAR(p->environ[0]); makeVAR(p->environ[0]);
break; break;
case P_FLG:
cp = make_str(hex_make(p->flags, 1), W, Js, AUTOX_NO);
break;
case P_FL1: case P_FL1:
cp = scale_num(p->maj_flt, W, Jn); cp = scale_num(p->maj_flt, W, Jn);
break; break;
case P_FL2: case P_FL2:
cp = scale_num(p->min_flt, W, Jn); cp = scale_num(p->min_flt, W, Jn);
break; break;
case P_FLG:
cp = make_str(hex_make(p->flags, 1), W, Js, AUTOX_NO);
break;
case P_FV1: case P_FV1:
cp = scale_num(p->maj_delta, W, Jn); cp = scale_num(p->maj_delta, W, Jn);
break; break;
@ -5244,6 +5244,9 @@ static const char *task_show (const WIN_t *q, const proc_t *p) {
case P_MEM: case P_MEM:
cp = scale_pcnt((float)pages2K(p->resident) * 100 / kb_main_total, W, Jn); cp = scale_pcnt((float)pages2K(p->resident) * 100 / kb_main_total, W, Jn);
break; break;
case P_NCE:
cp = make_num(p->nice, W, Jn, AUTOX_NO);
break;
case P_NS1: // IPCNS case P_NS1: // IPCNS
case P_NS2: // MNTNS case P_NS2: // MNTNS
case P_NS3: // NETNS case P_NS3: // NETNS
@ -5255,9 +5258,6 @@ static const char *task_show (const WIN_t *q, const proc_t *p) {
else cp = make_str("-", W, Js, i); else cp = make_str("-", W, Js, i);
} }
break; break;
case P_NCE:
cp = make_num(p->nice, W, Jn, AUTOX_NO);
break;
#ifdef OOMEM_ENABLE #ifdef OOMEM_ENABLE
case P_OOA: case P_OOA:
cp = make_num(p->oom_adj, W, Jn, AUTOX_NO); cp = make_num(p->oom_adj, W, Jn, AUTOX_NO);
@ -5308,8 +5308,8 @@ static const char *task_show (const WIN_t *q, const proc_t *p) {
case P_THD: case P_THD:
cp = make_num(p->nlwp, W, Jn, AUTOX_NO); cp = make_num(p->nlwp, W, Jn, AUTOX_NO);
break; break;
case P_TME:
case P_TM2: case P_TM2:
case P_TME:
{ TIC_t t = p->utime + p->stime; { TIC_t t = p->utime + p->stime;
if (CHKw(q, Show_CTIMES)) t += (p->cutime + p->cstime); if (CHKw(q, Show_CTIMES)) t += (p->cutime + p->cstime);
cp = scale_tics(t, W, Jn); cp = scale_tics(t, W, Jn);