Replace a defined value equal to 2^31 - 1 by numeric_limits<int>::max().
Fix warnings about overflow on implicit constant conversion.