Idle: move flags to IdleFlags.hxx
This commit is contained in:
39
src/Idle.cxx
39
src/Idle.cxx
@@ -26,7 +26,6 @@
|
||||
#include "Idle.hxx"
|
||||
#include "Main.hxx"
|
||||
#include "Instance.hxx"
|
||||
#include "util/ASCII.hxx"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
@@ -34,23 +33,6 @@
|
||||
|
||||
static std::atomic_uint idle_flags;
|
||||
|
||||
static const char *const idle_names[] = {
|
||||
"database",
|
||||
"stored_playlist",
|
||||
"playlist",
|
||||
"player",
|
||||
"mixer",
|
||||
"output",
|
||||
"options",
|
||||
"sticker",
|
||||
"update",
|
||||
"subscription",
|
||||
"message",
|
||||
"neighbor",
|
||||
"mount",
|
||||
nullptr
|
||||
};
|
||||
|
||||
void
|
||||
idle_add(unsigned flags)
|
||||
{
|
||||
@@ -67,24 +49,3 @@ idle_get(void)
|
||||
{
|
||||
return idle_flags.exchange(0);
|
||||
}
|
||||
|
||||
const char*const*
|
||||
idle_get_names(void)
|
||||
{
|
||||
return idle_names;
|
||||
}
|
||||
|
||||
unsigned
|
||||
idle_parse_name(const char *name)
|
||||
{
|
||||
#if !CLANG_CHECK_VERSION(3,6)
|
||||
/* disabled on clang due to -Wtautological-pointer-compare */
|
||||
assert(name != nullptr);
|
||||
#endif
|
||||
|
||||
for (unsigned i = 0; idle_names[i] != nullptr; ++i)
|
||||
if (StringEqualsCaseASCII(name, idle_names[i]))
|
||||
return 1 << i;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user