From f93a8a995b6e16625c60303ccabb0ea71e7dbeb2 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 22 Aug 2026 11:22:33 +0200 Subject: Common: Add DivideRoundingUp function Many callers of AlignUp are dividing immediately after aligning. Let's add a helper function for this so callers don't have to specify the alignment size twice. --- Source/Core/DolphinQt/MenuBar.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Core/DolphinQt/MenuBar.cpp') diff --git a/Source/Core/DolphinQt/MenuBar.cpp b/Source/Core/DolphinQt/MenuBar.cpp index 6d75ee4e79..f0ad6d2c78 100644 --- a/Source/Core/DolphinQt/MenuBar.cpp +++ b/Source/Core/DolphinQt/MenuBar.cpp @@ -1370,16 +1370,16 @@ void MenuBar::CheckNAND() const QString user_cluster_message = tr("The user-accessible part of your NAND contains %1 blocks (%2 KiB) " "of data, out of an allowed maximum of %3 blocks (%4 KiB).") - .arg(Common::AlignUp(result.used_clusters_user, IOS::HLE::FS::CLUSTERS_PER_BLOCK) / - IOS::HLE::FS::CLUSTERS_PER_BLOCK) + .arg(Common::DivideRoundingUp(result.used_clusters_user, + IOS::HLE::FS::CLUSTERS_PER_BLOCK)) .arg((result.used_clusters_user * IOS::HLE::FS::CLUSTER_SIZE) / 1024) .arg(IOS::HLE::FS::USER_CLUSTERS / IOS::HLE::FS::CLUSTERS_PER_BLOCK) .arg((IOS::HLE::FS::USER_CLUSTERS * IOS::HLE::FS::CLUSTER_SIZE) / 1024); const QString system_cluster_message = tr("The system-reserved part of your NAND contains %1 blocks (%2 KiB) " "of data, out of an allowed maximum of %3 blocks (%4 KiB).") - .arg(Common::AlignUp(result.used_clusters_system, IOS::HLE::FS::CLUSTERS_PER_BLOCK) / - IOS::HLE::FS::CLUSTERS_PER_BLOCK) + .arg(Common::DivideRoundingUp(result.used_clusters_system, + IOS::HLE::FS::CLUSTERS_PER_BLOCK)) .arg((result.used_clusters_system * IOS::HLE::FS::CLUSTER_SIZE) / 1024) .arg(IOS::HLE::FS::SYSTEM_CLUSTERS / IOS::HLE::FS::CLUSTERS_PER_BLOCK) .arg((IOS::HLE::FS::SYSTEM_CLUSTERS * IOS::HLE::FS::CLUSTER_SIZE) / 1024); -- cgit v1.2.3