Fixes warning: default label in switch which covers all enumeration valu...

...es [-Wcovered-switch-default].

Also simplifies the code.  Less lines and ensures there is always a return value from the method.  No need for switch or default case.

You didn't put the pragma around all the cases you reverted Matt.  So here is another little patch that I think makes the code better and fixes the warning.