I'm a bit concerned regarding assumption that sizeof int never exceeds 4bytes. While this could be true today for most C compilers, standard doesn't guarantee that. Perhaps we should add something like:
StaticAssertStmt(sizeof(int) <= sizeof(int32), "int size exceeds int32 size");
It costs nothing but could save a lot of time (not mentioning dataloss) some unlucky user.
 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf