Cut core/wire and shell/persist comment bloat ~46% (comments only, zero code change)
This commit is contained in:
+10
-20
@@ -1,19 +1,12 @@
|
||||
// core/wire/bytes.h — the ONE little-endian byte codec (Q-W2v; audit T4-20).
|
||||
// Pure, header-only: standard library only — NO REAPER, NO SWELL, NO VST3.
|
||||
// core/wire/bytes.h — the ONE little-endian byte codec. Pure, header-only:
|
||||
// standard library only — no REAPER, no SWELL, no VST3.
|
||||
//
|
||||
// Five hand-rolled LE copies existed at the Q-W0 census (sample_map's
|
||||
// putU32le/putU64le + ByteReader, capture_realtime's writeU32LE, capture_paths'
|
||||
// readU32LE lambda, ingest's putU32 lambda, instrument_drop's appendU32LE). This
|
||||
// template is the single survivor: compile-time dispatched, zero runtime cost,
|
||||
// entirely off hot paths (serialization / file I/O only). The ComponentState
|
||||
// codec (component_state_io) is its biggest consumer; the remaining hand-rolled
|
||||
// copies rewire opportunistically in the waves that already open their files.
|
||||
//
|
||||
// Wire formats are FROZEN: putLE<u32>/putLE<u64> emit exactly the bytes the
|
||||
// retired putU32le/putU64le emitted (LSB first, fixed width), and ByteReader
|
||||
// preserves the latch-on-truncation contract (once a read runs past the end,
|
||||
// ok latches false and every subsequent read yields zeros/empties — a truncated
|
||||
// blob degrades to a partial parse, never out-of-bounds).
|
||||
// component_state_io is the biggest consumer. Wire format is FROZEN: putLE
|
||||
// emits fixed-width LSB-first bytes exactly as the hand-rolled copies it
|
||||
// replaced did, and ByteReader preserves the latch-on-truncation contract —
|
||||
// once a read runs past the end, ok latches false and every subsequent read
|
||||
// yields zeros/empties, so a truncated blob degrades to a partial parse,
|
||||
// never an out-of-bounds read.
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -50,11 +43,8 @@ inline double bitsToDouble(std::uint64_t bits) {
|
||||
return d;
|
||||
}
|
||||
|
||||
// A bounded little-endian reader over a byte blob. Every read is length-checked;
|
||||
// once a read runs past the end the reader latches `ok=false` and yields zeros,
|
||||
// so a truncated blob degrades to a partial/empty parse rather than reading out
|
||||
// of bounds. (The class formerly private to sample_map.cpp, promoted here as the
|
||||
// codec's tested primitive — T4-20.)
|
||||
// A bounded little-endian reader over a byte blob (see the file header for the
|
||||
// truncation-latch contract).
|
||||
struct ByteReader {
|
||||
const std::vector<std::uint8_t>& bytes;
|
||||
std::size_t pos = 0;
|
||||
|
||||
Reference in New Issue
Block a user