Commit graph

23 commits

Author SHA1 Message Date
Kp b282bea173 Rewrite simple integer casts from C style to static_cast<>
This pass only targets commonly used standard types.

s/(\(\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\)\s*)\s*(/static_cast<\1>(/g
2016-06-05 01:04:26 +00:00
Kp 7fdce88558 Add parentheses around target of simple casts
C casts do not require parentheses.  C++ casts require grouping around
the target.  Prepare for conversion to C++ casts by adding otherwise
unnecessary parentheses around the target of simple C casts.

This pass does not attempt to process expressions that involve
any subexpression that can nest arbitrarily, such as parentheses or
brackets.  It also works only on commonly used standard types.

	(int) a->b;	// changed
	(int) a[b];	// not changed

s/\((\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\s*\**\s*)\s*\)\([&+-]\?\)\([[:alnum:]_.]\+\s*->\s*\)*\([[:alnum:]_.]\+\)\(\s*\([];+>)*\/^%,|&<>]\)\|$\|\(\s*-\s*[^>]\)\)/\1(\5\6\7)\8/g
2016-06-05 01:04:25 +00:00
Kp 568f165c28 Shrink sincos_table
For all valid i, sincos_table[i] == sincos_table[i % 256].  Remove
elements [256:] and modify callers to truncate the index.
2016-01-09 16:38:11 +00:00
Kp dc8c0323d8 Uninline namespace dcx 2015-12-13 18:00:49 +00:00
Kp cfc35e819d Use inline namespace dcx for common/maths 2015-12-05 22:57:24 +00:00
Bradley Bell bdacd2f7d7 change u_int*_t to C99 standard uint*_t 2015-05-18 17:12:53 -07:00
Kp 9f01dcf0db Use signed multiplier in fix_sincos
Fixes: a5b83d19de ("Simplify fix_sin/fix_cos calls")
2015-04-30 03:32:27 +00:00
Kp a5b83d19de Simplify fix_sin/fix_cos calls 2015-04-29 03:35:09 +00:00
Kp 1c58627aa3 Remove unused cos from fix_fastsincos 2015-02-05 03:03:50 +00:00
Kp 4c8f3a47b5 Convert frequently used casts to C++ casts 2015-02-05 03:03:49 +00:00
Kp a8784bc486 Fold fixmul calls to fixmul64 2015-02-05 03:03:48 +00:00
Kp cf4a36aeff Optimize quad_sqrt masking 2015-02-01 23:07:18 +00:00
Kp e0529b06a7 Improve fixmul* readability 2015-01-29 04:27:37 +00:00
Kp 4b04ccc1c2 Pass quadint to fixdivquadlongu 2014-08-16 17:44:26 +00:00
Kp 0ec8b6671f Use native int64 math for fixmulaccum 2014-08-16 17:43:56 +00:00
Kp ceeaadb940 Add native int64 to quadint struct 2014-08-16 17:42:34 +00:00
Kp 62c656c00c Pass quadint to quad_sqrt 2014-08-08 02:53:57 +00:00
Kp 279d39a2d7 Inline fixdivquadlong 2014-08-08 02:53:26 +00:00
zico c96aece6d2 Removed PARALLAX banner from source files that were not released by PARALLAX; most importantly C source code translated from Assembler and args.cpp which was rewritten from scratch 2014-06-12 10:41:03 +02:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp 2714679284 Mark private functions static 2013-11-02 04:23:55 +00:00
Kp 6b48994596 Avoid unnecessary lookups in fix_sincos 2013-08-08 03:01:47 +00:00
Kp bae5ce9a66 Move common/maths/fixc.c -> common/maths/fixc.cpp 2013-08-03 17:45:23 +00:00
Renamed from common/maths/fixc.c (Browse further)