From 01d6297becf507d4e5ce73766a66789e0619327f Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 17 Feb 2025 16:52:54 +1000 Subject: [PATCH] Fix some warnings with some more examples. --- examples/engine_effects.c | 2 +- examples/engine_sdl.c | 4 +++- examples/engine_steamaudio.c | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/engine_effects.c b/examples/engine_effects.c index acb259c5..876e4f87 100644 --- a/examples/engine_effects.c +++ b/examples/engine_effects.c @@ -101,4 +101,4 @@ int main(int argc, char** argv) ma_engine_uninit(&g_engine); return 0; -} \ No newline at end of file +} diff --git a/examples/engine_sdl.c b/examples/engine_sdl.c index 8b671618..37541d24 100644 --- a/examples/engine_sdl.c +++ b/examples/engine_sdl.c @@ -13,7 +13,7 @@ head. #include "../miniaudio.h" #define SDL_MAIN_HANDLED -#include /* Change this to your include location. Might be . */ +#include /* Change this to your include location. Might be . */ #define CHANNELS 2 /* Must be stereo for this example. */ #define SAMPLE_RATE 48000 @@ -23,6 +23,8 @@ static ma_sound g_sound; /* This example will play only a single soun void data_callback(void* pUserData, ma_uint8* pBuffer, int bufferSizeInBytes) { + (void)pUserData; + /* Reading is just a matter of reading straight from the engine. */ ma_uint32 bufferSizeInFrames = (ma_uint32)bufferSizeInBytes / ma_get_bytes_per_frame(ma_format_f32, ma_engine_get_channels(&g_engine)); ma_engine_read_pcm_frames(&g_engine, pBuffer, bufferSizeInFrames, NULL); diff --git a/examples/engine_steamaudio.c b/examples/engine_steamaudio.c index 71fdad6a..3e6469be 100644 --- a/examples/engine_steamaudio.c +++ b/examples/engine_steamaudio.c @@ -118,7 +118,7 @@ static void ma_steamaudio_binaural_node_process_pcm_frames(ma_node* pNode, const pBinauralNode->ppBuffersIn[0] = (float*)ma_offset_pcm_frames_const_ptr_f32(ppFramesIn[0], totalFramesProcessed, 1); } else { /* Slow path. Need to deinterleave the input data. */ - ma_deinterleave_pcm_frames(ma_format_f32, inputBufferDesc.numChannels, framesToProcessThisIteration, ma_offset_pcm_frames_const_ptr_f32(ppFramesIn[0], totalFramesProcessed, inputBufferDesc.numChannels), pBinauralNode->ppBuffersIn); + ma_deinterleave_pcm_frames(ma_format_f32, inputBufferDesc.numChannels, framesToProcessThisIteration, ma_offset_pcm_frames_const_ptr_f32(ppFramesIn[0], totalFramesProcessed, inputBufferDesc.numChannels), (void**)&pBinauralNode->ppBuffersIn[0]); } inputBufferDesc.data = pBinauralNode->ppBuffersIn; @@ -128,7 +128,7 @@ static void ma_steamaudio_binaural_node_process_pcm_frames(ma_node* pNode, const iplBinauralEffectApply(pBinauralNode->iplEffect, &binauralParams, &inputBufferDesc, &outputBufferDesc); /* Interleave straight into the output buffer. */ - ma_interleave_pcm_frames(ma_format_f32, 2, framesToProcessThisIteration, pBinauralNode->ppBuffersOut, ma_offset_pcm_frames_ptr_f32(ppFramesOut[0], totalFramesProcessed, 2)); + ma_interleave_pcm_frames(ma_format_f32, 2, framesToProcessThisIteration, (const void**)&pBinauralNode->ppBuffersOut[0], ma_offset_pcm_frames_ptr_f32(ppFramesOut[0], totalFramesProcessed, 2)); /* Advance. */ totalFramesProcessed += framesToProcessThisIteration; @@ -436,4 +436,4 @@ int main(int argc, char** argv) ma_engine_uninit(&g_engine); return 0; -} \ No newline at end of file +}