Fix some warnings.

This commit is contained in:
David Reid
2026-01-28 09:48:25 +10:00
parent d1f34cd5db
commit 847711e291
+12 -12
View File
@@ -7974,9 +7974,9 @@ struct ma_device
ma_uint32 intermediaryBufferCap;
ma_uint32 intermediaryBufferLen; /* How many valid frames are sitting in the intermediary buffer. */
void* pInputCache; /* In external format. Can be null. */
ma_uint64 inputCacheCap;
ma_uint64 inputCacheConsumed;
ma_uint64 inputCacheRemaining;
ma_uint32 inputCacheCap;
ma_uint32 inputCacheConsumed;
ma_uint32 inputCacheRemaining;
} playback;
struct
{
@@ -20636,8 +20636,8 @@ static void ma_device__read_frames_from_client(ma_device* pDevice, ma_uint32 fra
break;
}
pDevice->playback.inputCacheConsumed += framesToReadThisIterationIn;
pDevice->playback.inputCacheRemaining -= framesToReadThisIterationIn;
pDevice->playback.inputCacheConsumed += (ma_uint32)framesToReadThisIterationIn;
pDevice->playback.inputCacheRemaining -= (ma_uint32)framesToReadThisIterationIn;
totalFramesReadOut += framesToReadThisIterationOut;
pRunningFramesOut = ma_offset_ptr(pRunningFramesOut, framesToReadThisIterationOut * ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels));
@@ -20761,8 +20761,8 @@ static ma_result ma_device__handle_duplex_callback_capture(ma_device* pDevice, m
/* Write to the ring buffer. The ring buffer is in the client format which means we need to convert. */
for (;;) {
ma_uint64 framesToProcessInDeviceFormat = (frameCountInDeviceFormat - totalDeviceFramesProcessed);
ma_uint64 framesToProcessInClientFormat = MA_DATA_CONVERTER_STACK_BUFFER_SIZE / ma_get_bytes_per_frame(pDevice->capture.format, pDevice->capture.channels);
ma_uint32 framesToProcessInDeviceFormat = (frameCountInDeviceFormat - totalDeviceFramesProcessed);
ma_uint32 framesToProcessInClientFormat = MA_DATA_CONVERTER_STACK_BUFFER_SIZE / ma_get_bytes_per_frame(pDevice->capture.format, pDevice->capture.channels);
ma_uint64 framesProcessedInDeviceFormat;
ma_uint64 framesProcessedInClientFormat;
void* pFramesInClientFormat;
@@ -20780,7 +20780,7 @@ static ma_result ma_device__handle_duplex_callback_capture(ma_device* pDevice, m
break;
}
ma_audio_ring_buffer_unmap_produce(pRB, framesProcessedInClientFormat);
ma_audio_ring_buffer_unmap_produce(pRB, (ma_uint32)framesProcessedInClientFormat);
pRunningFramesInDeviceFormat = ma_offset_ptr(pRunningFramesInDeviceFormat, framesProcessedInDeviceFormat * ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels));
totalDeviceFramesProcessed += (ma_uint32)framesProcessedInDeviceFormat; /* Safe cast. */
@@ -20821,8 +20821,8 @@ static ma_result ma_device__handle_duplex_callback_playback(ma_device* pDevice,
ma_uint64 framesConvertedOut = (frameCount - totalFramesReadOut);
ma_data_converter_process_pcm_frames(&pDevice->playback.converter, ma_offset_pcm_frames_ptr(pDevice->playback.pInputCache, pDevice->playback.inputCacheConsumed, pDevice->playback.format, pDevice->playback.channels), &framesConvertedIn, pFramesInInternalFormat, &framesConvertedOut);
pDevice->playback.inputCacheConsumed += framesConvertedIn;
pDevice->playback.inputCacheRemaining -= framesConvertedIn;
pDevice->playback.inputCacheConsumed += (ma_uint32)framesConvertedIn;
pDevice->playback.inputCacheRemaining -= (ma_uint32)framesConvertedIn;
totalFramesReadOut += (ma_uint32)framesConvertedOut; /* Safe cast. */
pFramesInInternalFormat = ma_offset_ptr(pFramesInInternalFormat, framesConvertedOut * ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels));
@@ -20830,7 +20830,7 @@ static ma_result ma_device__handle_duplex_callback_playback(ma_device* pDevice,
/* If there's no more data in the cache we'll need to fill it with some. */
if (totalFramesReadOut < frameCount && pDevice->playback.inputCacheRemaining == 0) {
ma_uint64 inputFrameCount;
ma_uint32 inputFrameCount;
void* pInputFrames;
inputFrameCount = pDevice->playback.inputCacheCap;
@@ -47186,7 +47186,7 @@ static ma_result ma_device__post_init_setup(ma_device* pDevice, ma_device_type d
}
pDevice->playback.pInputCache = pNewInputCache;
pDevice->playback.inputCacheCap = newInputCacheCap;
pDevice->playback.inputCacheCap = (ma_uint32)newInputCacheCap;
} else {
/* Heap allocation not required. Make sure we clear out the old cache just in case this function was called in response to a route change. */
ma_free(pDevice->playback.pInputCache, ma_device_get_allocation_callbacks(pDevice));