Commit graph

32 commits

Author SHA1 Message Date
Kp 5eec2a5ce5 Use valptridx for Vertices 2017-08-11 23:43:54 +00:00
Kp 599ac9dee0 Always qualify valptridx type/factory
Previously, valptridx used PREFIX for allow-invalid+mutable, c#PREFIX
for allow-invalid+const, v#PREFIX for require-valid+mutable, vc#PREFIX
for require-valid+const.  Convert the types, factories, and all usage
sites to specify a qualifier for all four combinations:

	im#PREFIX -> allow-invalid+mutable
	ic#PREFIX -> allow-invalid+const
	vm#PREFIX -> require-valid+mutable
	vc#PREFIX -> require-valid+const

Changes to common/include/valptridx.h and common/include/fwd-valptridx.h
are manual.  All other changes are generated by:

	git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\(v\?\)\(\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/\1m\2/g'

for the 'm' prefix and:

	git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\([cm]\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/i&/g'

for the 'i' prefix.
2017-06-10 03:31:02 +00:00
Kp c786e34ec7 Factor out scale_free_verts calls in med_scale_segment_new 2017-03-10 01:22:24 +00:00
Kp cdb193c053 Use unsigned for sides/verts in more places 2017-02-19 19:33:38 +00:00
Kp 262094237f Rewrite simple numeric casts from C style to static_cast<>
s/(\(int\|float\|fix\))\s*(/static_cast<\1>(/g
2016-07-06 01:54:24 +00:00
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 e8c34be843 Use v*ptr* factories with highest_valid 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 bc7c469ab2 Use array<> for more globals 2015-08-12 03:11:46 +00:00
Kp a5476c5605 Use array<> for segsize_common propagated 2015-07-18 21:01:55 +00:00
Kp fa8dcc9113 Explicitly delete basic_ptridx(pointer_type); require array
Require the array argument for basic_ptridx, which is supplied
automatically when the factory is used.
2015-07-13 01:09:37 +00:00
Kp adcd8d7fa7 Use valptr for ksegsize highest_valid 2015-06-13 22:42:17 +00:00
Kp 315f1ce815 Use array<> for Side_to_verts 2015-02-14 22:48:27 +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 0202a4b054 Pass scale_vert vector by & 2014-11-01 03:14:14 +00:00
Kp 5bb9c88979 Add vm_vec_sub that returns result 2014-10-29 03:24:31 +00:00
Kp 53aa70cecb Use vsegptridx_t 2014-10-28 03:08:51 +00:00
Kp fc5b50c433 Pass med_create_new_segment arg by & 2014-10-26 22:01:13 +00:00
Kp 68309dfef0 Pass extract_*_vector_from_segment arg by & 2014-10-26 21:37:06 +00:00
Kp 7f648c0f5f Wrap segment iteration idiom 2014-10-12 23:10:05 +00:00
Kp ca3a4524a2 Pass med_extract_*_vector_from_segment_side arg as & 2014-10-02 03:02:37 +00:00
Kp 321bbe37d8 Pass vm_vec_sub arguments by & 2014-09-28 21:11:45 +00:00
Kp 2107b52764 Pass vm_vec_add arguments by & 2014-09-28 21:11:40 +00:00
Kp 74925e9b45 Pass vm_vec_scale dest by & 2014-09-28 21:11:05 +00:00
Kp 1e6bf36e20 Pass vm_vec_mag v by const& 2014-09-28 21:11:03 +00:00
Kp 1d4ceba9ee Propagate for variables in similar/editor/ksegsize.cpp 2014-09-26 02:42:11 +00:00
Kp ec541f0cf2 Compact validate_modified_segments 2014-08-12 03:09:32 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp 9a5d0f6f09 Use symbolic values for segment/object first/none 2014-01-06 04:17:55 +00:00
Kp 2714679284 Mark private functions static 2013-11-02 04:23:55 +00:00
Kp 8744e5f55e Move similar/editor/ksegsize.c -> similar/editor/ksegsize.cpp 2012-11-17 06:14:09 +00:00
Renamed from similar/editor/ksegsize.c (Browse further)