diff --git a/app/src/main/cpp/skyline/common/uuid.cpp b/app/src/main/cpp/skyline/common/uuid.cpp index 4a40b249..4cc2ca79 100644 --- a/app/src/main/cpp/skyline/common/uuid.cpp +++ b/app/src/main/cpp/skyline/common/uuid.cpp @@ -75,7 +75,7 @@ namespace skyline { return uuid.Swap(); } - UUID UUID::GenerateUuidV5(const std::array sha1) { + UUID UUID::GenerateUuidV5(span sha1) { constexpr u8 reserved{0x1}; // RFC4122 variant constexpr u8 version{0x5}; // v4 UUIDs are generated using SHA1 hashes diff --git a/app/src/main/cpp/skyline/common/uuid.h b/app/src/main/cpp/skyline/common/uuid.h index 11414957..3c10c201 100644 --- a/app/src/main/cpp/skyline/common/uuid.h +++ b/app/src/main/cpp/skyline/common/uuid.h @@ -18,7 +18,7 @@ namespace skyline { /** * @brief Generates a version 5 UUID from the given SHA1 */ - static UUID GenerateUuidV5(const std::array sha1); + static UUID GenerateUuidV5(span sha1); /** * @brief Checks if a UUID is an invalid nil UUID diff --git a/app/src/main/cpp/skyline/kernel/scheduler.cpp b/app/src/main/cpp/skyline/kernel/scheduler.cpp index 40fa90da..8416fc14 100644 --- a/app/src/main/cpp/skyline/kernel/scheduler.cpp +++ b/app/src/main/cpp/skyline/kernel/scheduler.cpp @@ -258,10 +258,9 @@ namespace skyline::kernel { std::unique_lock coreLock(core->mutex); auto currentIt{std::find(core->queue.begin(), core->queue.end(), thread)}, nextIt{std::next(currentIt)}; - if (currentIt == core->queue.end()) + if (currentIt == core->queue.end()) { return; - - if (currentIt == core->queue.begin()) { + } else if (currentIt == core->queue.begin()) { // Alternatively, if it's currently running then we'd just want to yield if there's a higher priority thread to run instead if (nextIt != core->queue.end() && (*nextIt)->priority < thread->priority) { if (!thread->pendingYield) { diff --git a/app/src/main/cpp/skyline/kernel/types/KThread.cpp b/app/src/main/cpp/skyline/kernel/types/KThread.cpp index 4ad7ec24..c1a0970c 100644 --- a/app/src/main/cpp/skyline/kernel/types/KThread.cpp +++ b/app/src/main/cpp/skyline/kernel/types/KThread.cpp @@ -244,7 +244,7 @@ namespace skyline::kernel::type { } void KThread::DisarmPreemptionTimer() { - if (!isPreempted) + if (!isPreempted) [[unlikely]] return; std::unique_lock lock(statusMutex); diff --git a/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.cpp b/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.cpp index 5b95be9f..8ede8fa5 100644 --- a/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.cpp +++ b/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.cpp @@ -45,8 +45,8 @@ namespace skyline::service::am { auto seedForPseudoDeviceId{state.loader->nacp->nacpContents.seedForPseudoDeviceId}; std::array hashBuf{}; - // On HOS the seed from control.ncap is hashed together with the device specific device ID seed, - // for us it's enough to just hash the seed from control.nacp as it provides the same guarantees. + // On HOS the seed from control.ncap is hashed together with the device specific device ID seed + // for us it's enough to just hash the seed from control.nacp as it provides the same guarantees if (int err{mbedtls_sha1_ret(seedForPseudoDeviceId.data(), seedForPseudoDeviceId.size(), hashBuf.data())}; err < 0) throw exception("Failed to hash device ID, err: {}", err);