It'd be better to base this on type of ModeT, instead of the OS. Also, you should use an `else` instead of an `elsif`, or you'll have `Nil` as a potential return type. (Or maybe not -- perhaps the compiler can eliminate the other branches completely.)

~~~
if ModeT == UInt32
  to_i32
else
  to_i16
end
~~~