gcc-9 warns on taking the address of an unaligned member in a packed
structure. This structure does not need to be packed. Remove
__attribute__((packed)) and fix the code to implement I/O correctly
without packing.
Ambient sound effects have always been buggy in certain topologies,
since `ambient_mark_bfs` refuses to cross its own path. Consider a
corridor:
L _ _ _ _ _ _ _ _ _ _
_ _
_ L
Where L is a lavafall emitting sound, whitespace is insignificant, _ is
a segment, * is a tagged segment, and / is a segment that should be
tagged, but is not. Let the leftmost L be a lower number segment than
the lower L. Sound propagation after the first step is:
L * * * * * _ _ _ _ _
* _
* L
After the second step, it should be:
L * * * * * * * * _ _
* *
* L
However, `ambient_mark_bfs` will stop when it hits the intersection, so
instead the result is:
L * * * * * / / / _ _
* *
* L
To further confuse the issue, emitter segments are processed in memory
order, so if the leftmost L is a higher index segment than the lower L,
the lower L will be processed first and the steps will be:
L _ * * * * * * * _ _
_ *
_ L
L * * * * * * * * _ _
/ *
/ L
Rewrite the propagation to record the travel depth remaining at each
node, and permit it to cross a segment with a lower depth remaining than
the current step. This still stops early when traversal attempts to
backtrack over itself, but permits it to visit, tag, and cross segments
that were previously visited by a different emitter.
Packed structures cannot be passed by reference, may fail on
alignment-strict architectures, and are bad for performance even on
alignment-tolerant architectures. Using them for anything other than an
abstract layout declaration is a mistake. Remove
__attribute__((packed)).