diff options
author | Moonchild <moonchild@palemoon.org> | 2023-11-03 00:34:37 +0100 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2023-11-08 13:45:15 +0100 |
commit | ad321f50d91937a319f29ebab89b9509acc9b51e (patch) | |
tree | 5beef6cccca31d72dd46a286b006fc75239aa476 /layout | |
parent | cd8c5dae0cb5c23699171cf787cc70d720eec14c (diff) | |
download | uxp-ad321f50d91937a319f29ebab89b9509acc9b51e.tar.gz |
Issue #2342: Use [[nodiscard]] in /gfx and /layout
Diffstat (limited to 'layout')
-rw-r--r-- | layout/generic/AspectRatio.h | 2 | ||||
-rw-r--r-- | layout/style/ServoStyleSheet.h | 10 | ||||
-rw-r--r-- | layout/style/StyleAnimationValue.h | 28 | ||||
-rw-r--r-- | layout/svg/AutoReferenceLimiter.h | 2 |
4 files changed, 21 insertions, 21 deletions
diff --git a/layout/generic/AspectRatio.h b/layout/generic/AspectRatio.h index 5cb281c804..b940376257 100644 --- a/layout/generic/AspectRatio.h +++ b/layout/generic/AspectRatio.h @@ -47,7 +47,7 @@ struct AspectRatio { } // Inverts the ratio, in order to get the height / width ratio. - MOZ_MUST_USE AspectRatio Inverted() const { + [[nodiscard]] AspectRatio Inverted() const { if (!*this) { return AspectRatio(); } diff --git a/layout/style/ServoStyleSheet.h b/layout/style/ServoStyleSheet.h index d32d576746..8c3b888c4d 100644 --- a/layout/style/ServoStyleSheet.h +++ b/layout/style/ServoStyleSheet.h @@ -34,11 +34,11 @@ public: ServoStyleSheet* GetParentSheet() const; void AppendStyleSheet(ServoStyleSheet* aSheet); - MOZ_MUST_USE nsresult ParseSheet(const nsAString& aInput, - nsIURI* aSheetURI, - nsIURI* aBaseURI, - nsIPrincipal* aSheetPrincipal, - uint32_t aLineNumber); + [[nodiscard]] nsresult ParseSheet(const nsAString& aInput, + nsIURI* aSheetURI, + nsIURI* aBaseURI, + nsIPrincipal* aSheetPrincipal, + uint32_t aLineNumber); /** * Called instead of ParseSheet to initialize the Servo stylesheet object diff --git a/layout/style/StyleAnimationValue.h b/layout/style/StyleAnimationValue.h index e318cecb6b..af58daac13 100644 --- a/layout/style/StyleAnimationValue.h +++ b/layout/style/StyleAnimationValue.h @@ -55,7 +55,7 @@ public: * @param aCount The number of times to add aValueToAdd. * @return true on success, false on failure. */ - static MOZ_MUST_USE bool + [[nodiscard]] static bool Add(nsCSSPropertyID aProperty, StyleAnimationValue& aDest, const StyleAnimationValue& aValueToAdd, uint32_t aCount) { return AddWeighted(aProperty, 1.0, aDest, aCount, aValueToAdd, aDest); @@ -93,7 +93,7 @@ public: * @param aDistance The result of the calculation. * @return true on success, false on failure. */ - static MOZ_MUST_USE bool + [[nodiscard]] static bool ComputeDistance(nsCSSPropertyID aProperty, const StyleAnimationValue& aStartValue, const StyleAnimationValue& aEndValue, @@ -116,7 +116,7 @@ public: * @param [out] aResultValue The resulting interpolated value. * @return true on success, false on failure. */ - static MOZ_MUST_USE bool + [[nodiscard]] static bool Interpolate(nsCSSPropertyID aProperty, const StyleAnimationValue& aStartValue, const StyleAnimationValue& aEndValue, @@ -140,7 +140,7 @@ public: * difficulty, we might change this to restrict them to being * positive. */ - static MOZ_MUST_USE bool + [[nodiscard]] static bool AddWeighted(nsCSSPropertyID aProperty, double aCoeff1, const StyleAnimationValue& aValue1, double aCoeff2, const StyleAnimationValue& aValue2, @@ -162,7 +162,7 @@ public: * has a value which is outside the range [0, 1] so that we can calculate * plausible values as interpolation with the return value. */ - static MOZ_MUST_USE bool + [[nodiscard]] static bool Accumulate(nsCSSPropertyID aProperty, StyleAnimationValue& aDest, const StyleAnimationValue& aValueToAccumulate, uint64_t aCount); @@ -199,7 +199,7 @@ public: * nullptr. * @return true on success, false on failure. */ - static MOZ_MUST_USE bool + [[nodiscard]] static bool ComputeValue(nsCSSPropertyID aProperty, mozilla::dom::Element* aTargetElement, nsStyleContext* aStyleContext, @@ -218,7 +218,7 @@ public: * to aResult. On failure, aResult might still have partial results * in it. */ - static MOZ_MUST_USE bool + [[nodiscard]] static bool ComputeValues(nsCSSPropertyID aProperty, mozilla::CSSEnabledState aEnabledState, mozilla::dom::Element* aTargetElement, @@ -231,7 +231,7 @@ public: * A variant on ComputeValues that takes an nsCSSValue as the specified * value. Only longhand properties are supported. */ - static MOZ_MUST_USE bool + [[nodiscard]] static bool ComputeValues(nsCSSPropertyID aProperty, mozilla::CSSEnabledState aEnabledState, mozilla::dom::Element* aTargetElement, @@ -244,7 +244,7 @@ public: * A variant of ComputeValues that takes a RawServoDeclarationBlock * as the specified value. */ - static MOZ_MUST_USE bool + [[nodiscard]] static bool ComputeValues(nsCSSPropertyID aProperty, mozilla::CSSEnabledState aEnabledState, nsStyleContext* aStyleContext, @@ -268,18 +268,18 @@ public: * @param [out] aSpecifiedValue The resulting specified value. * @return true on success, false on failure. * - * These functions are not MOZ_MUST_USE because failing to check the return + * These functions are not [[nodiscard]] because failing to check the return * value is common and reasonable. */ - static MOZ_MUST_USE bool + static bool UncomputeValue(nsCSSPropertyID aProperty, const StyleAnimationValue& aComputedValue, nsCSSValue& aSpecifiedValue); - static MOZ_MUST_USE bool + static bool UncomputeValue(nsCSSPropertyID aProperty, StyleAnimationValue&& aComputedValue, nsCSSValue& aSpecifiedValue); - static MOZ_MUST_USE bool + static bool UncomputeValue(nsCSSPropertyID aProperty, const StyleAnimationValue& aComputedValue, nsAString& aSpecifiedValue); @@ -298,7 +298,7 @@ public: * @param [out] aComputedValue The resulting computed value. * @return true on success, false on failure. */ - static MOZ_MUST_USE bool ExtractComputedValue( + [[nodiscard]] static bool ExtractComputedValue( nsCSSPropertyID aProperty, nsStyleContext* aStyleContext, StyleAnimationValue& aComputedValue); diff --git a/layout/svg/AutoReferenceLimiter.h b/layout/svg/AutoReferenceLimiter.h index 5f822ba135..268f84539a 100644 --- a/layout/svg/AutoReferenceLimiter.h +++ b/layout/svg/AutoReferenceLimiter.h @@ -96,7 +96,7 @@ public: * within the specified limits), else returns false on failure (there is a * reference loop/the reference chain has exceeded the specified limits). */ - MOZ_MUST_USE bool Reference() { + [[nodiscard]] bool Reference() { // If we fail this assertion then either a consumer failed to break a // reference loop/chain, or else they called Reference() more than once MOZ_ASSERT(*mRefCounter >= 0); |