Fix some warnings with examples.

This commit is contained in:
David Reid
2025-02-17 16:01:19 +10:00
parent 47aa3e34e0
commit de5f370d09
5 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -706,4 +706,4 @@ int main(int argc, char** argv)
(void)argv; (void)argv;
return 0; return 0;
} }
+3 -1
View File
@@ -49,6 +49,8 @@ ma_decoder* g_pDecoders;
static ma_data_source* next_callback_tail(ma_data_source* pDataSource) static ma_data_source* next_callback_tail(ma_data_source* pDataSource)
{ {
(void)pDataSource; /* Unused. */
if (g_decoderCount > 0) { /* <-- We check for this in main() so should never happen. */ if (g_decoderCount > 0) { /* <-- We check for this in main() so should never happen. */
return NULL; return NULL;
} }
@@ -158,4 +160,4 @@ done_decoders:
free(g_pDecoders); free(g_pDecoders);
return 0; return 0;
} }
+2
View File
@@ -28,6 +28,8 @@ void capture_data_callback(ma_device* pDevice, void* pFramesOut, const void* pFr
ma_result result; ma_result result;
ma_uint32 framesWritten; ma_uint32 framesWritten;
(void)pFramesOut;
/* We need to write to the ring buffer. Need to do this in a loop. */ /* We need to write to the ring buffer. Need to do this in a loop. */
framesWritten = 0; framesWritten = 0;
while (framesWritten < frameCount) { while (framesWritten < frameCount) {
+1 -1
View File
@@ -266,7 +266,7 @@ int main(int argc, char** argv)
ma_thread_create(&jobThread, ma_thread_priority_default, 0, custom_job_thread, &resourceManager, NULL); ma_thread_create(&jobThread, ma_thread_priority_default, 0, custom_job_thread, &resourceManager, NULL);
/* Create each data source from the resource manager. Note that the caller is the owner. */ /* Create each data source from the resource manager. Note that the caller is the owner. */
for (iFile = 0; iFile < ma_countof(g_dataSources) && iFile < argc-1; iFile += 1) { for (iFile = 0; iFile < (int)ma_countof(g_dataSources) && iFile < argc-1; iFile += 1) {
result = ma_resource_manager_data_source_init( result = ma_resource_manager_data_source_init(
&resourceManager, &resourceManager,
argv[iFile+1], argv[iFile+1],
+1 -1
View File
@@ -29,7 +29,7 @@ ma_bool32* g_pDecodersAtEnd;
ma_event g_stopEvent; /* <-- Signaled by the audio thread, waited on by the main thread. */ ma_event g_stopEvent; /* <-- Signaled by the audio thread, waited on by the main thread. */
ma_bool32 are_all_decoders_at_end() ma_bool32 are_all_decoders_at_end(void)
{ {
ma_uint32 iDecoder; ma_uint32 iDecoder;
for (iDecoder = 0; iDecoder < g_decoderCount; ++iDecoder) { for (iDecoder = 0; iDecoder < g_decoderCount; ++iDecoder) {