Browse Source

Cleanup

tags/1.9.7
falkTX 10 years ago
parent
commit
169b0e46fc
3 changed files with 9 additions and 21 deletions
  1. +1
    -1
      source/backend/CarlaHostCommon.cpp
  2. +2
    -2
      source/utils/CarlaMathUtils.hpp
  3. +6
    -18
      source/utils/CarlaUtils.hpp

+ 1
- 1
source/backend/CarlaHostCommon.cpp View File

@@ -16,7 +16,7 @@
*/

#include "CarlaHost.h"
#include "CarlaUtils.hpp"
#include "CarlaString.hpp"

#include "juce_core.h"



+ 2
- 2
source/utils/CarlaMathUtils.hpp View File

@@ -85,13 +85,13 @@ T carla_maxNegative(const T& v1, const T& v2) noexcept
}

/*
* Fix bounds of 'value' between 'min' and 'max'.
* Return a value between 'min' and 'max'.
*/
template<typename T>
static inline
const T& carla_fixedValue(const T& min, const T& max, const T& value) noexcept
{
CARLA_SAFE_ASSERT_RETURN(max > min, max);
CARLA_SAFE_ASSERT_RETURN(max > min, min);

if (value <= min)
return min;


+ 6
- 18
source/utils/CarlaUtils.hpp View File

@@ -82,15 +82,9 @@ void carla_debug(const char* const fmt, ...) noexcept
try {
::va_list args;
::va_start(args, fmt);
#ifndef QTCREATOR_TEST
std::fprintf(stdout, "\x1b[30;1m");
#endif
std::vfprintf(stdout, fmt, args);
#ifndef QTCREATOR_TEST
std::fprintf(stdout, "\x1b[0m\n");
#else
std::fprintf(stdout, "\n");
#endif
::va_end(args);
} catch (...) {}
}
@@ -135,15 +129,9 @@ void carla_stderr2(const char* const fmt, ...) noexcept
try {
::va_list args;
::va_start(args, fmt);
#ifndef QTCREATOR_TEST
std::fprintf(stderr, "\x1b[31m");
#endif
std::vfprintf(stderr, fmt, args);
#ifndef QTCREATOR_TEST
std::fprintf(stderr, "\x1b[0m\n");
#else
std::fprintf(stderr, "\n");
#endif
::va_end(args);
} catch (...) {}
}
@@ -154,7 +142,7 @@ void carla_stderr2(const char* const fmt, ...) noexcept
/*
* Print a safe assertion error message.
*/
static inline
inline
void carla_safe_assert(const char* const assertion, const char* const file, const int line) noexcept
{
carla_stderr2("Carla assertion failure: \"%s\" in file %s, line %i", assertion, file, line);
@@ -163,13 +151,13 @@ void carla_safe_assert(const char* const assertion, const char* const file, cons
/*
* Print a safe assertion error message, with 1 extra integer value.
*/
static inline
inline
void carla_safe_assert_int(const char* const assertion, const char* const file, const int line,
const int value) noexcept
{
carla_stderr2("Carla assertion failure: \"%s\" in file %s, line %i, value %i", assertion, file, line, value);
}
static inline
inline
void carla_safe_assert_uint(const char* const assertion, const char* const file, const int line,
const uint value) noexcept
{
@@ -179,13 +167,13 @@ void carla_safe_assert_uint(const char* const assertion, const char* const file,
/*
* Print a safe assertion error message, with 2 extra integer values.
*/
static inline
inline
void carla_safe_assert_int2(const char* const assertion, const char* const file, const int line,
const int v1, const int v2) noexcept
{
carla_stderr2("Carla assertion failure: \"%s\" in file %s, line %i, v1 %i, v2 %i", assertion, file, line, v1, v2);
}
static inline
inline
void carla_safe_assert_uint2(const char* const assertion, const char* const file, const int line,
const uint v1, const uint v2) noexcept
{
@@ -198,7 +186,7 @@ void carla_safe_assert_uint2(const char* const assertion, const char* const file
/*
* Print a safe exception error message.
*/
static inline
inline
void carla_safe_exception(const char* const exception, const char* const file, const int line) noexcept
{
carla_stderr2("Carla exception caught: \"%s\" in file %s, line %i", exception, file, line);


Loading…
Cancel
Save