diff --git a/source/backend/CarlaStandalone.cpp b/source/backend/CarlaStandalone.cpp index ae0526a3a..fce38a445 100644 --- a/source/backend/CarlaStandalone.cpp +++ b/source/backend/CarlaStandalone.cpp @@ -169,9 +169,9 @@ const EngineDriverDeviceInfo* carla_get_engine_driver_device_info(uint index, co if (const EngineDriverDeviceInfo* const devInfo = CarlaEngine::getDriverDeviceInfo(index, name)) { - retDevInfo.hints = devInfo->hints; - retDevInfo.bufferSizes = (devInfo->bufferSizes != nullptr) ? devInfo->bufferSizes : nullBufferSizes; - retDevInfo.sampleRates = (devInfo->sampleRates != nullptr) ? devInfo->sampleRates : nullSampleRates; + retDevInfo.hints = devInfo->hints; + retDevInfo.bufferSizes = devInfo->bufferSizes != nullptr ? devInfo->bufferSizes : nullBufferSizes; + retDevInfo.sampleRates = devInfo->sampleRates != nullptr ? devInfo->sampleRates : nullSampleRates; } else { diff --git a/source/backend/engine/CarlaEngine.cpp b/source/backend/engine/CarlaEngine.cpp index 1f1ede93f..da16852dd 100644 --- a/source/backend/engine/CarlaEngine.cpp +++ b/source/backend/engine/CarlaEngine.cpp @@ -224,8 +224,8 @@ const EngineDriverDeviceInfo* CarlaEngine::getDriverDeviceInfo(const uint index, devInfo.sampleRates = nullptr; return &devInfo; } + --index2; } - --index2; #endif #ifdef USING_JUCE_AUDIO_DEVICES @@ -260,7 +260,7 @@ const EngineDriverDeviceInfo* CarlaEngine::getDriverDeviceInfo(const uint index, --index2; #endif - carla_stderr("CarlaEngine::getDriverDeviceInfo(%u, \"%s\") - invalid index %u", index, index2, deviceName); + carla_stderr("CarlaEngine::getDriverDeviceInfo(%u, \"%s\") - invalid index %u", index, deviceName, index2); return nullptr; } @@ -304,7 +304,7 @@ bool CarlaEngine::showDriverDeviceControlPanel(const uint index, const char* con --index2; #endif - carla_stderr("CarlaEngine::showDriverDeviceControlPanel(%u, \"%s\") - invalid index %u", index, index2, deviceName); + carla_stderr("CarlaEngine::showDriverDeviceControlPanel(%u, \"%s\") - invalid index %u", index, deviceName, index2); return false; } diff --git a/source/backend/engine/CarlaEngineJuce.cpp b/source/backend/engine/CarlaEngineJuce.cpp index e51674bc3..1e71cb469 100644 --- a/source/backend/engine/CarlaEngineJuce.cpp +++ b/source/backend/engine/CarlaEngineJuce.cpp @@ -1007,8 +1007,7 @@ const char* getJuceApiName(const uint uindex) { initJuceDevicesIfNeeded(); - const int index(static_cast(uindex)); - + const int index = static_cast(uindex); CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), nullptr); juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]); @@ -1021,8 +1020,7 @@ const char* const* getJuceApiDeviceNames(const uint uindex) { initJuceDevicesIfNeeded(); - const int index(static_cast(uindex)); - + const int index = static_cast(uindex); CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), nullptr); juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]); @@ -1050,8 +1048,7 @@ const EngineDriverDeviceInfo* getJuceDeviceInfo(const uint uindex, const char* c { initJuceDevicesIfNeeded(); - const int index(static_cast(uindex)); - + const int index = static_cast(uindex); CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), nullptr); juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]); @@ -1088,7 +1085,7 @@ const EngineDriverDeviceInfo* getJuceDeviceInfo(const uint uindex, const char* c devInfo.hints |= ENGINE_DRIVER_DEVICE_HAS_CONTROL_PANEL; juce::Array juceBufferSizes = device->getAvailableBufferSizes(); - if (int bufferSizesCount = juceBufferSizes.size()) + if (const int bufferSizesCount = juceBufferSizes.size()) { uint32_t* const bufferSizes(new uint32_t[bufferSizesCount+1]); @@ -1104,7 +1101,7 @@ const EngineDriverDeviceInfo* getJuceDeviceInfo(const uint uindex, const char* c } juce::Array juceSampleRates = device->getAvailableSampleRates(); - if (int sampleRatesCount = juceSampleRates.size()) + if (const int sampleRatesCount = juceSampleRates.size()) { double* const sampleRates(new double[sampleRatesCount+1]); @@ -1124,8 +1121,7 @@ const EngineDriverDeviceInfo* getJuceDeviceInfo(const uint uindex, const char* c bool showJuceDeviceControlPanel(const uint uindex, const char* const deviceName) { - const int index(static_cast(uindex)); - + const int index = static_cast(uindex); CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), false); juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]);