Fix float-to-int conversion to handle recent versions of clang.

Recent versions of clang are much more aggressive in exploiting undefined
behavior. Given MaxInt cannot be encoded as float, the compiler would miscompile
the macro and produce a negative number.