mirror of https://github.com/xzeldon/htop.git
Add assert for unreachable switch case
Like the default case in Process_writeField()
This commit is contained in:
parent
bd689ab0d3
commit
615fc934ff
|
@ -399,7 +399,7 @@ void Process_writeField(const Process* this, RichString* str, ProcessField field
|
||||||
xSnprintf(buffer, n, "%-9d ", this->st_uid);
|
xSnprintf(buffer, n, "%-9d ", this->st_uid);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0); /* should never be reached */
|
assert(0 && "Process_writeField: default key reached"); /* should never be reached */
|
||||||
xSnprintf(buffer, n, "- ");
|
xSnprintf(buffer, n, "- ");
|
||||||
}
|
}
|
||||||
RichString_appendWide(str, attr, buffer);
|
RichString_appendWide(str, attr, buffer);
|
||||||
|
@ -617,6 +617,7 @@ int Process_compareByKey_Base(const Process* p1, const Process* p2, ProcessField
|
||||||
case USER:
|
case USER:
|
||||||
return SPACESHIP_NULLSTR(p1->user, p2->user);
|
return SPACESHIP_NULLSTR(p1->user, p2->user);
|
||||||
default:
|
default:
|
||||||
|
assert(0 && "Process_compareByKey_Base: default key reached"); /* should never be reached */
|
||||||
return SPACESHIP_NUMBER(p1->pid, p2->pid);
|
return SPACESHIP_NUMBER(p1->pid, p2->pid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue