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())
|
||||
return {};
|
||||
|
||||
|
||||
auto eq = absl::c_find_if(eqs, [](const EQHolderPtr& holder) {
|
||||
return holder.use_count() == 1;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ RTSemaphore::RTSemaphore(unsigned value)
|
|||
good_ = true;
|
||||
}
|
||||
|
||||
RTSemaphore::RTSemaphore(std::error_code &ec, unsigned value) noexcept
|
||||
RTSemaphore::RTSemaphore(std::error_code& ec, unsigned value) noexcept
|
||||
{
|
||||
init(ec, value);
|
||||
good_ = ec ? false : true;
|
||||
|
|
@ -58,7 +58,7 @@ bool RTSemaphore::try_wait()
|
|||
}
|
||||
|
||||
#if defined(__APPLE__)
|
||||
void RTSemaphore::init(std::error_code &ec, unsigned value)
|
||||
void RTSemaphore::init(std::error_code& ec, unsigned value)
|
||||
{
|
||||
ec.clear();
|
||||
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());
|
||||
}
|
||||
|
||||
void RTSemaphore::destroy(std::error_code &ec)
|
||||
void RTSemaphore::destroy(std::error_code& ec)
|
||||
{
|
||||
ec.clear();
|
||||
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());
|
||||
}
|
||||
|
||||
void RTSemaphore::post(std::error_code &ec) noexcept
|
||||
void RTSemaphore::post(std::error_code& ec) noexcept
|
||||
{
|
||||
ec.clear();
|
||||
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());
|
||||
}
|
||||
|
||||
void RTSemaphore::wait(std::error_code &ec) noexcept
|
||||
void RTSemaphore::wait(std::error_code& ec) noexcept
|
||||
{
|
||||
ec.clear();
|
||||
do {
|
||||
|
|
@ -99,11 +99,11 @@ void RTSemaphore::wait(std::error_code &ec) noexcept
|
|||
} while (1);
|
||||
}
|
||||
|
||||
bool RTSemaphore::try_wait(std::error_code &ec) noexcept
|
||||
bool RTSemaphore::try_wait(std::error_code& ec) noexcept
|
||||
{
|
||||
ec.clear();
|
||||
do {
|
||||
const mach_timespec_t timeout = {0, 0};
|
||||
const mach_timespec_t timeout = { 0, 0 };
|
||||
kern_return_t ret = semaphore_timedwait(sem_, timeout);
|
||||
switch (ret) {
|
||||
case KERN_SUCCESS:
|
||||
|
|
@ -119,18 +119,18 @@ bool RTSemaphore::try_wait(std::error_code &ec) noexcept
|
|||
} while (1);
|
||||
}
|
||||
|
||||
const std::error_category &RTSemaphore::mach_category()
|
||||
const std::error_category& RTSemaphore::mach_category()
|
||||
{
|
||||
class mach_category : public std::error_category {
|
||||
public:
|
||||
const char *name() const noexcept override
|
||||
const char* name() const noexcept override
|
||||
{
|
||||
return "kern_return_t";
|
||||
}
|
||||
|
||||
std::string message(int condition) const override
|
||||
{
|
||||
const char *str = mach_error_string(condition);
|
||||
const char* str = mach_error_string(condition);
|
||||
return str ? str : "";
|
||||
}
|
||||
};
|
||||
|
|
@ -139,7 +139,7 @@ const std::error_category &RTSemaphore::mach_category()
|
|||
return cat;
|
||||
}
|
||||
#elif defined(_WIN32)
|
||||
void RTSemaphore::init(std::error_code &ec, unsigned value)
|
||||
void RTSemaphore::init(std::error_code& ec, unsigned value)
|
||||
{
|
||||
ec.clear();
|
||||
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());
|
||||
}
|
||||
|
||||
void RTSemaphore::destroy(std::error_code &ec)
|
||||
void RTSemaphore::destroy(std::error_code& ec)
|
||||
{
|
||||
ec.clear();
|
||||
if (CloseHandle(sem_) == 0)
|
||||
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();
|
||||
if (ReleaseSemaphore(sem_, 1, nullptr) == 0)
|
||||
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();
|
||||
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();
|
||||
DWORD ret = WaitForSingleObject(sem_, 0);
|
||||
|
|
@ -195,21 +195,21 @@ bool RTSemaphore::try_wait(std::error_code &ec) noexcept
|
|||
}
|
||||
}
|
||||
#else
|
||||
void RTSemaphore::init(std::error_code &ec, unsigned value)
|
||||
void RTSemaphore::init(std::error_code& ec, unsigned value)
|
||||
{
|
||||
ec.clear();
|
||||
if (sem_init(&sem_, 0, value) != 0)
|
||||
ec = std::error_code(errno, std::generic_category());
|
||||
}
|
||||
|
||||
void RTSemaphore::destroy(std::error_code &ec)
|
||||
void RTSemaphore::destroy(std::error_code& ec)
|
||||
{
|
||||
ec.clear();
|
||||
if (sem_destroy(&sem_) != 0)
|
||||
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();
|
||||
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();
|
||||
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();
|
||||
do {
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@
|
|||
class RTSemaphore {
|
||||
public:
|
||||
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(const RTSemaphore &) = delete;
|
||||
RTSemaphore &operator=(const RTSemaphore &) = delete;
|
||||
RTSemaphore(const RTSemaphore&) = delete;
|
||||
RTSemaphore& operator=(const RTSemaphore&) = delete;
|
||||
|
||||
explicit operator bool() const noexcept { return good_; }
|
||||
|
||||
|
|
@ -29,18 +29,18 @@ public:
|
|||
void wait();
|
||||
bool try_wait();
|
||||
|
||||
void post(std::error_code &ec) noexcept;
|
||||
void wait(std::error_code &ec) noexcept;
|
||||
bool try_wait(std::error_code &ec) noexcept;
|
||||
void post(std::error_code& ec) noexcept;
|
||||
void wait(std::error_code& ec) noexcept;
|
||||
bool try_wait(std::error_code& ec) noexcept;
|
||||
|
||||
private:
|
||||
void init(std::error_code &ec, unsigned value);
|
||||
void destroy(std::error_code &ec);
|
||||
void init(std::error_code& ec, unsigned value);
|
||||
void destroy(std::error_code& ec);
|
||||
|
||||
private:
|
||||
#if defined(__APPLE__)
|
||||
semaphore_t sem_ {};
|
||||
static const std::error_category &mach_category();
|
||||
static const std::error_category& mach_category();
|
||||
#elif defined(_WIN32)
|
||||
HANDLE sem_ {};
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -532,8 +532,7 @@ TEST_CASE("[Files] Looped regions taken from files and possibly overriden")
|
|||
|
||||
TEST_CASE("[Files] Case sentitiveness")
|
||||
{
|
||||
const fs::path sfzFilePath = fs::current_path() /
|
||||
"tests/TestFiles/case_insensitive.sfz";
|
||||
const fs::path sfzFilePath = fs::current_path() / "tests/TestFiles/case_insensitive.sfz";
|
||||
|
||||
#if defined(_WIN32)
|
||||
const bool caseSensitiveFs = false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue