diff --git a/image/SurfaceCache.cpp b/image/SurfaceCache.cpp index ca995ed8b1dd..439d38627eb1 100644 --- a/image/SurfaceCache.cpp +++ b/image/SurfaceCache.cpp @@ -270,7 +270,7 @@ class ImageSurfaceCache { return bytes; } - MOZ_MUST_USE bool Insert(NotNull aSurface) { + [[nodiscard]] bool Insert(NotNull aSurface) { MOZ_ASSERT(!mLocked || aSurface->IsPlaceholder() || aSurface->IsLocked(), "Inserting an unlocked surface for a locked image"); return mSurfaces.Put(aSurface->GetSurfaceKey(), diff --git a/image/decoders/icon/mac/nsIconChannel.h b/image/decoders/icon/mac/nsIconChannel.h index 8c279310fa5d..dca2a3c51a49 100644 --- a/image/decoders/icon/mac/nsIconChannel.h +++ b/image/decoders/icon/mac/nsIconChannel.h @@ -49,8 +49,8 @@ class nsIconChannel final : public nsIChannel, public nsIStreamListener { nsCOMPtr mListener; bool mCanceled = false; - MOZ_MUST_USE nsresult MakeInputStream(nsIInputStream** _retval, - bool nonBlocking); + [[nodiscard]] nsresult MakeInputStream(nsIInputStream** _retval, + bool nonBlocking); nsresult ExtractIconInfoFromUrl(nsIFile** aLocalFile, uint32_t* aDesiredImageSize, diff --git a/image/decoders/icon/nsIconURI.h b/image/decoders/icon/nsIconURI.h index 7fa801a14f1e..94cb86253a37 100644 --- a/image/decoders/icon/nsIconURI.h +++ b/image/decoders/icon/nsIconURI.h @@ -84,7 +84,7 @@ class nsMozIconURI final : public nsIMozIconURI, return NS_ERROR_NOT_IMPLEMENTED; } - MOZ_MUST_USE NS_IMETHOD Read(nsIObjectInputStream* aStream) override { + [[nodiscard]] NS_IMETHOD Read(nsIObjectInputStream* aStream) override { return InitFromInputStream(aStream); } diff --git a/image/decoders/icon/win/nsIconChannel.h b/image/decoders/icon/win/nsIconChannel.h index 87c95f900153..f3bb93f3486f 100644 --- a/image/decoders/icon/win/nsIconChannel.h +++ b/image/decoders/icon/win/nsIconChannel.h @@ -69,8 +69,8 @@ class nsIconChannel final : public nsIChannel, public nsIStreamListener { nsresult GetHIconFromFile(bool aNonBlocking, HICON* hIcon); nsresult GetHIconFromFile(nsIFile* aLocalFile, const nsAutoString& aPath, UINT aInfoFlags, HICON* hIcon); - MOZ_MUST_USE nsresult MakeInputStream(nsIInputStream** _retval, - bool aNonBlocking, HICON aIcon); + [[nodiscard]] nsresult MakeInputStream(nsIInputStream** _retval, + bool aNonBlocking, HICON aIcon); // Functions specific to Vista and above protected: diff --git a/image/imgLoader.h b/image/imgLoader.h index ea63a715f2a6..531fa2e74afe 100644 --- a/image/imgLoader.h +++ b/image/imgLoader.h @@ -239,7 +239,7 @@ class imgLoader final : public imgILoader, imgLoader(); nsresult Init(); - MOZ_MUST_USE nsresult LoadImage( + [[nodiscard]] nsresult LoadImage( nsIURI* aURI, nsIURI* aInitialDocumentURI, nsIReferrerInfo* aReferrerInfo, nsIPrincipal* aLoadingPrincipal, uint64_t aRequestContextID, nsILoadGroup* aLoadGroup, imgINotificationObserver* aObserver, @@ -248,10 +248,10 @@ class imgLoader final : public imgILoader, nsContentPolicyType aContentPolicyType, const nsAString& initiatorType, bool aUseUrgentStartForChannel, imgRequestProxy** _retval); - MOZ_MUST_USE nsresult - LoadImageWithChannel(nsIChannel* channel, imgINotificationObserver* aObserver, - nsISupports* aCX, nsIStreamListener** listener, - imgRequestProxy** _retval); + [[nodiscard]] nsresult LoadImageWithChannel( + nsIChannel* channel, imgINotificationObserver* aObserver, + nsISupports* aCX, nsIStreamListener** listener, + imgRequestProxy** _retval); static nsresult GetMimeTypeFromContent(const char* aContents, uint32_t aLength, diff --git a/image/imgRequest.h b/image/imgRequest.h index 970561ccf3ef..3b0d12a398d0 100644 --- a/image/imgRequest.h +++ b/image/imgRequest.h @@ -62,12 +62,12 @@ class imgRequest final : public nsIStreamListener, NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK - MOZ_MUST_USE nsresult Init(nsIURI* aURI, nsIURI* aFinalURI, - bool aHadInsecureRedirect, nsIRequest* aRequest, - nsIChannel* aChannel, imgCacheEntry* aCacheEntry, - nsISupports* aCX, - nsIPrincipal* aTriggeringPrincipal, - int32_t aCORSMode, nsIReferrerInfo* aReferrerInfo); + [[nodiscard]] nsresult + Init(nsIURI* aURI, nsIURI* aFinalURI, bool aHadInsecureRedirect, + nsIRequest* aRequest, nsIChannel* aChannel, + imgCacheEntry* aCacheEntry, nsISupports* aCX, + nsIPrincipal* aTriggeringPrincipal, int32_t aCORSMode, + nsIReferrerInfo* aReferrerInfo); void ClearLoader();