Some variants of gcc compilation were reporting 'control reaching end of non-void function' error in this switch/case maze. Either use break everywhere or not at all (which is simpler, since we only always return anyway...).