mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Clang: Fix build errors when using a recent clang-cl
This commit is contained in:
parent
ab6c407b9f
commit
ac2d7ee272
7 changed files with 15 additions and 7 deletions
|
|
@ -248,10 +248,10 @@ namespace build_tools
|
||||||
auto r = writeHeader (mo);
|
auto r = writeHeader (mo);
|
||||||
|
|
||||||
if (r.failed())
|
if (r.failed())
|
||||||
return { r };
|
return { r, {} };
|
||||||
|
|
||||||
if (! overwriteFileWithNewDataIfDifferent (headerFile, mo))
|
if (! overwriteFileWithNewDataIfDifferent (headerFile, mo))
|
||||||
return { Result::fail ("Can't write to file: " + headerFile.getFullPathName()) };
|
return { Result::fail ("Can't write to file: " + headerFile.getFullPathName()), {} };
|
||||||
|
|
||||||
filesCreated.add (headerFile);
|
filesCreated.add (headerFile);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,8 @@ namespace OggVorbisNamespace
|
||||||
"-Wzero-as-null-pointer-constant",
|
"-Wzero-as-null-pointer-constant",
|
||||||
"-Wsign-conversion",
|
"-Wsign-conversion",
|
||||||
"-Wswitch-default",
|
"-Wswitch-default",
|
||||||
"-Wredundant-decls")
|
"-Wredundant-decls",
|
||||||
|
"-Wmisleading-indentation")
|
||||||
|
|
||||||
#include "oggvorbis/vorbisenc.h"
|
#include "oggvorbis/vorbisenc.h"
|
||||||
#include "oggvorbis/codec.h"
|
#include "oggvorbis/codec.h"
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,11 @@ AudioFormatReader::~AudioFormatReader()
|
||||||
|
|
||||||
static void convertFixedToFloat (int* const* channels, int numChannels, int numSamples)
|
static void convertFixedToFloat (int* const* channels, int numChannels, int numSamples)
|
||||||
{
|
{
|
||||||
|
constexpr auto scaleFactor = 1.0f / static_cast<float> (0x7fffffff);
|
||||||
|
|
||||||
for (int i = 0; i < numChannels; ++i)
|
for (int i = 0; i < numChannels; ++i)
|
||||||
if (auto d = channels[i])
|
if (auto d = channels[i])
|
||||||
FloatVectorOperations::convertFixedToFloat (reinterpret_cast<float*> (d), d, 1.0f / 0x7fffffff, numSamples);
|
FloatVectorOperations::convertFixedToFloat (reinterpret_cast<float*> (d), d, scaleFactor, numSamples);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AudioFormatReader::read (float* const* destChannels, int numDestChannels,
|
bool AudioFormatReader::read (float* const* destChannels, int numDestChannels,
|
||||||
|
|
|
||||||
|
|
@ -108,8 +108,10 @@ bool AudioFormatWriter::writeFromAudioReader (AudioFormatReader& reader,
|
||||||
{
|
{
|
||||||
void* const b = *bufferChan++;
|
void* const b = *bufferChan++;
|
||||||
|
|
||||||
|
constexpr auto scaleFactor = 1.0f / static_cast<float> (0x7fffffff);
|
||||||
|
|
||||||
if (isFloatingPoint())
|
if (isFloatingPoint())
|
||||||
FloatVectorOperations::convertFixedToFloat ((float*) b, (int*) b, 1.0f / 0x7fffffff, numToDo);
|
FloatVectorOperations::convertFixedToFloat ((float*) b, (int*) b, scaleFactor, numToDo);
|
||||||
else
|
else
|
||||||
convertFloatsToInts ((int*) b, (float*) b, numToDo);
|
convertFloatsToInts ((int*) b, (float*) b, numToDo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor",
|
||||||
"-Wignored-qualifiers",
|
"-Wignored-qualifiers",
|
||||||
"-Wmissing-field-initializers",
|
"-Wmissing-field-initializers",
|
||||||
"-Wformat=",
|
"-Wformat=",
|
||||||
|
"-Wformat",
|
||||||
"-Wpedantic",
|
"-Wpedantic",
|
||||||
"-Wextra",
|
"-Wextra",
|
||||||
"-Wclass-memaccess")
|
"-Wclass-memaccess")
|
||||||
|
|
|
||||||
|
|
@ -521,7 +521,8 @@ template <typename FloatType>
|
||||||
unsigned int truncatePositiveToUnsignedInt (FloatType value) noexcept
|
unsigned int truncatePositiveToUnsignedInt (FloatType value) noexcept
|
||||||
{
|
{
|
||||||
jassert (value >= static_cast<FloatType> (0));
|
jassert (value >= static_cast<FloatType> (0));
|
||||||
jassert (static_cast<FloatType> (value) <= std::numeric_limits<unsigned int>::max());
|
jassert (static_cast<FloatType> (value)
|
||||||
|
<= static_cast<FloatType> (std::numeric_limits<unsigned int>::max()));
|
||||||
|
|
||||||
return static_cast<unsigned int> (value);
|
return static_cast<unsigned int> (value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,8 @@ bool Random::nextBool() noexcept
|
||||||
|
|
||||||
float Random::nextFloat() noexcept
|
float Random::nextFloat() noexcept
|
||||||
{
|
{
|
||||||
auto result = static_cast<uint32> (nextInt()) / (std::numeric_limits<uint32>::max() + 1.0f);
|
auto result = static_cast<uint32> (nextInt())
|
||||||
|
/ (static_cast<float> (std::numeric_limits<uint32>::max()) + 1.0f);
|
||||||
return result == 1.0f ? 1.0f - std::numeric_limits<float>::epsilon() : result;
|
return result == 1.0f ? 1.0f - std::numeric_limits<float>::epsilon() : result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue