From 83322562ce0c33a8026611471dc7b1b3241bce64 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 16 Feb 2026 12:52:07 +0100 Subject: refactor: invert FATAL_CHECK logic to standard assertion style - Inverted FATAL_CHECK macro to crash if condition is FALSE (standard assertion) - Updated all call sites in audio, GPU, and CNN subsystems - Updated documentation and examples - Recorded completion in doc/COMPLETED.md --- src/audio/backend/miniaudio_backend.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/audio/backend') diff --git a/src/audio/backend/miniaudio_backend.cc b/src/audio/backend/miniaudio_backend.cc index 26194c9..a921453 100644 --- a/src/audio/backend/miniaudio_backend.cc +++ b/src/audio/backend/miniaudio_backend.cc @@ -86,7 +86,7 @@ void MiniaudioBackend::audio_callback(ma_device* pDevice, void* pOutput, last_frameCount = frameCount; // Validate device state - FATAL_CHECK(!pDevice || pDevice->sampleRate == 0, + FATAL_CHECK(pDevice && pDevice->sampleRate != 0, "Invalid device in callback!\n"); // Check actual sample rate matches our expectation @@ -104,7 +104,7 @@ void MiniaudioBackend::audio_callback(ma_device* pDevice, void* pOutput, float* fOutput = (float*)pOutput; // BOUNDS CHECK: Sanity check on frameCount - FATAL_CHECK(frameCount > 8192 || frameCount == 0, + FATAL_CHECK(frameCount <= 8192 && frameCount > 0, "AUDIO CALLBACK ERROR: frameCount=%u (unreasonable!)\n", frameCount); -- cgit v1.2.3