Browse Source

Fix some compiler warnings

tags/v2.3.0-RC1
falkTX 3 years ago
parent
commit
6486fbc8d4
2 changed files with 10 additions and 1 deletions
  1. +7
    -0
      source/utils/CarlaRingBuffer.hpp
  2. +3
    -1
      source/utils/CarlaScopeUtils.hpp

+ 7
- 0
source/utils/CarlaRingBuffer.hpp View File

@@ -320,7 +320,14 @@ protected:
bool tryRead(void* const buf, const uint32_t size) noexcept bool tryRead(void* const buf, const uint32_t size) noexcept
{ {
CARLA_SAFE_ASSERT_RETURN(fBuffer != nullptr, false); CARLA_SAFE_ASSERT_RETURN(fBuffer != nullptr, false);
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wtautological-pointer-compare"
#endif
CARLA_SAFE_ASSERT_RETURN(fBuffer->buf != nullptr, false); CARLA_SAFE_ASSERT_RETURN(fBuffer->buf != nullptr, false);
#if defined(__clang__)
# pragma clang diagnostic pop
#endif
CARLA_SAFE_ASSERT_RETURN(buf != nullptr, false); CARLA_SAFE_ASSERT_RETURN(buf != nullptr, false);
CARLA_SAFE_ASSERT_RETURN(size > 0, false); CARLA_SAFE_ASSERT_RETURN(size > 0, false);
CARLA_SAFE_ASSERT_RETURN(size < fBuffer->size, false); CARLA_SAFE_ASSERT_RETURN(size < fBuffer->size, false);


+ 3
- 1
source/utils/CarlaScopeUtils.hpp View File

@@ -110,7 +110,7 @@ public:
# ifdef CARLA_USE_CONFIGTHREADLOCALE # ifdef CARLA_USE_CONFIGTHREADLOCALE
: oldthreadloc(_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)), : oldthreadloc(_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)),
# else # else
: oldthreadloc(-1),
:
# endif # endif
oldloc(carla_strdup_safe(::setlocale(LC_NUMERIC, nullptr))) oldloc(carla_strdup_safe(::setlocale(LC_NUMERIC, nullptr)))
{ {
@@ -143,7 +143,9 @@ private:
#ifdef CARLA_USE_NEWLOCALE #ifdef CARLA_USE_NEWLOCALE
locale_t newloc, oldloc; locale_t newloc, oldloc;
#else #else
# ifdef CARLA_USE_CONFIGTHREADLOCALE
const int oldthreadloc; const int oldthreadloc;
# endif
const char* const oldloc; const char* const oldloc;
#endif #endif




Loading…
Cancel
Save