1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-03 08:51:22 +00:00

Explicitly declare a large integer in qbr() routines to be unsigned, thus averting compiler warning.

This commit is contained in:
Luke Ceddia 2015-08-17 21:53:35 +10:00
parent d4c0a4c5a1
commit 8abc34c99e

View file

@ -235,7 +235,7 @@ inline int64 qbr(long double f){
int64 i; int temp=0;
if (f<=-9223372036854775808.5) {error(6); return 0;} // if the float is smaller than what an integer 64 could possible hold, toss an overflow error.
if (f>=18446744073709551615.5) {error(6); return 0;} // same result if the number is larger than what an integer 64 could possibly hold.
if (f>9223372036854775807) {temp=1;f=f-9223372036854775808;} //if it's too large for a signed int64, make it an unsigned int64 and return that value if possible.
if (f>9223372036854775807) {temp=1;f=f-9223372036854775808u;} //if it's too large for a signed int64, make it an unsigned int64 and return that value if possible.
if (f<0) i=f-0.5f; else i=f+0.5f;
if (temp) return i|0x8000000000000000;//+9223372036854775808;
return i;
@ -250,7 +250,7 @@ inline int64 qbr(long double f){
int64 i; int temp=0;
if (f<=-9223372036854775808.5) {error(6); return 0;} // if the float is smaller than what an integer 64 could possible hold, toss an overflow error.
if (f>=18446744073709551615.5) {error(6); return 0;} // same result if the number is larger than what an integer 64 could possibly hold.
if (f>9223372036854775807) {temp=1;f=f-9223372036854775808;} //if it's too large for a signed int64, make it an unsigned int64 and return that value if possible.
if (f>9223372036854775807) {temp=1;f=f-9223372036854775808u;} //if it's too large for a signed int64, make it an unsigned int64 and return that value if possible.
__asm{
fld f
fistp i
@ -290,7 +290,7 @@ inline int64 qbr(long double f){
int64 i; int temp=0;
if (f<=-9223372036854775808.5) {error(6); return 0;} // if the float is smaller than what an integer 64 could possible hold, toss an overflow error.
if (f>=18446744073709551615.5) {error(6); return 0;} // same result if the number is larger than what an integer 64 could possibly hold.
if (f>9223372036854775807) {temp=1;f=f-9223372036854775808;} //if it's too large for a signed int64, make it an unsigned int64 and return that value if possible.
if (f>9223372036854775807) {temp=1;f=f-9223372036854775808u;} //if it's too large for a signed int64, make it an unsigned int64 and return that value if possible.
__asm__ (
"fldt %1;"
"fistpll %0;"