Some assertions to make the static analyzer happy.

Assertions give hints to the static analyzer about code paths
where we make assumptions. Used the Clang Static Analyzer.
This commit is contained in:
Fernando Tarlá Cardoso Lemos
2011-02-25 21:21:48 -03:00
committed by Michael Stapelberg
parent f4ec0bceff
commit 269d360f30
2 changed files with 4 additions and 1 deletions

View File

@ -199,7 +199,7 @@ static void workspace_reassign_sticky(Con *con) {
*
*/
void workspace_show(const char *num) {
Con *workspace, *current, *old;
Con *workspace, *current, *old = NULL;
workspace = workspace_get(num);
@ -210,6 +210,7 @@ void workspace_show(const char *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