Browse Source

Fix build on old or 32bit systems

tags/v2.1-alpha1-winvst
falkTX 7 years ago
parent
commit
1c91d9237e
3 changed files with 11 additions and 3 deletions
  1. +1
    -1
      source/modules/water/buffers/AudioSampleBuffer.h
  2. +2
    -2
      source/modules/water/containers/OwnedArray.h
  3. +8
    -0
      source/modules/water/memory/Atomic.h

+ 1
- 1
source/modules/water/buffers/AudioSampleBuffer.h View File

@@ -700,7 +700,7 @@ public:
const float* source, const float* source,
const uint32_t totalNumSamples) noexcept const uint32_t totalNumSamples) noexcept
{ {
CARLA_SAFE_ASSERT_RETURN(isPositiveAndBelow(destChannel, numChannels),);
CARLA_SAFE_ASSERT_RETURN(destChannel < numChannels,);
CARLA_SAFE_ASSERT_RETURN(source != nullptr,); CARLA_SAFE_ASSERT_RETURN(source != nullptr,);
if (const uint32_t numSamples = totalNumSamples / numChannels) if (const uint32_t numSamples = totalNumSamples / numChannels)


+ 2
- 2
source/modules/water/containers/OwnedArray.h View File

@@ -642,8 +642,8 @@ public:
*/ */
void removeRange (size_t startIndex, const size_t numberToRemove, bool deleteObjects = true) void removeRange (size_t startIndex, const size_t numberToRemove, bool deleteObjects = true)
{ {
const size_t endIndex = jlimit (0UL, numUsed, startIndex + numberToRemove);
startIndex = jlimit (0UL, numUsed, startIndex);
const size_t endIndex = jlimit ((size_t)0U, numUsed, startIndex + numberToRemove);
startIndex = jlimit ((size_t)0U, numUsed, startIndex);
if (endIndex > startIndex) if (endIndex > startIndex)
{ {


+ 8
- 0
source/modules/water/memory/Atomic.h View File

@@ -199,28 +199,36 @@ private:
template<> template<>
inline int32 Atomic<int32>::get() const noexcept inline int32 Atomic<int32>::get() const noexcept
{ {
#ifdef CARLA_PROPER_CPP11_SUPPORT
static_jassert (sizeof (int32) == 4); static_jassert (sizeof (int32) == 4);
#endif
return castFrom32Bit ((int32) __sync_add_and_fetch (const_cast<volatile int32*>(&value), 0)); return castFrom32Bit ((int32) __sync_add_and_fetch (const_cast<volatile int32*>(&value), 0));
} }
template<> template<>
inline int64 Atomic<int64>::get() const noexcept inline int64 Atomic<int64>::get() const noexcept
{ {
#ifdef CARLA_PROPER_CPP11_SUPPORT
static_jassert (sizeof (int64) == 8); static_jassert (sizeof (int64) == 8);
#endif
return castFrom64Bit ((int64) __sync_add_and_fetch (const_cast<volatile int64*>(&value), 0)); return castFrom64Bit ((int64) __sync_add_and_fetch (const_cast<volatile int64*>(&value), 0));
} }
template<> template<>
inline uint32 Atomic<uint32>::get() const noexcept inline uint32 Atomic<uint32>::get() const noexcept
{ {
#ifdef CARLA_PROPER_CPP11_SUPPORT
static_jassert (sizeof (uint32) == 4); static_jassert (sizeof (uint32) == 4);
#endif
return castFrom32Bit ((uint32) __sync_add_and_fetch (const_cast<volatile uint32*>(&value), 0)); return castFrom32Bit ((uint32) __sync_add_and_fetch (const_cast<volatile uint32*>(&value), 0));
} }
template<> template<>
inline uint64 Atomic<uint64>::get() const noexcept inline uint64 Atomic<uint64>::get() const noexcept
{ {
#ifdef CARLA_PROPER_CPP11_SUPPORT
static_jassert (sizeof (uint64) == 8); static_jassert (sizeof (uint64) == 8);
#endif
return castFrom64Bit ((uint64) __sync_add_and_fetch (const_cast<volatile uint64*>(&value), 0)); return castFrom64Bit ((uint64) __sync_add_and_fetch (const_cast<volatile uint64*>(&value), 0));
} }


Loading…
Cancel
Save