Clean up common/ comments and the log-ring strncpy warning

Comments must not document the past or reference plan circumstances:
drop the stale pointer to a never-created audio_correlate_layout.hpp,
the "step b" plan labels, the "carved out of reserved space" history
note, and a README pointer; reword a past-tense seqlock comment to
describe the failure mode in the present.

Replace the strncpy in log_ring_push with a bounded memcpy: same
semantics (truncate + NUL), but without the C4996 deprecation warning
on every host build.
This commit is contained in:
2026-07-12 08:31:48 +02:00
parent d73b43ad0d
commit 05039ab104
4 changed files with 16 additions and 16 deletions

View File

@@ -90,10 +90,9 @@ struct AudioRingHeader
// Host -> hook: format-verification co-capture. While 1, the hook pushes a still-being-measured
// (guessed) stream's raw pre-mix bytes into the ring WITHOUT silencing the game, so the host can
// capture both the hook (pre-mix) and a parallel process-loopback (post-mix) of the same audio
// and cross-correlate them to recover the true sample rate (and, in step b, channels/bit-depth)
// from ground truth instead of guessing. Inert (0) by default -- normal capture is unaffected,
// so it never changes the shipping no-echo path. It's a 4-byte atomic carved out of the header's
// reserved space; the version gate (kAudioRingVersion) rejects any layout that doesn't match.
// and cross-correlate them to recover the true sample rate / channels / bit-depth from ground
// truth instead of guessing (see audio_correlate.hpp). Inert (0) by default -- normal capture is
// unaffected, so it never changes the shipping no-echo path.
std::atomic<std::uint32_t> verify_capture;
std::uint8_t reserved[36];
@@ -275,10 +274,9 @@ inline std::uint32_t audio_ring_poll_op(AudioRingHeader& h, std::uint32_t& last_
return out.kind;
}
// Build the per-pid audio ring name both sides agree on. Stream 0 keeps the bare
// coop_audio_<pid> name (backward compatible / the single-stream case); additional
// streams append _<index> (coop_audio_<pid>_1, _2, ...). The host captures every
// render stream into its own ring and mixes them.
// Build the per-pid audio ring name both sides agree on. Stream 0 uses the bare
// coop_audio_<pid> name; additional streams append _<index> (coop_audio_<pid>_1,
// _2, ...). The host captures every render stream into its own ring and mixes them.
inline std::wstring audio_ring_name(unsigned long target_pid, unsigned index = 0)
{
std::wstring name = std::wstring(kAudioRingPrefix) + std::to_wstring(target_pid);