clang-format step
This commit is contained in:
parent
7c07df4f66
commit
e274084d2f
4 changed files with 30 additions and 32 deletions
|
|
@ -111,7 +111,6 @@ sfz::EQHolderPtr sfz::EQPool::getEQ(const EQDescription& description, unsigned n
|
||||||
if (!lock.owns_lock())
|
if (!lock.owns_lock())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
|
|
||||||
auto eq = absl::c_find_if(eqs, [](const EQHolderPtr& holder) {
|
auto eq = absl::c_find_if(eqs, [](const EQHolderPtr& holder) {
|
||||||
return holder.use_count() == 1;
|
return holder.use_count() == 1;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ RTSemaphore::RTSemaphore(unsigned value)
|
||||||
good_ = true;
|
good_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
RTSemaphore::RTSemaphore(std::error_code &ec, unsigned value) noexcept
|
RTSemaphore::RTSemaphore(std::error_code& ec, unsigned value) noexcept
|
||||||
{
|
{
|
||||||
init(ec, value);
|
init(ec, value);
|
||||||
good_ = ec ? false : true;
|
good_ = ec ? false : true;
|
||||||
|
|
@ -58,7 +58,7 @@ bool RTSemaphore::try_wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
void RTSemaphore::init(std::error_code &ec, unsigned value)
|
void RTSemaphore::init(std::error_code& ec, unsigned value)
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
kern_return_t ret = semaphore_create(mach_task_self(), &sem_, SYNC_POLICY_FIFO, value);
|
kern_return_t ret = semaphore_create(mach_task_self(), &sem_, SYNC_POLICY_FIFO, value);
|
||||||
|
|
@ -66,7 +66,7 @@ void RTSemaphore::init(std::error_code &ec, unsigned value)
|
||||||
ec = std::error_code(ret, mach_category());
|
ec = std::error_code(ret, mach_category());
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTSemaphore::destroy(std::error_code &ec)
|
void RTSemaphore::destroy(std::error_code& ec)
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
kern_return_t ret = semaphore_destroy(mach_task_self(), sem_);
|
kern_return_t ret = semaphore_destroy(mach_task_self(), sem_);
|
||||||
|
|
@ -74,7 +74,7 @@ void RTSemaphore::destroy(std::error_code &ec)
|
||||||
ec = std::error_code(ret, mach_category());
|
ec = std::error_code(ret, mach_category());
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTSemaphore::post(std::error_code &ec) noexcept
|
void RTSemaphore::post(std::error_code& ec) noexcept
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
kern_return_t ret = semaphore_signal(sem_);
|
kern_return_t ret = semaphore_signal(sem_);
|
||||||
|
|
@ -82,7 +82,7 @@ void RTSemaphore::post(std::error_code &ec) noexcept
|
||||||
ec = std::error_code(ret, mach_category());
|
ec = std::error_code(ret, mach_category());
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTSemaphore::wait(std::error_code &ec) noexcept
|
void RTSemaphore::wait(std::error_code& ec) noexcept
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
do {
|
do {
|
||||||
|
|
@ -99,11 +99,11 @@ void RTSemaphore::wait(std::error_code &ec) noexcept
|
||||||
} while (1);
|
} while (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RTSemaphore::try_wait(std::error_code &ec) noexcept
|
bool RTSemaphore::try_wait(std::error_code& ec) noexcept
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
do {
|
do {
|
||||||
const mach_timespec_t timeout = {0, 0};
|
const mach_timespec_t timeout = { 0, 0 };
|
||||||
kern_return_t ret = semaphore_timedwait(sem_, timeout);
|
kern_return_t ret = semaphore_timedwait(sem_, timeout);
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case KERN_SUCCESS:
|
case KERN_SUCCESS:
|
||||||
|
|
@ -119,18 +119,18 @@ bool RTSemaphore::try_wait(std::error_code &ec) noexcept
|
||||||
} while (1);
|
} while (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::error_category &RTSemaphore::mach_category()
|
const std::error_category& RTSemaphore::mach_category()
|
||||||
{
|
{
|
||||||
class mach_category : public std::error_category {
|
class mach_category : public std::error_category {
|
||||||
public:
|
public:
|
||||||
const char *name() const noexcept override
|
const char* name() const noexcept override
|
||||||
{
|
{
|
||||||
return "kern_return_t";
|
return "kern_return_t";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string message(int condition) const override
|
std::string message(int condition) const override
|
||||||
{
|
{
|
||||||
const char *str = mach_error_string(condition);
|
const char* str = mach_error_string(condition);
|
||||||
return str ? str : "";
|
return str ? str : "";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -139,7 +139,7 @@ const std::error_category &RTSemaphore::mach_category()
|
||||||
return cat;
|
return cat;
|
||||||
}
|
}
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
void RTSemaphore::init(std::error_code &ec, unsigned value)
|
void RTSemaphore::init(std::error_code& ec, unsigned value)
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
sem_ = CreateSemaphore(nullptr, value, LONG_MAX, nullptr);
|
sem_ = CreateSemaphore(nullptr, value, LONG_MAX, nullptr);
|
||||||
|
|
@ -147,21 +147,21 @@ void RTSemaphore::init(std::error_code &ec, unsigned value)
|
||||||
ec = std::error_code(GetLastError(), std::system_category());
|
ec = std::error_code(GetLastError(), std::system_category());
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTSemaphore::destroy(std::error_code &ec)
|
void RTSemaphore::destroy(std::error_code& ec)
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
if (CloseHandle(sem_) == 0)
|
if (CloseHandle(sem_) == 0)
|
||||||
ec = std::error_code(GetLastError(), std::system_category());
|
ec = std::error_code(GetLastError(), std::system_category());
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTSemaphore::post(std::error_code &ec) noexcept
|
void RTSemaphore::post(std::error_code& ec) noexcept
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
if (ReleaseSemaphore(sem_, 1, nullptr) == 0)
|
if (ReleaseSemaphore(sem_, 1, nullptr) == 0)
|
||||||
ec = std::error_code(GetLastError(), std::system_category());
|
ec = std::error_code(GetLastError(), std::system_category());
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTSemaphore::wait(std::error_code &ec) noexcept
|
void RTSemaphore::wait(std::error_code& ec) noexcept
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
DWORD ret = WaitForSingleObject(sem_, INFINITE);
|
DWORD ret = WaitForSingleObject(sem_, INFINITE);
|
||||||
|
|
@ -177,7 +177,7 @@ void RTSemaphore::wait(std::error_code &ec) noexcept
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RTSemaphore::try_wait(std::error_code &ec) noexcept
|
bool RTSemaphore::try_wait(std::error_code& ec) noexcept
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
DWORD ret = WaitForSingleObject(sem_, 0);
|
DWORD ret = WaitForSingleObject(sem_, 0);
|
||||||
|
|
@ -195,21 +195,21 @@ bool RTSemaphore::try_wait(std::error_code &ec) noexcept
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void RTSemaphore::init(std::error_code &ec, unsigned value)
|
void RTSemaphore::init(std::error_code& ec, unsigned value)
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
if (sem_init(&sem_, 0, value) != 0)
|
if (sem_init(&sem_, 0, value) != 0)
|
||||||
ec = std::error_code(errno, std::generic_category());
|
ec = std::error_code(errno, std::generic_category());
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTSemaphore::destroy(std::error_code &ec)
|
void RTSemaphore::destroy(std::error_code& ec)
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
if (sem_destroy(&sem_) != 0)
|
if (sem_destroy(&sem_) != 0)
|
||||||
ec = std::error_code(errno, std::generic_category());
|
ec = std::error_code(errno, std::generic_category());
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTSemaphore::post(std::error_code &ec) noexcept
|
void RTSemaphore::post(std::error_code& ec) noexcept
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
while (sem_post(&sem_) != 0) {
|
while (sem_post(&sem_) != 0) {
|
||||||
|
|
@ -221,7 +221,7 @@ void RTSemaphore::post(std::error_code &ec) noexcept
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTSemaphore::wait(std::error_code &ec) noexcept
|
void RTSemaphore::wait(std::error_code& ec) noexcept
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
while (sem_wait(&sem_) != 0) {
|
while (sem_wait(&sem_) != 0) {
|
||||||
|
|
@ -233,7 +233,7 @@ void RTSemaphore::wait(std::error_code &ec) noexcept
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RTSemaphore::try_wait(std::error_code &ec) noexcept
|
bool RTSemaphore::try_wait(std::error_code& ec) noexcept
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
do {
|
do {
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@
|
||||||
class RTSemaphore {
|
class RTSemaphore {
|
||||||
public:
|
public:
|
||||||
explicit RTSemaphore(unsigned value = 0);
|
explicit RTSemaphore(unsigned value = 0);
|
||||||
explicit RTSemaphore(std::error_code &ec, unsigned value = 0) noexcept;
|
explicit RTSemaphore(std::error_code& ec, unsigned value = 0) noexcept;
|
||||||
~RTSemaphore() noexcept;
|
~RTSemaphore() noexcept;
|
||||||
|
|
||||||
RTSemaphore(const RTSemaphore &) = delete;
|
RTSemaphore(const RTSemaphore&) = delete;
|
||||||
RTSemaphore &operator=(const RTSemaphore &) = delete;
|
RTSemaphore& operator=(const RTSemaphore&) = delete;
|
||||||
|
|
||||||
explicit operator bool() const noexcept { return good_; }
|
explicit operator bool() const noexcept { return good_; }
|
||||||
|
|
||||||
|
|
@ -29,18 +29,18 @@ public:
|
||||||
void wait();
|
void wait();
|
||||||
bool try_wait();
|
bool try_wait();
|
||||||
|
|
||||||
void post(std::error_code &ec) noexcept;
|
void post(std::error_code& ec) noexcept;
|
||||||
void wait(std::error_code &ec) noexcept;
|
void wait(std::error_code& ec) noexcept;
|
||||||
bool try_wait(std::error_code &ec) noexcept;
|
bool try_wait(std::error_code& ec) noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init(std::error_code &ec, unsigned value);
|
void init(std::error_code& ec, unsigned value);
|
||||||
void destroy(std::error_code &ec);
|
void destroy(std::error_code& ec);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
semaphore_t sem_ {};
|
semaphore_t sem_ {};
|
||||||
static const std::error_category &mach_category();
|
static const std::error_category& mach_category();
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
HANDLE sem_ {};
|
HANDLE sem_ {};
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -532,8 +532,7 @@ TEST_CASE("[Files] Looped regions taken from files and possibly overriden")
|
||||||
|
|
||||||
TEST_CASE("[Files] Case sentitiveness")
|
TEST_CASE("[Files] Case sentitiveness")
|
||||||
{
|
{
|
||||||
const fs::path sfzFilePath = fs::current_path() /
|
const fs::path sfzFilePath = fs::current_path() / "tests/TestFiles/case_insensitive.sfz";
|
||||||
"tests/TestFiles/case_insensitive.sfz";
|
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
const bool caseSensitiveFs = false;
|
const bool caseSensitiveFs = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue