This fixes flt_arith2flt() when sizeof(arith) != 4, where arith is long. When cemcom.ansi sees an expression like d + 1 (where d is some double), it calls flt_arith2flt() to convert 1 to floating-point. On machines where sizeof(arith) != 4, the code did n >>= 1 when n should not have been changed. If n was 1, then n == 0 became true. This caused the code to convert 1 or -1 to 0.0. My fix assumes sizeof(arith) >= 8, so I can use n >> 32. Machines with sizeof(arith) of 5 to 7 would need to do (uarith)n >> 32, where uarith must be an unsigned integer type of same size as arith. In startrek.c, the Enterprise can now dock with a starbase. The compiler no longer translates s1 - 1 to s1 - 0.0 and s1 + 1 to s1 + 0.0, so the game now looks for starbases next to the Enterprise. |
||
---|---|---|
.. | ||
Amake.srclist | ||
b64_add.c | ||
b64_sft.c | ||
build.lua | ||
flt_add.c | ||
flt_ar2flt.c | ||
flt_arith.3 | ||
flt_arith.h | ||
flt_chk.c | ||
flt_cmp.c | ||
flt_div.c | ||
flt_flt2ar.c | ||
flt_misc.h | ||
flt_modf.c | ||
flt_mul.c | ||
flt_nrm.c | ||
flt_str2fl.c | ||
flt_umin.c | ||
split.c | ||
test.c |