upgrade to JUCE 5.4.3. Remove (probably) unused JUCE modules. Remove VST2 target (it's been end-of-life'd by Steinberg and by JUCE)
This commit is contained in:
@ -295,6 +295,7 @@ public:
|
||||
|
||||
int numSigFigs = 0;
|
||||
bool decimalPointFound = false;
|
||||
int extraExponent = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@ -302,9 +303,22 @@ public:
|
||||
{
|
||||
auto digit = (int) text.getAndAdvance() - '0';
|
||||
|
||||
if (numSigFigs >= maxSignificantDigits
|
||||
|| ((numSigFigs == 0 && (! decimalPointFound)) && digit == 0))
|
||||
continue;
|
||||
if (decimalPointFound)
|
||||
{
|
||||
if (numSigFigs >= maxSignificantDigits)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (numSigFigs >= maxSignificantDigits)
|
||||
{
|
||||
++extraExponent;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (numSigFigs == 0 && digit == 0)
|
||||
continue;
|
||||
}
|
||||
|
||||
*currentCharacter++ = (char) ('0' + (char) digit);
|
||||
numSigFigs++;
|
||||
@ -323,37 +337,58 @@ public:
|
||||
|
||||
c = *text;
|
||||
|
||||
auto writeExponentDigits = [](int exponent, char* destination)
|
||||
{
|
||||
auto exponentDivisor = 100;
|
||||
|
||||
while (exponentDivisor > 1)
|
||||
{
|
||||
auto digit = exponent / exponentDivisor;
|
||||
*destination++ = (char) ('0' + (char) digit);
|
||||
exponent -= digit * exponentDivisor;
|
||||
exponentDivisor /= 10;
|
||||
}
|
||||
|
||||
*destination++ = (char) ('0' + (char) exponent);
|
||||
};
|
||||
|
||||
if ((c == 'e' || c == 'E') && numSigFigs > 0)
|
||||
{
|
||||
*currentCharacter++ = 'e';
|
||||
bool parsedExponentIsPositive = true;
|
||||
|
||||
switch (*++text)
|
||||
{
|
||||
case '-': *currentCharacter++ = '-'; // Fall-through..
|
||||
case '-': parsedExponentIsPositive = false; // Fall-through..
|
||||
case '+': ++text;
|
||||
}
|
||||
|
||||
int exponentMagnitude = 0;
|
||||
int exponent = 0;
|
||||
|
||||
while (text.isDigit())
|
||||
{
|
||||
if (currentCharacter == &buffer[bufferSize - 1])
|
||||
return std::numeric_limits<double>::quiet_NaN();
|
||||
|
||||
auto digit = (int) text.getAndAdvance() - '0';
|
||||
|
||||
if (digit != 0 || exponentMagnitude != 0)
|
||||
{
|
||||
*currentCharacter++ = (char) ('0' + (char) digit);
|
||||
exponentMagnitude = (exponentMagnitude * 10) + digit;
|
||||
}
|
||||
if (digit != 0 || exponent != 0)
|
||||
exponent = (exponent * 10) + digit;
|
||||
}
|
||||
|
||||
if (exponentMagnitude > std::numeric_limits<double>::max_exponent10)
|
||||
exponent = extraExponent + (parsedExponentIsPositive ? exponent : -exponent);
|
||||
|
||||
if (exponent < 0)
|
||||
*currentCharacter++ = '-';
|
||||
|
||||
exponent = std::abs (exponent);
|
||||
|
||||
if (exponent > std::numeric_limits<double>::max_exponent10)
|
||||
return std::numeric_limits<double>::quiet_NaN();
|
||||
|
||||
if (exponentMagnitude == 0)
|
||||
*currentCharacter++ = '0';
|
||||
writeExponentDigits (exponent, currentCharacter);
|
||||
}
|
||||
else if (extraExponent > 0)
|
||||
{
|
||||
*currentCharacter++ = 'e';
|
||||
writeExponentDigits (extraExponent, currentCharacter);
|
||||
}
|
||||
|
||||
#if JUCE_WINDOWS
|
||||
|
Reference in New Issue
Block a user