generator: Fixed conversion warnings obtained on Clang 3.0 with -Wconversion
Clang 3.0: Fixed all warnings obtained when enabling -Wconversion

As some of these warnings tend to show up with some versions of Visual Studio,
it's better to be strict about it and fix all conversion warnings right away.
This also provides an indication about code which needs some improvements
because it exposes a poor handling of integer or floating points.