Commit graph

117 commits

Author SHA1 Message Date
Kp 89ddc1b911 Add parentheses around casts of simple array subscripts
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.

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*-\s*[^>]\)\)/\1(\5\6\7\8)\9/g
2016-06-25 23:21:36 +00:00
Kp 2fd6a425b0 Remove highest_valid 2016-02-12 04:02:28 +00:00
Kp b57f08c798 Use partial_const_range 2016-02-12 04:02:28 +00:00
Kp a3ae630829 Remove default argument for basic_ptridx(index) 2016-01-09 16:38:14 +00:00
Kp 3aefd0bf2f Defer change_segment_light multiply
If light_intensity is zero, skip the multiplication.
2016-01-09 16:38:11 +00:00
Kp 24e902d4cf Simplify find_connect_side 2016-01-03 20:21:35 +00:00
Kp 5ba5910e7a Use symbolic side_none for testing find_connect_side result 2016-01-03 20:21:35 +00:00
Kp 2bd538f353 Sort delta light indices 2015-12-22 04:18:52 +00:00
Kp de88e595e9 Hoist change_light variables 2015-12-22 04:18:52 +00:00
Kp e8c34be843 Use v*ptr* factories with highest_valid 2015-12-22 04:18:51 +00:00
Kp d479819931 Use absolute_sibling to reduce global references for ptridx 2015-12-22 04:18:51 +00:00
Kp db9fb0ed42 Move more symbols into namespace dcx/dsx 2015-12-22 04:18:50 +00:00
Kp 26e948d5f1 Uninline namespace dsx 2015-12-13 18:00:49 +00:00
Kp 32051298ae Use inline namespace dcx/dsx for more symbols 2015-12-13 18:00:48 +00:00
Kp 34d89d5139 Use inline namespace dsx for segment.h 2015-12-05 22:57:25 +00:00
Kp 682b845b9d Reorder gameseg distance tests 2015-10-18 21:01:20 +00:00
Kp 54e12654bb Factor out side_pokes_out 2015-10-18 21:01:20 +00:00
Kp f5abe5bc5e Combine gameseg vm_dist_to_plane calls 2015-10-18 21:01:20 +00:00
Kp 6f94cc933c Fold create_abs_vertex_lists into create_all_vertnum_lists 2015-10-18 21:01:20 +00:00
Kp af2d8f7deb Factor out create_vert*_lists switch 2015-10-18 21:01:20 +00:00
Kp b447adcce1 Initialize all vertices in create_abs_vertex_lists
Some compiler configurations warn that vertices[4] and vertices[5] may
be used uninitialized.  Initialize them to a bogus value so that any
actual use will trap, but the comparisons will be well defined.
2015-10-03 17:17:50 +00:00
Kp 17b1943c5e Mark various per-file structures as static 2015-08-12 03:11:46 +00:00
Kp bc7c469ab2 Use array<> for more globals 2015-08-12 03:11:46 +00:00
Kp 4c53f79a89 Use valptr for gameseg.cpp 2015-07-12 01:04:20 +00:00
Kp 1b6999ff4d Switch get_seg_masks from vcsegptridx_t to vcsegptr_t
The index component is not needed.
2015-07-12 01:04:17 +00:00
Kp fe360b18e3 Implement secluded spawns 2015-07-04 21:01:18 +00:00
Kp 3905f1a668 Enable -Wcast-qual 2015-06-13 22:42:21 +00:00
Kp c8ce2c32de Simplify extract_shortpos_little 2015-06-13 22:42:21 +00:00
Kp 1dc0e24f30 Propagate swap_bytes argument for create_shortpos
In every case but one, create_shortpos was called with a constant flag
equal to words_bigendian.  The demo system called it with a constant 0.
Split create_shortpos into create_shortpos_little and
create_shortpos_native.  Use create_shortpos_native for the demo system,
and create_shortpos_little everywhere else.
2015-06-13 22:42:21 +00:00
Kp a8e1e504ef Use valptr for gameseg highest_valid 2015-06-13 22:42:17 +00:00
Kp 148c0f44c8 Convert segnum_t to uint16_t 2015-06-13 22:42:15 +00:00
Kp 67b684f277 Fix surface in exit video
Fixes: f3aa8e501b ("Simplify extract_vector_from_segment")
2015-06-06 18:03:45 +00:00
Kp f3aa8e501b Simplify extract_vector_from_segment 2015-05-09 17:38:59 +00:00
Kp b0ec49f8e5 Remove unused file+line from get_seg_masks 2015-04-02 02:36:56 +00:00
Kp 90fbebf8fd Convert most global arrays to array<> 2015-04-02 02:36:52 +00:00
Kp 1e5acb5f6e Fix guided missile crash
Check type before checking signature.  Objects with type OBJ_NONE are
not guaranteed to have any particular signature.  Commit 91d31b1 removed
the statement which cleared the signature when the type changes to
OBJ_NONE.

Fixes: 91d31b1952 ("Wrap object signature in subtype")
2015-03-22 22:48:47 +00:00
Kp 2c09f9fa90 Propagate special types for distance/magnitude 2015-03-12 02:21:19 +00:00
Kp f17458d353 Explicitly delete valptridx inequality operators 2015-02-14 22:48:30 +00:00
Kp 315f1ce815 Use array<> for Side_to_verts 2015-02-14 22:48:27 +00:00
Kp dc8b88eed4 Convert various loops to range_for 2015-02-14 22:48:27 +00:00
Kp 8f5e6df9a5 Use array<> for Side_to_verts 2015-02-05 03:03:50 +00:00
Kp 99a4a0ed62 Capture range_for by-value temporaries as const
Modifying a by-value temporary does not affect the underlying container,
so modifying it is almost always a bug.  Require use of a by-reference
capture when modification is desired.

sed -i -e 's/range_for\s*(\s*\(const\s\+\)\?auto\s\+\([[:alpha:]_]\)/range_for (const auto \2/g'
2015-02-05 03:03:49 +00:00
Kp 0868df1637 Use explicit swap for get_verts_for_normal 2015-01-29 04:27:36 +00:00
Kp 702ea40ade Move segment declarations to fwdsegment.h 2014-12-22 04:35:49 +00:00
Kp e42b1f5b71 Return vertex_array_list_t from create_all_vertnum_lists 2014-12-14 05:23:00 +00:00
Kp 1960a2ebad Return vertex_array_list_t from create_abs_vertex_lists 2014-12-14 05:23:00 +00:00
Kp 601290e674 Return vertex_array_list_t from create_all_vertex_lists 2014-12-14 05:23:00 +00:00
Kp 5aaf847c41 Fix various -Wnarrowing errors 2014-11-26 03:39:21 +00:00
Kp cd6e8bc8b8 Fix error checking in debug build 2014-11-23 21:53:45 +00:00
Kp d63be88eb0 Propagate use of vsegptridx_t 2014-11-23 04:58:45 +00:00