From f6f827f439c221b91993fa38e81d2c0a3491f06c Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Mon, 21 Oct 2024 09:48:25 +0100 Subject: [PATCH] miniaudio: Fix warnings --- source/src/node/io/input/miniaudio.cpp | 10 ++++++++-- source/src/node/io/output/miniaudio.cpp | 10 +++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/source/src/node/io/input/miniaudio.cpp b/source/src/node/io/input/miniaudio.cpp index 74dffd7b..48036622 100644 --- a/source/src/node/io/input/miniaudio.cpp +++ b/source/src/node/io/input/miniaudio.cpp @@ -28,9 +28,9 @@ void read_callback(ma_device *pDevice, // TODO: the number of channels at the mic input might not be the same as the number of channels of this device int num_channels = input_node->get_num_output_channels(); - for (int frame = 0; frame < frameCount; frame++) + for (unsigned int frame = 0; frame < frameCount; frame++) { - for (int channel = 0; channel < num_channels; channel++) + for (unsigned int channel = 0; channel < num_channels; channel++) { input_node->out[channel][frame] = input_samples[frame * num_channels + channel]; } @@ -76,6 +76,8 @@ int AudioIn_MiniAudio::init() << std::endl; this->start(); + + return 0; } int AudioIn_MiniAudio::start() @@ -85,6 +87,8 @@ int AudioIn_MiniAudio::start() { throw std::runtime_error("miniaudio: Error starting device"); } + + return 0; } int AudioIn_MiniAudio::stop() @@ -94,6 +98,8 @@ int AudioIn_MiniAudio::stop() { throw std::runtime_error("miniaudio: Error stopping device"); } + + return 0; } int AudioIn_MiniAudio::destroy() diff --git a/source/src/node/io/output/miniaudio.cpp b/source/src/node/io/output/miniaudio.cpp index 24da2bc0..0a121471 100644 --- a/source/src/node/io/output/miniaudio.cpp +++ b/source/src/node/io/output/miniaudio.cpp @@ -51,9 +51,9 @@ void data_callback(ma_device *pDevice, } NodeRef output = shared_graph->get_output(); - for (int frame = 0; frame < frame_count; frame++) + for (unsigned int frame = 0; frame < frame_count; frame++) { - for (int channel = 0; channel < channel_count; channel += 1) + for (unsigned int channel = 0; channel < channel_count; channel += 1) { output_pointer[channel_count * frame + channel] = output->out[channel][frame]; } @@ -138,7 +138,7 @@ int AudioOut_MiniAudio::init() int selected_device_index = -1; if (!this->device_name.empty()) { - for (int i = 0; i < playback_device_count; i++) + for (unsigned int i = 0; i < playback_device_count; i++) { if (strncmp(playback_devices[i].name, device_name.c_str(), strlen(device_name.c_str())) == 0) { @@ -239,7 +239,7 @@ std::list AudioOut_MiniAudio::get_output_device_names() { throw std::runtime_error("miniaudio: Failure querying audio devices"); } - for (int i = 0; i < playback_device_count; i++) + for (unsigned int i = 0; i < playback_device_count; i++) { device_names.push_back(std::string(playback_devices[i].name)); } @@ -265,7 +265,7 @@ std::list AudioOut_MiniAudio::get_output_backend_names() { throw std::runtime_error("miniaudio: Failure querying backend devices"); } - for (int i = 0; i < enabled_backend_count; i++) + for (unsigned int i = 0; i < enabled_backend_count; i++) { std::string backend_name = std::string(ma_get_backend_name(enabled_backends[i])); if (backend_name != "Custom" && backend_name != "Null")