Commit graph

16 commits

Author SHA1 Message Date
carl add131b6f9 ANSI C conversion of code, rename some parameters to better names and adapt man page accordingly. 2019-05-11 00:56:13 +08:00
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
ceriel 5c83e7dbb5 Header --> Id 1994-06-24 11:31:16 +00:00
ceriel 11d4fdf6e0 Added prototyping stuff 1993-11-10 11:14:28 +00:00
ceriel ab8dcfa134 ANSI C fixes 1993-10-21 12:50:58 +00:00
ceriel 182c7ebd70 Fixed flt_ar2flt.c 1991-10-02 15:20:22 +00:00
ceriel ea9332362d correction 1991-06-26 17:26:59 +00:00
ceriel 977e1ac25e Removed unused variable 1991-03-11 14:38:28 +00:00
ceriel ee02bfcd82 minor mods 1991-02-26 15:46:18 +00:00
ceriel 9a294d4821 Changed name of include file 1991-02-19 13:53:04 +00:00
ceriel 0c95aa4b86 fixed library order : fix for 2-byte machines 1990-02-23 17:02:06 +00:00
ceriel 862f83571f speeded up a bit for converting 0.0 to string 1989-11-27 17:25:55 +00:00
ceriel 35c612b99b some minor improvements 1989-10-19 14:50:52 +00:00
ceriel 82c3158ada simplified a bit 1989-10-16 17:56:36 +00:00
ceriel 1e9c82d6e5 made to work, and added the b64 shift routines to the interface 1989-07-11 09:15:17 +00:00
ceriel c20a2155fa Initial revision 1989-07-10 11:17:19 +00:00