2011/5/23 RSPsoftware <arabcoder@yahoo.com.br>
the compiler dont show a warning about the win32 to win64 conversion in the following function, it would be great if the compiler report at least a warning about it

this function fail miserably in win64, and I have only detected it after the compilation and tests  

round_trick (float floatvalue_to_round)

float floattmp;
int rounded_value;

floattmp = (int) 0x00FD8000L + (floatvalue_to_round);
rounded_value = *(int *) (&floattmp) - (int) 0x4B7D8000L;

if (rounded_value != (short) rounded_value)
rounded_value = (rounded_value >> 31) ^ 0x7FFF;
return rounded_value ;

I am unable to decipher your function's inner workings, but I'm sure you will be better off with any of the answers to this question here:

As to what goes wrong: probably the algorithm's assumptions on pointer size, in the line where you assign "rounded_value" for the first time. Also all the magic numbers look very fishy to me.


What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
Mingw-w64-public mailing list