Change up strcasecmp/strncasecmp to be more C++y
This commit is contained in:
+6
-6
@@ -123,13 +123,13 @@ namespace music {
|
||||
|
||||
void _loop() {
|
||||
if (command::argc() == 2) {
|
||||
if (q_strcasecmp(command::argv(1)->c_str(), "0") == 0 ||
|
||||
q_strcasecmp(command::argv(1)->c_str(), "off") == 0)
|
||||
if (std::is_eq(common::strcasecmp(command::argv(1).value(), "0")) ||
|
||||
std::is_eq(common::strcasecmp(command::argv(1).value(), "off")))
|
||||
looping = false;
|
||||
else if (q_strcasecmp(command::argv(1)->c_str(), "1") == 0 ||
|
||||
q_strcasecmp(command::argv(1)->c_str(), "on") == 0)
|
||||
else if (std::is_eq(common::strcasecmp(command::argv(1).value(), "1")) ||
|
||||
std::is_eq(common::strcasecmp(command::argv(1).value(), "on")))
|
||||
looping = true;
|
||||
else if (q_strcasecmp(command::argv(1)->c_str(), "toggle") == 0)
|
||||
else if (std::is_eq(common::strcasecmp(command::argv(1).value(), "toggle")))
|
||||
looping = !looping;
|
||||
|
||||
if (stream) stream->loop = looping;
|
||||
@@ -326,7 +326,7 @@ namespace music {
|
||||
const handler *chosen = nullptr;
|
||||
for (const auto &handler: active_handlers) {
|
||||
if (handler.is_available &&
|
||||
!q_strcasecmp(ext, handler.ext)) {
|
||||
std::is_eq(common::strcasecmp(ext, handler.ext))) {
|
||||
chosen = &handler;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user