From 4a5a611b4ea274bfb54719a078f92f0740aec88e Mon Sep 17 00:00:00 2001 From: longsonr Date: Thu, 7 Nov 2024 11:09:40 +0000 Subject: [PATCH] Bug 1929626 - Remove more uses/includes of nsAlgorithm.h r=emilio,win-reviewers,gstoll Differential Revision: https://phabricator.services.mozilla.com/D228203 --- dom/base/nsTextFragmentVMX.cpp | 1 - dom/file/FileReader.cpp | 3 +-- dom/media/webm/WebMBufferedParser.cpp | 1 - dom/xhr/XMLHttpRequestMainThread.h | 2 +- editor/libeditor/HTMLAbsPositionEditor.cpp | 1 - editor/libeditor/HTMLEditSubActionHandler.cpp | 1 - editor/libeditor/HTMLEditorObjectResizer.cpp | 1 - editor/libeditor/HTMLEditorState.cpp | 1 - editor/libeditor/HTMLTableEditor.cpp | 1 - gfx/thebes/gfxPlatform.cpp | 1 - gfx/thebes/gfxXlibSurface.cpp | 1 - layout/svg/SVGTextFrame.cpp | 1 - layout/svg/SVGUtils.h | 1 - layout/tables/nsCellMap.h | 1 - testing/mochitest/ssltunnel/ssltunnel.cpp | 1 - toolkit/components/aboutthirdparty/AboutThirdPartyUtils.cpp | 2 +- widget/nsNativeTheme.h | 1 - widget/windows/IEnumFE.cpp | 1 - 18 files changed, 3 insertions(+), 19 deletions(-) diff --git a/dom/base/nsTextFragmentVMX.cpp b/dom/base/nsTextFragmentVMX.cpp index a071adaee7de..2406bb7d1334 100644 --- a/dom/base/nsTextFragmentVMX.cpp +++ b/dom/base/nsTextFragmentVMX.cpp @@ -5,7 +5,6 @@ // This file should only be compiled if you're on Power ISA. #include "nscore.h" -#include "nsAlgorithm.h" #include "nsTextFragmentImpl.h" #include #include diff --git a/dom/file/FileReader.cpp b/dom/file/FileReader.cpp index 4a6d394fe181..1613aaf8bdf3 100644 --- a/dom/file/FileReader.cpp +++ b/dom/file/FileReader.cpp @@ -24,7 +24,6 @@ #include "mozilla/dom/WorkerScope.h" #include "mozilla/Encoding.h" #include "mozilla/HoldDropJSObjects.h" -#include "nsAlgorithm.h" #include "nsCycleCollectionParticipant.h" #include "nsDOMJSUtils.h" #include "nsError.h" @@ -312,7 +311,7 @@ nsresult FileReader::DoReadData(uint64_t aCount) { while (aCount > 0) { char tmpBuffer[4096]; uint32_t minCount = - XPCOM_MIN(aCount, static_cast(sizeof(tmpBuffer))); + std::min(aCount, static_cast(sizeof(tmpBuffer))); uint32_t read = 0; nsresult rv = mAsyncStream->Read(tmpBuffer, minCount, &read); diff --git a/dom/media/webm/WebMBufferedParser.cpp b/dom/media/webm/WebMBufferedParser.cpp index 736b4310739f..3d2e9937cb44 100644 --- a/dom/media/webm/WebMBufferedParser.cpp +++ b/dom/media/webm/WebMBufferedParser.cpp @@ -9,7 +9,6 @@ #include #include "mozilla/CheckedInt.h" -#include "nsAlgorithm.h" #include "nsThreadUtils.h" extern mozilla::LazyLogModule gMediaDemuxerLog; diff --git a/dom/xhr/XMLHttpRequestMainThread.h b/dom/xhr/XMLHttpRequestMainThread.h index 2d0f2a45234b..b9be9402a259 100644 --- a/dom/xhr/XMLHttpRequestMainThread.h +++ b/dom/xhr/XMLHttpRequestMainThread.h @@ -551,7 +551,7 @@ class XMLHttpRequestMainThread final : public XMLHttpRequest, bool operator<(const HeaderEntry& aOther) const { uint32_t selfLen = mName.Length(); uint32_t otherLen = aOther.mName.Length(); - uint32_t min = XPCOM_MIN(selfLen, otherLen); + uint32_t min = std::min(selfLen, otherLen); for (uint32_t i = 0; i < min; ++i) { unsigned char self = mName[i]; unsigned char other = aOther.mName[i]; diff --git a/editor/libeditor/HTMLAbsPositionEditor.cpp b/editor/libeditor/HTMLAbsPositionEditor.cpp index 52cf72af5e42..7c9f62bd153a 100644 --- a/editor/libeditor/HTMLAbsPositionEditor.cpp +++ b/editor/libeditor/HTMLAbsPositionEditor.cpp @@ -22,7 +22,6 @@ #include "mozilla/dom/Element.h" #include "mozilla/dom/EventTarget.h" #include "nsAString.h" -#include "nsAlgorithm.h" #include "nsCOMPtr.h" #include "nsComputedDOMStyle.h" #include "nsDebug.h" diff --git a/editor/libeditor/HTMLEditSubActionHandler.cpp b/editor/libeditor/HTMLEditSubActionHandler.cpp index f58e144f2669..5f7193af12de 100644 --- a/editor/libeditor/HTMLEditSubActionHandler.cpp +++ b/editor/libeditor/HTMLEditSubActionHandler.cpp @@ -49,7 +49,6 @@ #include "mozilla/dom/StaticRange.h" #include "mozilla/mozalloc.h" #include "nsAString.h" -#include "nsAlgorithm.h" #include "nsAtom.h" #include "nsCRT.h" #include "nsCRTGlue.h" diff --git a/editor/libeditor/HTMLEditorObjectResizer.cpp b/editor/libeditor/HTMLEditorObjectResizer.cpp index a9b9cc3c828f..b42a693eaa50 100644 --- a/editor/libeditor/HTMLEditorObjectResizer.cpp +++ b/editor/libeditor/HTMLEditorObjectResizer.cpp @@ -21,7 +21,6 @@ #include "mozilla/dom/MouseEvent.h" #include "mozilla/dom/EventTarget.h" #include "nsAString.h" -#include "nsAlgorithm.h" #include "nsCOMPtr.h" #include "nsDebug.h" #include "nsError.h" diff --git a/editor/libeditor/HTMLEditorState.cpp b/editor/libeditor/HTMLEditorState.cpp index bfd496add582..7aa2315e6f36 100644 --- a/editor/libeditor/HTMLEditorState.cpp +++ b/editor/libeditor/HTMLEditorState.cpp @@ -23,7 +23,6 @@ #include "mozilla/dom/Selection.h" #include "nsAString.h" -#include "nsAlgorithm.h" #include "nsAtom.h" #include "nsDebug.h" #include "nsError.h" diff --git a/editor/libeditor/HTMLTableEditor.cpp b/editor/libeditor/HTMLTableEditor.cpp index 7847bb99d61d..a31abae9e910 100644 --- a/editor/libeditor/HTMLTableEditor.cpp +++ b/editor/libeditor/HTMLTableEditor.cpp @@ -22,7 +22,6 @@ #include "mozilla/dom/Element.h" #include "mozilla/dom/ElementInlines.h" #include "nsAString.h" -#include "nsAlgorithm.h" #include "nsCOMPtr.h" #include "nsDebug.h" #include "nsError.h" diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index e76db2004916..91e783e0ed8b 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -148,7 +148,6 @@ static const uint32_t kDefaultGlyphCacheSize = -1; #include "mozilla/Attributes.h" #include "mozilla/Mutex.h" -#include "nsAlgorithm.h" #include "nsIGfxInfo.h" #include "nsIXULRuntime.h" #include "VsyncSource.h" diff --git a/gfx/thebes/gfxXlibSurface.cpp b/gfx/thebes/gfxXlibSurface.cpp index 2d67a8e05a00..27217dbb014e 100644 --- a/gfx/thebes/gfxXlibSurface.cpp +++ b/gfx/thebes/gfxXlibSurface.cpp @@ -13,7 +13,6 @@ #undef Data #include "nsTArray.h" -#include "nsAlgorithm.h" #include "mozilla/gfx/2D.h" #include "mozilla/Preferences.h" #include diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp index 7b280f9ec7f6..d3d05be67a67 100644 --- a/layout/svg/SVGTextFrame.cpp +++ b/layout/svg/SVGTextFrame.cpp @@ -16,7 +16,6 @@ #include "gfxTypes.h" #include "gfxUtils.h" #include "LookAndFeel.h" -#include "nsAlgorithm.h" #include "nsBidiPresUtils.h" #include "nsBlockFrame.h" #include "nsCaret.h" diff --git a/layout/svg/SVGUtils.h b/layout/svg/SVGUtils.h index 089632af5b8d..ccb8e058064b 100644 --- a/layout/svg/SVGUtils.h +++ b/layout/svg/SVGUtils.h @@ -17,7 +17,6 @@ #include "gfxPoint.h" #include "gfxRect.h" #include "mozilla/gfx/Rect.h" -#include "nsAlgorithm.h" #include "nsChangeHint.h" #include "nsColor.h" #include "nsCOMPtr.h" diff --git a/layout/tables/nsCellMap.h b/layout/tables/nsCellMap.h index 9749d327e044..43b5d983a12c 100644 --- a/layout/tables/nsCellMap.h +++ b/layout/tables/nsCellMap.h @@ -9,7 +9,6 @@ #include "celldata.h" #include "nsTArray.h" #include "nsCOMPtr.h" -#include "nsAlgorithm.h" #include "nsRect.h" #include #include "TableArea.h" diff --git a/testing/mochitest/ssltunnel/ssltunnel.cpp b/testing/mochitest/ssltunnel/ssltunnel.cpp index 78832694e665..adc5b3e89107 100644 --- a/testing/mochitest/ssltunnel/ssltunnel.cpp +++ b/testing/mochitest/ssltunnel/ssltunnel.cpp @@ -24,7 +24,6 @@ #include "prenv.h" #include "prnetdb.h" #include "prtpool.h" -#include "nsAlgorithm.h" #include "nss.h" #include "keyhi.h" #include "ssl.h" diff --git a/toolkit/components/aboutthirdparty/AboutThirdPartyUtils.cpp b/toolkit/components/aboutthirdparty/AboutThirdPartyUtils.cpp index 050975c9da13..5667a4d74ffe 100644 --- a/toolkit/components/aboutthirdparty/AboutThirdPartyUtils.cpp +++ b/toolkit/components/aboutthirdparty/AboutThirdPartyUtils.cpp @@ -13,7 +13,7 @@ namespace mozilla { int32_t CompareIgnoreCase(const nsAString& aStr1, const nsAString& aStr2) { uint32_t len1 = aStr1.Length(); uint32_t len2 = aStr2.Length(); - uint32_t lenMin = XPCOM_MIN(len1, len2); + uint32_t lenMin = std::min(len1, len2); int32_t result = nsCaseInsensitiveStringComparator( aStr1.BeginReading(), aStr2.BeginReading(), lenMin, lenMin); diff --git a/widget/nsNativeTheme.h b/widget/nsNativeTheme.h index 28a8c0cc3fad..fce4b5950e77 100644 --- a/widget/nsNativeTheme.h +++ b/widget/nsNativeTheme.h @@ -9,7 +9,6 @@ #ifndef _NSNATIVETHEME_H_ #define _NSNATIVETHEME_H_ -#include "nsAlgorithm.h" #include "nsAtom.h" #include "nsColor.h" #include "nsCOMPtr.h" diff --git a/widget/windows/IEnumFE.cpp b/widget/windows/IEnumFE.cpp index 8fe713860964..fd8ede0aadca 100644 --- a/widget/windows/IEnumFE.cpp +++ b/widget/windows/IEnumFE.cpp @@ -4,7 +4,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "IEnumFE.h" -#include "nsAlgorithm.h" #include CEnumFormatEtc::CEnumFormatEtc() : mRefCnt(0), mCurrentIdx(0) {}