switch(gettype) instead of switch(true) + is_*()

The semantics is exactly the same but the code is easier to understand, faster to execute and easier to statically analyzed.