Wrap long lines to fit within 80 columns across the codebase

Pure whitespace/line-break reformatting (braces, newlines, and line
continuations matching this codebase's existing wrap conventions) - no
logic, string content, or identifiers changed anywhere. Confirmed via
diff against the pre-change tree and by rebuilding + re-running the
affected test suites, which produce identical pass/fail results.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
2026-09-05 13:13:10 -05:00
co-authored by Claude Sonnet 5
parent de53bebeb8
commit cebd3d81e7
70 changed files with 1025 additions and 425 deletions
+5 -2
View File
@@ -194,7 +194,9 @@ errorret_t audioStreamMp3DecoderDecodeFrame(
const size_t frameSize = stream->channels * sizeof(int16_t);
for(;;) {
if(sceMp3CheckStreamDataNeeded(decoder->handle) > 0 && !decoder->endOfFile) {
if(
sceMp3CheckStreamDataNeeded(decoder->handle) > 0 && !decoder->endOfFile
) {
errorChain(audioStreamMp3DecoderFillStream(stream));
}
@@ -210,7 +212,8 @@ errorret_t audioStreamMp3DecoderDecodeFrame(
// whatever followed stream->mp3.pending in memory, and only showed
// up as very intermittent audio clicking.
assertTrue(
(size_t) bytesDecoded <= AUDIO_MP3_MAX_SAMPLES_PER_FRAME * sizeof(int16_t),
(size_t) bytesDecoded <=
AUDIO_MP3_MAX_SAMPLES_PER_FRAME * sizeof(int16_t),
"sceMp3Decode returned more PCM than the destination buffer can hold."
);
const size_t frames = (size_t) bytesDecoded / frameSize;
+3 -2
View File
@@ -48,8 +48,9 @@ typedef struct {
/**
* Feeds sceMp3 more compressed bytes if (and only as much as) it currently
* wants: asks it where in the stream and how much (sceMp3GetInfoToAddStreamData()),
* reads exactly that from stream->mp3.file, and hands it back
* wants: asks it where in the stream and how much
* (sceMp3GetInfoToAddStreamData()), reads exactly that from stream->mp3.file,
* and hands it back
* (sceMp3NotifyAddStreamData()). A no-op if sceMp3 doesn't currently want
* more. See this file's own top-of-file comment on why the source
* position sceMp3 requests is asserted rather than actually used to seek.
+24 -11
View File
@@ -127,7 +127,8 @@ errorret_t audioStreamPSPBuffer(audiostream_t *stream) {
stream->platform.loopEndFrame
);
const size_t startFrame = mathMin(stream->startFrame, stream->platform.totalFrames);
const size_t startFrame =
mathMin(stream->startFrame, stream->platform.totalFrames);
stream->startFrame = 0;
stream->seeking = false;
@@ -181,10 +182,12 @@ void audioStreamPSPTopUp(audiostream_t *stream) {
const size_t room = mathMin(
AUDIO_PSP_RING_FRAMES - filled, (size_t) AUDIO_PSP_TOPUP_STEP_FRAMES
);
const size_t currentEndFrame = stream->platform.readPosition < stream->platform.loopEndFrame
const size_t currentEndFrame =
stream->platform.readPosition < stream->platform.loopEndFrame
? stream->platform.loopEndFrame
: stream->platform.totalFrames;
const size_t framesRemainingInSegment = currentEndFrame - stream->platform.readPosition;
const size_t framesRemainingInSegment =
currentEndFrame - stream->platform.readPosition;
const size_t framesToRead = mathMin(room, framesRemainingInSegment);
if(framesToRead > 0) {
@@ -201,7 +204,8 @@ void audioStreamPSPTopUp(audiostream_t *stream) {
if(framesRead > 0) {
threadMutexLock(&stream->platform.ringLock);
for(size_t i = 0; i < framesRead; i++) {
const size_t writeIndex = (stream->platform.ringWritePos + i) % AUDIO_PSP_RING_FRAMES;
const size_t writeIndex =
(stream->platform.ringWritePos + i) % AUDIO_PSP_RING_FRAMES;
memoryCopy(
stream->platform.ring + (writeIndex * channels),
scratch + (i * channels),
@@ -239,7 +243,8 @@ void audioStreamPSPTopUp(audiostream_t *stream) {
// still the right thing to compare against loopLimit.
const bool_t loopLimitReached = stream->loopLimit > 0 &&
stream->loopRestartCount >= stream->loopLimit;
const bool_t reachesSegmentEnd = stream->platform.readPosition >= currentEndFrame;
const bool_t reachesSegmentEnd =
stream->platform.readPosition >= currentEndFrame;
const bool_t willLoop = reachesSegmentEnd &&
(stream->state & AUDIO_STREAM_STATE_LOOPING) && !loopLimitReached;
@@ -257,7 +262,8 @@ void audioStreamPSPTopUp(audiostream_t *stream) {
const size_t index = (
stream->platform.loopMarkerHead + stream->platform.loopMarkerCount
) % AUDIO_PSP_LOOP_MARKER_MAX;
stream->platform.loopMarkerFrames[index] = stream->platform.framesEnqueued;
stream->platform.loopMarkerFrames[index] =
stream->platform.framesEnqueued;
stream->platform.loopMarkerCount++;
}
threadMutexUnlock(&stream->platform.ringLock);
@@ -282,7 +288,9 @@ bool_t audioStreamPSPIsFinished(audiostream_t *stream) {
void audioStreamPSPThreadFeed(thread_t *thread) {
assertNotNull(thread, "Thread cannot be NULL.");
sceKernelChangeThreadPriority(sceKernelGetThreadId(), AUDIO_PSP_THREAD_PRIORITY);
sceKernelChangeThreadPriority(
sceKernelGetThreadId(), AUDIO_PSP_THREAD_PRIORITY
);
audiostream_t *stream = (audiostream_t *) thread->data;
const size_t channels = stream->channels;
@@ -321,7 +329,9 @@ void audioStreamPSPThreadFeed(thread_t *thread) {
threadMutexUnlock(&stream->platform.ringLock);
if(available >= AUDIO_PSP_CHUNK_FRAMES) break;
if(stream->platform.readReachedEnd || stream->platform.readFailed) break;
if(
stream->platform.readReachedEnd || stream->platform.readFailed
) break;
if(threadShouldStop(thread)) {
stopRequested = true;
break;
@@ -358,7 +368,8 @@ void audioStreamPSPThreadFeed(thread_t *thread) {
threadMutexLock(&stream->platform.ringLock);
for(size_t i = 0; i < framesThisChunk; i++) {
const size_t readIndex = (stream->platform.ringReadPos + i) % AUDIO_PSP_RING_FRAMES;
const size_t readIndex =
(stream->platform.ringReadPos + i) % AUDIO_PSP_RING_FRAMES;
memoryCopy(
chunk + (i * channels),
stream->platform.ring + (readIndex * channels),
@@ -366,7 +377,8 @@ void audioStreamPSPThreadFeed(thread_t *thread) {
);
}
stream->platform.ringReadPos =
(stream->platform.ringReadPos + framesThisChunk) % AUDIO_PSP_RING_FRAMES;
(stream->platform.ringReadPos + framesThisChunk) %
AUDIO_PSP_RING_FRAMES;
stream->platform.ringFilled -= framesThisChunk;
threadMutexUnlock(&stream->platform.ringLock);
@@ -389,7 +401,8 @@ void audioStreamPSPThreadFeed(thread_t *thread) {
: AUDIO_PSP_FADE_FRAMES;
for(size_t i = 0; i < fadeFrames; i++) {
const size_t frame = framesThisChunk - fadeFrames + i;
const float_t factor = 1.0f - ((float_t) (i + 1) / (float_t) fadeFrames);
const float_t factor =
1.0f - ((float_t) (i + 1) / (float_t) fadeFrames);
for(size_t c = 0; c < channels; c++) {
int16_t *sample = &chunk[frame * channels + c];
*sample = (int16_t) ((float_t) *sample * factor);