Silly question, but why switch on (int) XWINT (...)? Why not on XWINT (...) itself? Does that cause performance problems? The switch operand is "int" in C.