ack/modules/src/flt_arith
George Koehler e5e96d5226 Convert 1 to 1.0, not 0.0, for machines with 64-bit long.
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.
2016-11-06 19:34:51 -05:00
..
Amake.srclist Added copyright notice 1995-07-31 09:10:42 +00:00
b64_add.c Simplify flt_arith now that mantissa uses uint32_t. 2016-11-05 21:51:53 -04:00
b64_sft.c Simplify flt_arith now that mantissa uses uint32_t. 2016-11-05 21:51:53 -04:00
build.lua Simplify flt_arith now that mantissa uses uint32_t. 2016-11-05 21:51:53 -04:00
flt_add.c Simplify flt_arith now that mantissa uses uint32_t. 2016-11-05 21:51:53 -04:00
flt_ar2flt.c Convert 1 to 1.0, not 0.0, for machines with 64-bit long. 2016-11-06 19:34:51 -05:00
flt_arith.3 Simplify flt_arith now that mantissa uses uint32_t. 2016-11-05 21:51:53 -04:00
flt_arith.h Switch flt_mantissa fields from long to uint32_t. 2016-11-05 17:00:24 -04:00
flt_chk.c Header --> Id 1994-06-24 11:31:16 +00:00
flt_cmp.c Header --> Id 1994-06-24 11:31:16 +00:00
flt_div.c Simplify flt_arith now that mantissa uses uint32_t. 2016-11-05 21:51:53 -04:00
flt_flt2ar.c Header --> Id 1994-06-24 11:31:16 +00:00
flt_misc.h Simplify flt_arith now that mantissa uses uint32_t. 2016-11-05 21:51:53 -04:00
flt_modf.c Header --> Id 1994-06-24 11:31:16 +00:00
flt_mul.c Simplify flt_arith now that mantissa uses uint32_t. 2016-11-05 21:51:53 -04:00
flt_nrm.c Simplify flt_arith now that mantissa uses uint32_t. 2016-11-05 21:51:53 -04:00
flt_str2fl.c Header --> Id 1994-06-24 11:31:16 +00:00
flt_umin.c Header --> Id 1994-06-24 11:31:16 +00:00
split.c Header --> Id 1994-06-24 11:31:16 +00:00
test.c Simplify flt_arith now that mantissa uses uint32_t. 2016-11-05 21:51:53 -04:00