But there is a inconsistence: switch( i ){ case 0: ... case 1: // problem with implicit break case 2: ... default: ... } should become: switch( i ){ case 0: ... case 1, 2: // this solves the problem ... default: ... }