raze-gles/polymer/eduke32/source/lunatic
helixhorned 54721d7461 Make ksqrt take uint32_t, add helper function uint32_t uhypsq(int32_t,int32_t).
uhypsq calculates the hypotenuse using unsigned multiplication. This is
permissible since for arbitrary int32s a and b, the following holds in
two's complement arithmetic:
  (int32_t)((uint32_t)a * b) == (int32_t)((int64_t)a * b)
("Signed and unsigned multiplication is the same on the bit level.")

This fixes various overflows where wall lengths for walls of length > 46340
are calculated, but does not rid us of other overflows in the same vein
(usually dot products between vectors where one point is a wall vertex and
the other a position in a sector).

git-svn-id: https://svn.eduke32.com/eduke32@2791 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:14 +00:00
..
test Lunatic translator: fix dangling else and add a test file, tweak warnings 2012-06-13 23:13:26 +00:00
con_lang.lua Lunatic: various stuff 2012-06-22 21:40:01 +00:00
defs.ilua Make ksqrt take uint32_t, add helper function uint32_t uhypsq(int32_t,int32_t). 2012-07-01 22:11:14 +00:00
dynsymlist Lunatic: ksqrt, with timing and value test. 2012-07-01 22:11:07 +00:00
lunacon.lua Lunatic: various stuff 2012-06-22 21:40:01 +00:00
lunatic.c Lunatic: actors 2012-06-10 18:56:15 +00:00
lunatic.h Lunatic: actors 2012-06-10 18:56:15 +00:00
strict.lua Lunatic t.: handle prefix-problematic commands for real, definelevelname, ... 2012-06-17 19:45:37 +00:00
test.elua Make ksqrt take uint32_t, add helper function uint32_t uhypsq(int32_t,int32_t). 2012-07-01 22:11:14 +00:00