Commit graph

15 commits

Author SHA1 Message Date
Kp e1aac6949a Replace __attribute_warn_unused_result with C++17 [[nodiscard]]
This eliminates a configure test, and may help readers understand the
annotation more readily.
2021-06-28 03:37:51 +00:00
Kp 755186ada2 Remove use of deprecated std::iterator 2020-05-02 21:18:43 +00:00
Kp 2de3a1dd06 Pass unique_segment to objects_in 2018-06-24 05:06:14 +00:00
Kp aa56477742 Propagate objects_in arguments 2017-08-13 20:38:31 +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 57412a21c9 Return vobjptridx from segiter
The segiter code used objptridx because end is signalled by object_none,
and vobjptridx does not allow object_none.  However, the compiler
produces better code if segment_object_range_t returns vobjptridx and
future cleanups are easier if iterating objects_in yields vobjptridx
objects.  Add a special-case override of the normal checking rules, move
the required checks into segiter, and then let segiter break the rules
normally enforced by valptridx.  Add a comment explaining that this
permits unsafe coding and should be done only with a clear understanding
of the responsibilities it brings.
2016-10-29 23:16:18 +00:00
Kp aa58e02337 Add consistency asserts in segment iterator 2016-10-29 23:16:17 +00:00
Kp c772385f81 Fix check_header_includes=1 Linux build 2016-08-06 19:55:24 +00:00
Kp 797c8b47b2 Move segment_object_iterator_t into segment_object_range_t 2016-03-19 19:08:10 +00:00
Kp 82d0c2ed96 Make some implicit uses of ptridx construction explicit 2015-11-19 03:23:34 +00:00
Kp 15fb75c1c7 Fix check_header_includes build 2015-07-25 23:10:45 +00:00
Kp 8b7c5c3e2b Rewrite valptridx
Move decisions out to policy classes.  Provide trivial copy
construction/assignment.  Simplify checking for unsafe conversions.
2015-07-09 03:12:45 +00:00
Kp f4517dc0bd Reduce inclusion of segment.h 2015-01-29 04:27:36 +00:00
Kp 53aa70cecb Use vsegptridx_t 2014-10-28 03:08:51 +00:00
Kp 0f7e561775 Add helper to iterate over objects in segment 2014-07-30 03:06:40 +00:00