Browse Source

Removed the default parameters from BigInteger::findNextSetBit and findNextClearBit.

tags/2021-05-28
jules 13 years ago
parent
commit
195495a989
3 changed files with 9 additions and 18 deletions
  1. +6
    -10
      modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.cpp
  2. +1
    -1
      modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp
  3. +2
    -7
      modules/juce_core/maths/juce_BigInteger.h

+ 6
- 10
modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.cpp View File

@@ -109,8 +109,7 @@ void ChannelRemappingAudioSource::getNextAudioBlock (const AudioSourceChannelInf
const int numChans = bufferToFill.buffer->getNumChannels(); 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); const int remappedChan = getRemappedInputChannel (i);
@@ -133,7 +132,7 @@ void ChannelRemappingAudioSource::getNextAudioBlock (const AudioSourceChannelInf
bufferToFill.clearActiveBufferRegion(); bufferToFill.clearActiveBufferRegion();
for (i = 0; i < requiredNumberOfChannels; ++i)
for (int i = 0; i < requiredNumberOfChannels; ++i)
{ {
const int remappedChan = getRemappedOutputChannel (i); const int remappedChan = getRemappedOutputChannel (i);
@@ -150,16 +149,14 @@ void ChannelRemappingAudioSource::getNextAudioBlock (const AudioSourceChannelInf
XmlElement* ChannelRemappingAudioSource::createXml() const XmlElement* ChannelRemappingAudioSource::createXml() const
{ {
XmlElement* e = new XmlElement ("MAPPINGS"); XmlElement* e = new XmlElement ("MAPPINGS");
String ins, outs; String ins, outs;
int i;
const ScopedLock sl (lock); const ScopedLock sl (lock);
for (i = 0; i < remappedInputs.size(); ++i)
for (int i = 0; i < remappedInputs.size(); ++i)
ins << remappedInputs.getUnchecked(i) << ' '; ins << remappedInputs.getUnchecked(i) << ' ';
for (i = 0; i < remappedOutputs.size(); ++i)
for (int i = 0; i < remappedOutputs.size(); ++i)
outs << remappedOutputs.getUnchecked(i) << ' '; outs << remappedOutputs.getUnchecked(i) << ' ';
e->setAttribute ("inputs", ins.trimEnd()); e->setAttribute ("inputs", ins.trimEnd());
@@ -180,11 +177,10 @@ void ChannelRemappingAudioSource::restoreFromXml (const XmlElement& e)
ins.addTokens (e.getStringAttribute ("inputs"), false); ins.addTokens (e.getStringAttribute ("inputs"), false);
outs.addTokens (e.getStringAttribute ("outputs"), 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()); 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()); remappedOutputs.add (outs[i].getIntValue());
} }
} }

+ 1
- 1
modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp View File

@@ -896,7 +896,7 @@ public:
{ {
if (numActive >= maxNumber) if (numActive >= maxNumber)
{ {
const int firstActiveChan = chans.findNextSetBit();
const int firstActiveChan = chans.findNextSetBit (0);
chans.setBit (index > firstActiveChan chans.setBit (index > firstActiveChan
? firstActiveChan : chans.getHighestBit(), ? firstActiveChan : chans.getHighestBit(),


+ 2
- 7
modules/juce_core/maths/juce_BigInteger.h View File

@@ -49,20 +49,17 @@ public:
BigInteger(); BigInteger();
/** Creates a BigInteger containing an integer value in its low bits. /** Creates a BigInteger containing an integer value in its low bits.
The low 32 bits of the number are initialised with this value. The low 32 bits of the number are initialised with this value.
*/ */
BigInteger (uint32 value); BigInteger (uint32 value);
/** Creates a BigInteger containing an integer value in its low bits. /** Creates a BigInteger containing an integer value in its low bits.
The low 32 bits of the number are initialised with the absolute value 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. passed in, and its sign is set to reflect the sign of the number.
*/ */
BigInteger (int32 value); BigInteger (int32 value);
/** Creates a BigInteger containing an integer value in its low bits. /** Creates a BigInteger containing an integer value in its low bits.
The low 64 bits of the number are initialised with the absolute value 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. 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, This searches from startIndex (inclusive) upwards for the first set bit,
and returns its index. If no set bits are found, it returns -1. 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. /** 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, This searches from startIndex (inclusive) upwards for the first clear bit,
and returns its index. 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. /** Returns the index of the highest set bit in the number.
If the value is zero, this will return -1. If the value is zero, this will return -1.
@@ -247,13 +244,11 @@ public:
BigInteger findGreatestCommonDivisor (BigInteger other) const; BigInteger findGreatestCommonDivisor (BigInteger other) const;
/** Performs a combined exponent and modulo operation. /** Performs a combined exponent and modulo operation.
This BigInteger's value becomes (this ^ exponent) % modulus. This BigInteger's value becomes (this ^ exponent) % modulus.
*/ */
void exponentModulo (const BigInteger& exponent, const BigInteger& modulus); void exponentModulo (const BigInteger& exponent, const BigInteger& modulus);
/** Performs an inverse modulo on the value. /** Performs an inverse modulo on the value.
i.e. the result is (this ^ -1) mod (modulus). i.e. the result is (this ^ -1) mod (modulus).
*/ */
void inverseModulo (const BigInteger& modulus); void inverseModulo (const BigInteger& modulus);


Loading…
Cancel
Save