From 195495a989ec8fffd2bc95a2c04cd8e554fbfe4b Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 30 Jul 2012 10:34:35 +0100 Subject: [PATCH] Removed the default parameters from BigInteger::findNextSetBit and findNextClearBit. --- .../sources/juce_ChannelRemappingAudioSource.cpp | 16 ++++++---------- .../gui/juce_AudioDeviceSelectorComponent.cpp | 2 +- modules/juce_core/maths/juce_BigInteger.h | 9 ++------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.cpp b/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.cpp index 0019a8aae8..67ffc019b2 100644 --- a/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.cpp +++ b/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.cpp @@ -109,8 +109,7 @@ void ChannelRemappingAudioSource::getNextAudioBlock (const AudioSourceChannelInf const int numChans = bufferToFill.buffer->getNumChannels(); - int i; - for (i = 0; i < buffer.getNumChannels(); ++i) + for (int i = 0; i < buffer.getNumChannels(); ++i) { const int remappedChan = getRemappedInputChannel (i); @@ -133,7 +132,7 @@ void ChannelRemappingAudioSource::getNextAudioBlock (const AudioSourceChannelInf bufferToFill.clearActiveBufferRegion(); - for (i = 0; i < requiredNumberOfChannels; ++i) + for (int i = 0; i < requiredNumberOfChannels; ++i) { const int remappedChan = getRemappedOutputChannel (i); @@ -150,16 +149,14 @@ void ChannelRemappingAudioSource::getNextAudioBlock (const AudioSourceChannelInf XmlElement* ChannelRemappingAudioSource::createXml() const { XmlElement* e = new XmlElement ("MAPPINGS"); - String ins, outs; - int i; const ScopedLock sl (lock); - for (i = 0; i < remappedInputs.size(); ++i) + for (int i = 0; i < remappedInputs.size(); ++i) ins << remappedInputs.getUnchecked(i) << ' '; - for (i = 0; i < remappedOutputs.size(); ++i) + for (int i = 0; i < remappedOutputs.size(); ++i) outs << remappedOutputs.getUnchecked(i) << ' '; e->setAttribute ("inputs", ins.trimEnd()); @@ -180,11 +177,10 @@ void ChannelRemappingAudioSource::restoreFromXml (const XmlElement& e) ins.addTokens (e.getStringAttribute ("inputs"), false); outs.addTokens (e.getStringAttribute ("outputs"), false); - int i; - for (i = 0; i < ins.size(); ++i) + for (int i = 0; i < ins.size(); ++i) remappedInputs.add (ins[i].getIntValue()); - for (i = 0; i < outs.size(); ++i) + for (int i = 0; i < outs.size(); ++i) remappedOutputs.add (outs[i].getIntValue()); } } diff --git a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp index acb260ca79..88265c45d0 100644 --- a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp +++ b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp @@ -896,7 +896,7 @@ public: { if (numActive >= maxNumber) { - const int firstActiveChan = chans.findNextSetBit(); + const int firstActiveChan = chans.findNextSetBit (0); chans.setBit (index > firstActiveChan ? firstActiveChan : chans.getHighestBit(), diff --git a/modules/juce_core/maths/juce_BigInteger.h b/modules/juce_core/maths/juce_BigInteger.h index e22ebc7665..d40bb5e304 100644 --- a/modules/juce_core/maths/juce_BigInteger.h +++ b/modules/juce_core/maths/juce_BigInteger.h @@ -49,20 +49,17 @@ public: BigInteger(); /** Creates a BigInteger containing an integer value in its low bits. - The low 32 bits of the number are initialised with this value. */ BigInteger (uint32 value); /** Creates a BigInteger containing an integer value in its low bits. - The low 32 bits of the number are initialised with the absolute value passed in, and its sign is set to reflect the sign of the number. */ BigInteger (int32 value); /** Creates a BigInteger containing an integer value in its low bits. - The low 64 bits of the number are initialised with the absolute value passed in, and its sign is set to reflect the sign of the number. */ @@ -165,14 +162,14 @@ public: This searches from startIndex (inclusive) upwards for the first set bit, and returns its index. If no set bits are found, it returns -1. */ - int findNextSetBit (int startIndex = 0) const noexcept; + int findNextSetBit (int startIndex) const noexcept; /** Looks for the index of the next clear bit after a given starting point. This searches from startIndex (inclusive) upwards for the first clear bit, and returns its index. */ - int findNextClearBit (int startIndex = 0) const noexcept; + int findNextClearBit (int startIndex) const noexcept; /** Returns the index of the highest set bit in the number. If the value is zero, this will return -1. @@ -247,13 +244,11 @@ public: BigInteger findGreatestCommonDivisor (BigInteger other) const; /** Performs a combined exponent and modulo operation. - This BigInteger's value becomes (this ^ exponent) % modulus. */ void exponentModulo (const BigInteger& exponent, const BigInteger& modulus); /** Performs an inverse modulo on the value. - i.e. the result is (this ^ -1) mod (modulus). */ void inverseModulo (const BigInteger& modulus);