Bug 1931356 - Remove NS_ROUNDUP (replace usage by RoundUpToMultiple) r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D229017
This commit is contained in:
longsonr 2024-11-14 22:40:39 +00:00
parent b99c072211
commit d8ad9862e4
4 changed files with 3 additions and 9 deletions

View File

@ -11,7 +11,6 @@
#include "nsGenericHTMLElement.h"
#include "nsAttrValue.h"
#include "nsAttrValueInlines.h"
#include "nsAlgorithm.h"
#include <algorithm>
namespace mozilla::dom {

View File

@ -113,7 +113,7 @@ class gfxDWriteFontEntry final : public gfxFontEntry {
mStretchRange =
StretchRange(FontStretchFromDWriteStretch(aFont->GetStretch()));
int weight = NS_ROUNDUP(aFont->GetWeight() - 50, 100);
int weight = mozilla::RoundUpToMultiple(aFont->GetWeight() - 50, 100);
weight = std::clamp(weight, 100, 900);
mWeightRange = WeightRange(FontWeight::FromInt(weight));

View File

@ -5,8 +5,8 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "StackArena.h"
#include "nsAlgorithm.h"
#include "nsDebug.h"
#include "mozilla/gfx/NumericTools.h"
namespace mozilla {
@ -114,7 +114,7 @@ void* StackArena::Allocate(size_t aSize) {
NS_ASSERTION(mStackTop > 0, "Allocate called without Push");
// Align to a multiple of 8.
aSize = NS_ROUNDUP<size_t>(aSize, 8);
aSize = RoundUpToMultiple(aSize, 8);
// On stack overflow, grab another block.
if (mPos + aSize >= StackBlock::MAX_USABLE_SIZE) {

View File

@ -10,11 +10,6 @@
#include <cstdint>
#include "mozilla/Assertions.h"
template <class T>
inline T NS_ROUNDUP(const T& aA, const T& aB) {
return ((aA + (aB - 1)) / aB) * aB;
}
// We use these instead of std::min/max because we can't include the algorithm
// header in all of XPCOM because the stl wrappers will error out when included
// in parts of XPCOM. These functions should never be used outside of XPCOM.