Optimizing compilers (including GCC) will compile a switch statement into a jump table (making a switch statement exactly as fast as the thing you're trying to construct) IF the following conditions are met:  
Your switch cases (state numbers) start at zero. 
Your switch cases are strictly increasing. 
You don't skip any integers in your switch cases. 
There are enough cases that a jump table is actually faster (a couple dozen compare-and-gotos in the checking-each-case method of dealing with switch statements is actually faster than a jump table.)
This has the advantage of allowing you to write your code in standard C instead of relying on a compiler extension.  It will work just as fast in GCC.  It will also work just as fast in most optimizing compilers (I know the Intel compiler does it; not sure about Microsoft stuff).  And it will work, although slower, on any compiler.