Assertions give hints to the static analyzer about code paths
where we make assumptions. Used the Clang Static Analyzer.
/* precalculate the sizes to be able to correct rounding errors */
int sizes[children];
if (con->layout == L_DEFAULT && children > 0) {
+ assert(!TAILQ_EMPTY(&con->nodes_head));
Con *child;
int i = 0, assigned = 0;
int total = con->orientation == HORIZ ? rect.width : rect.height;
/* FIXME: refactor this into separate functions: */
Con *child;
TAILQ_FOREACH(child, &(con->nodes_head), nodes) {
+ assert(children > 0);
/* default layout */
if (con->layout == L_DEFAULT) {
*
*/
void workspace_show(const char *num) {
- Con *workspace, *current, *old;
+ Con *workspace, *current, *old = NULL;
workspace = workspace_get(num);
old = current;
current->fullscreen_mode = CF_NONE;
}
+ assert(old != NULL);
/* Check if the the currently focused con is on the same Output as the
* workspace we chose as 'old'. If not, use the workspace of the currently