From a3ea006705fcdb9ed7fa5c60a42367002e42d916 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 17 Jul 2024 11:15:31 +0000 Subject: [PATCH] Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,necko-reviewers,geckoview-reviewers,application-update-reviewers,media-playback-reviewers,devtools-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,migration-reviewers,padenot,mconley,nchevobbe,kershaw,gstoll,mstange,bytesized,m_kato This new version of clang 17 also slightly changed the formatting. # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D215914 --- accessible/atk/nsStateMap.h | 11 +- accessible/base/EventQueue.cpp | 2 +- accessible/base/TextAttrs.h | 2 +- accessible/base/nsAccessibilityService.cpp | 7 +- accessible/mac/RotorRules.mm | 24 ++-- accessible/windows/sdn/sdnDocAccessible.h | 4 +- accessible/windows/sdn/sdnTextAccessible.h | 2 +- accessible/xul/XULMenuAccessible.cpp | 4 +- .../freestanding/LoaderPrivateAPI.cpp | 5 +- .../migration/nsKeychainMigrationUtils.h | 4 +- .../shell/nsGNOMEShellSearchProvider.cpp | 2 +- .../shell/nsGNOMEShellSearchProvider.h | 4 +- browser/components/shell/nsMacShellService.h | 4 +- build/unix/elfhack/elf.cpp | 6 +- build/unix/elfhack/elfxx.h | 27 ++--- config/nsinstall.c | 3 +- devtools/shared/heapsnapshot/AutoMemMap.h | 2 +- .../shared/heapsnapshot/DeserializedNode.h | 2 +- devtools/shared/heapsnapshot/HeapSnapshot.h | 2 +- docshell/base/SyncedContext.h | 2 +- docshell/base/nsIScrollObserver.h | 4 +- dom/base/ResponsiveImageSelector.cpp | 23 ++-- dom/base/TreeWalker.cpp | 3 +- dom/base/nsTraversal.cpp | 3 +- dom/cache/ActorChild.h | 3 +- dom/fetch/FetchDriver.h | 2 +- dom/filesystem/GetFilesHelper.h | 2 +- dom/html/HTMLMediaElement.h | 2 +- dom/html/HTMLTableCellElement.cpp | 9 +- dom/l10n/DOMLocalization.cpp | 2 +- dom/locks/LockRequestParent.h | 2 +- dom/media/DOMMediaStream.h | 12 +- dom/media/GraphRunner.cpp | 2 +- dom/media/MediaDevices.h | 2 +- dom/media/MediaStreamTrack.cpp | 4 +- dom/media/MediaStreamTrack.h | 6 +- dom/media/doctor/MultiWriterQueue.h | 4 +- dom/media/flac/FlacFrameParser.cpp | 2 +- dom/media/gtest/AudioVerifier.h | 4 +- dom/media/gtest/TestDeviceInputTrack.cpp | 7 +- dom/media/imagecapture/CaptureTask.cpp | 2 +- dom/media/ipc/RDDProcessManager.cpp | 4 +- .../mediacontrol/MediaControlKeySource.h | 6 +- dom/media/mediasink/AudioDecoderInputTrack.h | 8 +- dom/media/mediasink/MediaSink.h | 2 +- dom/media/platforms/SimpleMap.h | 2 +- .../platforms/android/JavaCallbacksSupport.h | 2 +- dom/media/platforms/wmf/MFMediaEngineStream.h | 2 +- dom/media/webrtc/jsapi/PeerConnectionImpl.h | 2 +- dom/media/webrtc/jsapi/RTCStatsIdGenerator.h | 2 +- dom/media/webrtc/jsapi/RemoteTrackSource.cpp | 4 +- .../webrtc/jsapi/WebrtcGlobalStatsHistory.cpp | 5 +- dom/media/webrtc/sdp/SdpTelemetry.cpp | 7 +- dom/media/webrtc/sdp/SdpTelemetry.h | 4 +- .../synth/android/SpeechSynthesisService.h | 4 +- dom/prototype/PrototypeDocumentContentSink.h | 4 +- dom/script/ShadowRealmGlobalScope.h | 2 +- dom/serializers/nsXMLContentSerializer.h | 2 +- dom/streams/QueueWithSizes.h | 2 +- dom/svg/SVGElement.h | 3 +- dom/system/mac/nsOSPermissionRequest.h | 2 +- dom/webauthn/WinWebAuthnService.h | 3 +- dom/workers/loader/WorkerLoadContext.cpp | 4 +- .../remoteworkers/RemoteWorkerChild.cpp | 2 +- dom/xslt/base/txErrorObserver.h | 2 +- editor/libeditor/CSSEditUtils.cpp | 3 +- editor/libeditor/HTMLEditUtils.cpp | 7 +- editor/libeditor/HTMLEditorDataTransfer.cpp | 2 +- editor/libeditor/HTMLStyleEditor.cpp | 2 +- editor/libeditor/InternetCiter.cpp | 2 +- extensions/auth/gssapi.h | 3 +- gfx/2d/HelpersD2D.h | 7 +- gfx/2d/PathD2D.cpp | 4 +- gfx/gl/SharedSurface.h | 8 +- gfx/gl/SharedSurfaceEGL.h | 2 +- gfx/layers/AxisPhysicsModel.h | 6 +- gfx/layers/TreeTraversal.h | 8 +- gfx/layers/apz/test/gtest/APZCBasicTester.h | 3 +- .../apz/test/gtest/APZCTreeManagerTester.h | 3 +- .../apz/test/gtest/TestEventRegions.cpp | 3 +- .../apz/test/gtest/TestGestureDetector.cpp | 15 +-- gfx/layers/client/CompositableClient.h | 2 +- gfx/layers/client/GPUVideoTextureClient.h | 2 +- gfx/layers/client/TextureClient.h | 2 +- gfx/thebes/gfxMacPlatformFontList.mm | 2 +- gfx/wr/swgl/src/rasterize.h | 2 +- hal/cocoa/CocoaBattery.cpp | 4 +- image/decoders/icon/nsIconURI.cpp | 4 +- image/decoders/icon/win/nsIconChannel.cpp | 2 +- image/imgTools.cpp | 6 +- intl/components/src/NumberParser.h | 2 +- intl/lwbrk/th_char.h | 2 +- ipc/chromium/src/base/message_pump.h | 2 +- ipc/glue/ForkServer.h | 2 +- ipc/glue/MessagePump.cpp | 3 +- ipc/glue/NodeController.cpp | 7 +- ipc/glue/UtilityAudioDecoderChild.h | 2 +- js/public/Printer.h | 3 +- js/public/PropertySpec.h | 2 +- js/public/Utility.h | 2 +- js/src/debugger/Debugger.h | 2 +- .../rootAnalysis/t/virtual/source.cpp | 2 +- js/src/ds/BitArray.h | 2 +- js/src/frontend/AsyncEmitter.h | 2 +- js/src/frontend/CompilationStencil.h | 46 +++---- js/src/frontend/TokenStream.cpp | 2 +- js/src/frontend/TypedIndex.h | 2 +- js/src/jit/FlushICache.h | 5 +- js/src/jit/PerfSpewer.h | 2 +- js/src/jsapi-tests/testGCAllocator.cpp | 3 +- js/src/vm/JSAtomState.h | 4 +- js/src/vm/PropertyAndElement.cpp | 2 +- js/src/vm/SavedStacks.h | 3 +- js/src/wasm/WasmBCFrame.h | 2 +- js/xpconnect/public/xpc_make_class.h | 113 +++++++++--------- js/xpconnect/src/XPCRuntimeService.cpp | 7 +- js/xpconnect/wrappers/XrayWrapper.h | 2 +- layout/base/nsBidiPresUtils.cpp | 2 +- layout/mathml/nsMathMLChar.cpp | 6 +- layout/tables/nsTableRowGroupFrame.cpp | 4 +- media/webrtc/signaling/gtest/MockCall.h | 4 +- media/wmf-clearkey/WMFClearKeyCDM.h | 14 +-- memory/build/mozmemory_utils.h | 4 +- memory/gtest/TestJemalloc.cpp | 4 +- mfbt/Attributes.h | 10 +- mfbt/Buffer.h | 2 +- mfbt/tests/TestAtomicBitfields.cpp | 24 ++-- mfbt/tests/TestMaybe.cpp | 6 +- mfbt/tests/TestNotNull.cpp | 2 +- mfbt/tests/gtest/TestSpan.cpp | 50 ++++---- .../geckoview/GeckoViewInputStream.h | 2 +- modules/libmar/src/mar_read.c | 3 +- .../core/shared-libraries-linux.cc | 3 +- .../core/shared-libraries-win32.cc | 3 +- mozglue/misc/TimeStamp_darwin.cpp | 3 +- mozglue/misc/TimeStamp_posix.cpp | 17 +-- mozglue/misc/TimeStamp_windows.cpp | 3 +- mozglue/misc/WindowsDpiAwareness.h | 6 +- mozglue/misc/WindowsUnwindInfo.h | 2 +- netwerk/dns/DNSAdditionalInfo.h | 2 +- netwerk/dns/HTTPSSVC.cpp | 2 +- netwerk/protocol/http/nsAHttpTransaction.h | 2 +- .../converters/mozTXTToHTMLConv.cpp | 8 +- netwerk/wifi/freebsd/FreeBsdWifiScanner.cpp | 4 +- parser/html/nsHtml5String.h | 2 +- parser/html/nsHtml5TreeOperation.h | 16 +-- parser/htmlparser/nsExpatDriver.cpp | 2 +- parser/htmlparser/nsParser.cpp | 2 +- testing/gtest/mozilla/WaitFor.h | 4 +- testing/mochitest/ssltunnel/ssltunnel.cpp | 6 +- .../BounceTrackingProtectionStorage.h | 2 +- .../components/ctypes/tests/jsctypes-test.cpp | 3 +- .../components/mediasniffer/nsMediaSniffer.h | 7 +- .../places/tests/gtest/places_test_harness.h | 3 +- .../components/telemetry/core/Telemetry.cpp | 3 +- .../telemetry/core/TelemetryScalar.cpp | 2 +- .../pingsender/pingsender_unix_common.cpp | 22 ++-- .../mozapps/update/updater/launchchild_osx.mm | 3 +- .../nsAndroidSystemProxySettings.cpp | 4 +- .../WindowsNetworkFunctionsWrapper.h | 4 +- .../windowsDHCPClient/nsWindowsDHCPClient.h | 4 +- .../nsWindowsPackageManager.h | 2 +- .../nsWindowsSystemProxySettings.cpp | 4 +- .../dllservices/tests/TestDllInterceptor.cpp | 4 +- .../tests/gtest/TestDLLBlocklist.cpp | 2 +- toolkit/xre/nsNativeAppSupportUnix.cpp | 4 +- tools/jprof/leaky.cpp | 3 +- tools/jprof/stub/libmalloc.cpp | 2 +- tools/profiler/core/PowerCounters.h | 4 +- tools/profiler/core/ProfilerCPUFreq.h | 6 +- tools/profiler/core/shared-libraries-linux.cc | 3 +- tools/profiler/core/shared-libraries-win32.cc | 3 +- tools/profiler/public/ETWTools.h | 4 +- .../tests/gtest/LulTestInfrastructure.h | 2 +- .../exthandler/mac/nsDecodeAppleFile.cpp | 3 +- .../exthandler/nsOSHelperAppServiceChild.h | 2 +- widget/android/jni/Natives.h | 9 +- widget/gtk/DBusMenu.cpp | 5 +- widget/gtk/DMABufSurface.h | 2 +- widget/gtk/WaylandBuffer.h | 2 +- widget/gtk/nsNativeThemeGTK.cpp | 5 +- widget/gtk/nsSound.cpp | 2 +- widget/gtk/nsUserIdleServiceGTK.cpp | 4 +- widget/gtk/nsUserIdleServiceGTK.h | 2 +- widget/gtk/vaapitest/vaapitest.cpp | 3 +- widget/headless/HeadlessLookAndFeel.h | 2 +- widget/tests/gtest/TestTimeConverter.cpp | 7 +- widget/windows/ScreenHelperWin.h | 2 +- widget/windows/nsNativeThemeWin.cpp | 5 +- widget/windows/nsWindowDbg.cpp | 3 +- .../tests/gtest/TestJumpListBuilder.cpp | 2 +- xpcom/base/AvailableMemoryWatcher.h | 4 +- xpcom/base/AvailableMemoryWatcherMac.cpp | 2 +- xpcom/base/RLBoxSandboxPool.h | 2 +- xpcom/base/nsDebugImpl.cpp | 2 + xpcom/base/nsDumpUtils.h | 2 +- xpcom/base/nsMacPreferencesReader.h | 2 +- xpcom/base/nsMemoryReporterManager.cpp | 2 + xpcom/build/perfprobe.h | 2 +- xpcom/ds/PLDHashTable.h | 4 +- xpcom/ds/Tokenizer.cpp | 2 +- xpcom/ds/nsExpirationTracker.h | 4 +- xpcom/ds/nsTArray.h | 24 ++-- xpcom/ds/nsTHashtable.h | 8 +- xpcom/string/nsTSubstring.cpp | 14 +-- xpcom/tests/TestStreamUtils.cpp | 3 +- xpcom/tests/gtest/TestExpirationTracker.cpp | 3 +- xpcom/tests/gtest/TestMozPromise.cpp | 4 +- xpcom/tests/gtest/TestTArray2.cpp | 19 ++- xpcom/tests/gtest/TestThreadUtils.cpp | 2 +- xpcom/threads/MozPromise.h | 8 +- xpcom/threads/nsIIdleRunnable.h | 2 +- xpcom/threads/nsTimerImpl.cpp | 2 +- 213 files changed, 524 insertions(+), 608 deletions(-) diff --git a/accessible/atk/nsStateMap.h b/accessible/atk/nsStateMap.h index 3587ccd6cfd9..a325fc353cc5 100644 --- a/accessible/atk/nsStateMap.h +++ b/accessible/atk/nsStateMap.h @@ -53,10 +53,11 @@ struct AtkStateMap { }; // Map array from cross platform states to ATK states -static const AtkStateMap gAtkStateMap[] = - { - // Cross Platform States - // clang-format off +static const AtkStateMap + gAtkStateMap[] = + { + // Cross Platform States + // clang-format off { kNone, kMapOpposite }, // states::UNAVAILABLE = 1 << 0 { ATK_STATE_SELECTED, kMapDirectly }, // states::SELECTED = 1 << 1 { ATK_STATE_FOCUSED, kMapDirectly }, // states::FOCUSED = 1 << 2 @@ -106,7 +107,7 @@ static const AtkStateMap gAtkStateMap[] = { ATK_STATE_EXPANDABLE, kMapDirectly }, // states::EXPANDABLE = 1 << 46 { kNone, kMapDirectly }, // states::PINNED = 1 << 47 { ATK_STATE_ACTIVE, kMapDirectly } // states::CURRENT = 1 << 48 - // clang-format on + // clang-format on }; static const auto gAtkStateMapLen = std::extent::value; diff --git a/accessible/base/EventQueue.cpp b/accessible/base/EventQueue.cpp index 8a5e22cd480d..0b535029e7b7 100644 --- a/accessible/base/EventQueue.cpp +++ b/accessible/base/EventQueue.cpp @@ -231,7 +231,7 @@ void EventQueue::CoalesceEvents() { default: break; // case eAllowDupes, eDoNotEmit - } // switch + } // switch } void EventQueue::CoalesceSelChangeEvents(AccSelChangeEvent* aTailEvent, diff --git a/accessible/base/TextAttrs.h b/accessible/base/TextAttrs.h index 031e11427395..f07622186890 100644 --- a/accessible/base/TextAttrs.h +++ b/accessible/base/TextAttrs.h @@ -211,7 +211,7 @@ class TextAttrsMgr { class InvalidTextAttr : public TTextAttr { public: InvalidTextAttr(nsIContent* aRootElm, nsIContent* aElm); - virtual ~InvalidTextAttr(){}; + virtual ~InvalidTextAttr() {}; protected: enum { eFalse, eGrammar, eSpelling, eTrue }; diff --git a/accessible/base/nsAccessibilityService.cpp b/accessible/base/nsAccessibilityService.cpp index a6417b463643..08e53f3182dd 100644 --- a/accessible/base/nsAccessibilityService.cpp +++ b/accessible/base/nsAccessibilityService.cpp @@ -372,14 +372,13 @@ static int32_t sPlatformDisabledState = 0; //////////////////////////////////////////////////////////////////////////////// // Markup maps array. -#define Attr(name, value) \ - { nsGkAtoms::name, nsGkAtoms::value } +#define Attr(name, value) {nsGkAtoms::name, nsGkAtoms::value} #define AttrFromDOM(name, DOMAttrName) \ - { nsGkAtoms::name, nullptr, nsGkAtoms::DOMAttrName } + {nsGkAtoms::name, nullptr, nsGkAtoms::DOMAttrName} #define AttrFromDOMIf(name, DOMAttrName, DOMAttrValue) \ - { nsGkAtoms::name, nullptr, nsGkAtoms::DOMAttrName, nsGkAtoms::DOMAttrValue } + {nsGkAtoms::name, nullptr, nsGkAtoms::DOMAttrName, nsGkAtoms::DOMAttrValue} #define MARKUPMAP(atom, new_func, r, ...) \ {nsGkAtoms::atom, new_func, static_cast(r), {__VA_ARGS__}}, diff --git a/accessible/mac/RotorRules.mm b/accessible/mac/RotorRules.mm index 07f8479161ff..ef7b2f01c0fa 100644 --- a/accessible/mac/RotorRules.mm +++ b/accessible/mac/RotorRules.mm @@ -77,10 +77,10 @@ uint16_t RotorRule::Match(Accessible* aAcc) { RotorRoleRule::RotorRoleRule(role aRole, Accessible* aDirectDescendantsFrom, const nsString& aSearchText) - : RotorRule(aDirectDescendantsFrom, aSearchText), mRole(aRole){}; + : RotorRule(aDirectDescendantsFrom, aSearchText), mRole(aRole) {}; RotorRoleRule::RotorRoleRule(role aRole, const nsString& aSearchText) - : RotorRule(aSearchText), mRole(aRole){}; + : RotorRule(aSearchText), mRole(aRole) {}; uint16_t RotorRoleRule::Match(Accessible* aAcc) { uint16_t result = RotorRule::Match(aAcc); @@ -135,10 +135,10 @@ uint16_t RotorMacRoleRule::Match(Accessible* aAcc) { RotorControlRule::RotorControlRule(Accessible* aDirectDescendantsFrom, const nsString& aSearchText) - : RotorRule(aDirectDescendantsFrom, aSearchText){}; + : RotorRule(aDirectDescendantsFrom, aSearchText) {}; RotorControlRule::RotorControlRule(const nsString& aSearchText) - : RotorRule(aSearchText){}; + : RotorRule(aSearchText) {}; uint16_t RotorControlRule::Match(Accessible* aAcc) { uint16_t result = RotorRule::Match(aAcc); @@ -207,10 +207,10 @@ uint16_t RotorControlRule::Match(Accessible* aAcc) { RotorTextEntryRule::RotorTextEntryRule(Accessible* aDirectDescendantsFrom, const nsString& aSearchText) - : RotorRule(aDirectDescendantsFrom, aSearchText){}; + : RotorRule(aDirectDescendantsFrom, aSearchText) {}; RotorTextEntryRule::RotorTextEntryRule(const nsString& aSearchText) - : RotorRule(aSearchText){}; + : RotorRule(aSearchText) {}; uint16_t RotorTextEntryRule::Match(Accessible* aAcc) { uint16_t result = RotorRule::Match(aAcc); @@ -232,10 +232,10 @@ uint16_t RotorTextEntryRule::Match(Accessible* aAcc) { RotorLinkRule::RotorLinkRule(Accessible* aDirectDescendantsFrom, const nsString& aSearchText) - : RotorRule(aDirectDescendantsFrom, aSearchText){}; + : RotorRule(aDirectDescendantsFrom, aSearchText) {}; RotorLinkRule::RotorLinkRule(const nsString& aSearchText) - : RotorRule(aSearchText){}; + : RotorRule(aSearchText) {}; uint16_t RotorLinkRule::Match(Accessible* aAcc) { uint16_t result = RotorRule::Match(aAcc); @@ -325,10 +325,10 @@ uint16_t RotorNotMacRoleRule::Match(Accessible* aAcc) { RotorStaticTextRule::RotorStaticTextRule(Accessible* aDirectDescendantsFrom, const nsString& aSearchText) - : RotorRule(aDirectDescendantsFrom, aSearchText){}; + : RotorRule(aDirectDescendantsFrom, aSearchText) {}; RotorStaticTextRule::RotorStaticTextRule(const nsString& aSearchText) - : RotorRule(aSearchText){}; + : RotorRule(aSearchText) {}; uint16_t RotorStaticTextRule::Match(Accessible* aAcc) { uint16_t result = RotorRule::Match(aAcc); @@ -353,11 +353,11 @@ RotorHeadingLevelRule::RotorHeadingLevelRule(int32_t aLevel, Accessible* aDirectDescendantsFrom, const nsString& aSearchText) : RotorRoleRule(roles::HEADING, aDirectDescendantsFrom, aSearchText), - mLevel(aLevel){}; + mLevel(aLevel) {}; RotorHeadingLevelRule::RotorHeadingLevelRule(int32_t aLevel, const nsString& aSearchText) - : RotorRoleRule(roles::HEADING, aSearchText), mLevel(aLevel){}; + : RotorRoleRule(roles::HEADING, aSearchText), mLevel(aLevel) {}; uint16_t RotorHeadingLevelRule::Match(Accessible* aAcc) { uint16_t result = RotorRoleRule::Match(aAcc); diff --git a/accessible/windows/sdn/sdnDocAccessible.h b/accessible/windows/sdn/sdnDocAccessible.h index 452b43ec8511..1697e5fbee8d 100644 --- a/accessible/windows/sdn/sdnDocAccessible.h +++ b/accessible/windows/sdn/sdnDocAccessible.h @@ -17,8 +17,8 @@ namespace a11y { class sdnDocAccessible final : public ISimpleDOMDocument { public: - explicit sdnDocAccessible(MsaaDocAccessible* aMsaa) : mMsaa(aMsaa){}; - ~sdnDocAccessible(){}; + explicit sdnDocAccessible(MsaaDocAccessible* aMsaa) : mMsaa(aMsaa) {}; + ~sdnDocAccessible() {}; DECL_IUNKNOWN diff --git a/accessible/windows/sdn/sdnTextAccessible.h b/accessible/windows/sdn/sdnTextAccessible.h index 3f93c20fcc95..e175fc35d043 100644 --- a/accessible/windows/sdn/sdnTextAccessible.h +++ b/accessible/windows/sdn/sdnTextAccessible.h @@ -20,7 +20,7 @@ namespace a11y { class sdnTextAccessible final : public ISimpleDOMText { public: - explicit sdnTextAccessible(MsaaAccessible* aMsaa) : mMsaa(aMsaa){}; + explicit sdnTextAccessible(MsaaAccessible* aMsaa) : mMsaa(aMsaa) {}; ~sdnTextAccessible() {} DECL_IUNKNOWN diff --git a/accessible/xul/XULMenuAccessible.cpp b/accessible/xul/XULMenuAccessible.cpp index 6628304a9efc..a7622cbdd4fb 100644 --- a/accessible/xul/XULMenuAccessible.cpp +++ b/accessible/xul/XULMenuAccessible.cpp @@ -103,8 +103,8 @@ uint64_t XULMenuitemAccessible::NativeState() const { (grandParentState & states::INVISIBLE) | (grandParentState & states::OPAQUE1); } // isCollapsed - } // isSelected - } // ROLE_COMBOBOX_OPTION + } // isSelected + } // ROLE_COMBOBOX_OPTION return state; } diff --git a/browser/app/winlauncher/freestanding/LoaderPrivateAPI.cpp b/browser/app/winlauncher/freestanding/LoaderPrivateAPI.cpp index fb65a2d40530..15dc91c64490 100644 --- a/browser/app/winlauncher/freestanding/LoaderPrivateAPI.cpp +++ b/browser/app/winlauncher/freestanding/LoaderPrivateAPI.cpp @@ -17,8 +17,9 @@ using GlobalInitializerFn = void(__cdecl*)(void); // Allocation of static initialization section for the freestanding library #pragma section(".freestd$a", read) -__declspec(allocate(".freestd$a")) static const GlobalInitializerFn - FreeStdStart = reinterpret_cast(0); +__declspec(allocate( + ".freestd$a")) static const GlobalInitializerFn FreeStdStart = + reinterpret_cast(0); #pragma section(".freestd$z", read) __declspec(allocate(".freestd$z")) static const GlobalInitializerFn FreeStdEnd = diff --git a/browser/components/migration/nsKeychainMigrationUtils.h b/browser/components/migration/nsKeychainMigrationUtils.h index 343c24086e15..9d3695b4732c 100644 --- a/browser/components/migration/nsKeychainMigrationUtils.h +++ b/browser/components/migration/nsKeychainMigrationUtils.h @@ -14,10 +14,10 @@ class nsKeychainMigrationUtils : public nsIKeychainMigrationUtils { NS_DECL_ISUPPORTS NS_DECL_NSIKEYCHAINMIGRATIONUTILS - nsKeychainMigrationUtils(){}; + nsKeychainMigrationUtils() {}; protected: - virtual ~nsKeychainMigrationUtils(){}; + virtual ~nsKeychainMigrationUtils() {}; }; #endif diff --git a/browser/components/shell/nsGNOMEShellSearchProvider.cpp b/browser/components/shell/nsGNOMEShellSearchProvider.cpp index b894254fce0e..955790921290 100644 --- a/browser/components/shell/nsGNOMEShellSearchProvider.cpp +++ b/browser/components/shell/nsGNOMEShellSearchProvider.cpp @@ -70,7 +70,7 @@ class AsyncFaviconDataReady final : public nsIFaviconDataCallback { int aIconIndex, int aTimeStamp) : mSearchResult(std::move(aSearchResult)), mIconIndex(aIconIndex), - mTimeStamp(aTimeStamp){}; + mTimeStamp(aTimeStamp) {}; private: ~AsyncFaviconDataReady() {} diff --git a/browser/components/shell/nsGNOMEShellSearchProvider.h b/browser/components/shell/nsGNOMEShellSearchProvider.h index ce215183fcb3..93620288e745 100644 --- a/browser/components/shell/nsGNOMEShellSearchProvider.h +++ b/browser/components/shell/nsGNOMEShellSearchProvider.h @@ -23,7 +23,7 @@ class nsGNOMEShellSearchProvider; class GnomeHistoryIcon { public: - GnomeHistoryIcon() : mTimeStamp(-1), mWidth(0), mHeight(0){}; + GnomeHistoryIcon() : mTimeStamp(-1), mWidth(0), mHeight(0) {}; // From which search is this icon void Set(int aTimeStamp, mozilla::UniquePtr aData, int aWidth, @@ -58,7 +58,7 @@ class nsGNOMEShellHistorySearchResult : public nsUnixRemoteServer { GDBusConnection* aConnection, int aTimeStamp) : mSearchProvider(aSearchProvider), mConnection(aConnection), - mTimeStamp(aTimeStamp){}; + mTimeStamp(aTimeStamp) {}; void SetReply(RefPtr aReply) { mReply = std::move(aReply); diff --git a/browser/components/shell/nsMacShellService.h b/browser/components/shell/nsMacShellService.h index bb08c72b4e48..abc82adcfdc6 100644 --- a/browser/components/shell/nsMacShellService.h +++ b/browser/components/shell/nsMacShellService.h @@ -16,7 +16,7 @@ class nsMacShellService : public nsIMacShellService, public nsToolkitShellService, public nsIWebProgressListener { public: - nsMacShellService(){}; + nsMacShellService() {}; NS_DECL_ISUPPORTS NS_DECL_NSISHELLSERVICE @@ -24,7 +24,7 @@ class nsMacShellService : public nsIMacShellService, NS_DECL_NSIWEBPROGRESSLISTENER protected: - virtual ~nsMacShellService(){}; + virtual ~nsMacShellService() {}; private: nsCOMPtr mBackgroundFile; diff --git a/build/unix/elfhack/elf.cpp b/build/unix/elfhack/elf.cpp index b2a21e49010f..27c6e02fefff 100644 --- a/build/unix/elfhack/elf.cpp +++ b/build/unix/elfhack/elf.cpp @@ -593,8 +593,7 @@ int ElfSection::getIndex() { ElfSection* reference; for (reference = previous; (reference != nullptr) && (reference->getType() == SHT_NULL); - reference = reference->getPrevious()) - ; + reference = reference->getPrevious()); if (reference == nullptr) return (index = 1); return (index = reference->getIndex() + 1); } @@ -644,8 +643,7 @@ unsigned int ElfSegment::getFileSize() { // Search the last section that is not SHT_NOBITS std::list::reverse_iterator i; for (i = sections.rbegin(); - (i != sections.rend()) && ((*i)->getType() == SHT_NOBITS); ++i) - ; + (i != sections.rend()) && ((*i)->getType() == SHT_NOBITS); ++i); // All sections are SHT_NOBITS if (i == sections.rend()) return 0; diff --git a/build/unix/elfhack/elfxx.h b/build/unix/elfhack/elfxx.h index 26dce9b9cd31..a9354185887f 100644 --- a/build/unix/elfhack/elfxx.h +++ b/build/unix/elfhack/elfxx.h @@ -136,7 +136,7 @@ class ElfPlainValue : public ElfValue { unsigned int value; public: - ElfPlainValue(unsigned int val) : value(val){}; + ElfPlainValue(unsigned int val) : value(val) {}; unsigned int getValue() { return value; } }; @@ -146,7 +146,7 @@ class ElfLocation : public ElfValue { public: enum position { ABSOLUTE, RELATIVE }; - ElfLocation() : section(nullptr), offset(0){}; + ElfLocation() : section(nullptr), offset(0) {}; ElfLocation(ElfSection* section, unsigned int off, enum position pos = RELATIVE); ElfLocation(unsigned int location, Elf* elf); @@ -159,7 +159,7 @@ class ElfSize : public ElfValue { ElfSection* section; public: - ElfSize(ElfSection* s) : section(s){}; + ElfSize(ElfSection* s) : section(s) {}; unsigned int getValue(); ElfSection* getSection() { return section; } }; @@ -168,7 +168,7 @@ class ElfEntSize : public ElfValue { ElfSection* section; public: - ElfEntSize(ElfSection* s) : section(s){}; + ElfEntSize(ElfSection* s) : section(s) {}; unsigned int getValue(); ElfSection* getSection() { return section; } }; @@ -176,8 +176,8 @@ class ElfEntSize : public ElfValue { template class serializable : public T::Type64 { public: - serializable(){}; - serializable(const typename T::Type64& p) : T::Type64(p){}; + serializable() {}; + serializable(const typename T::Type64& p) : T::Type64(p) {}; private: template @@ -493,9 +493,9 @@ class Elf_Ehdr : public serializable, public ElfSection { class Elf_Phdr : public serializable { public: - Elf_Phdr(){}; + Elf_Phdr() {}; Elf_Phdr(std::ifstream& file, unsigned char ei_class, unsigned char ei_data) - : serializable(file, ei_class, ei_data){}; + : serializable(file, ei_class, ei_data) {}; bool contains(ElfSection* section) { unsigned int size = section->getSize(); unsigned int addr = section->getAddr(); @@ -563,10 +563,10 @@ class ElfSymtab_Section : public ElfSection { class Elf_Rel : public serializable { public: - Elf_Rel() : serializable(){}; + Elf_Rel() : serializable() {}; Elf_Rel(std::ifstream& file, unsigned char ei_class, unsigned char ei_data) - : serializable(file, ei_class, ei_data){}; + : serializable(file, ei_class, ei_data) {}; static const unsigned int sh_type = SHT_REL; static const unsigned int d_tag = DT_REL; @@ -575,10 +575,10 @@ class Elf_Rel : public serializable { class Elf_Rela : public serializable { public: - Elf_Rela() : serializable(){}; + Elf_Rela() : serializable() {}; Elf_Rela(std::ifstream& file, unsigned char ei_class, unsigned char ei_data) - : serializable(file, ei_class, ei_data){}; + : serializable(file, ei_class, ei_data) {}; static const unsigned int sh_type = SHT_RELA; static const unsigned int d_tag = DT_RELA; @@ -654,8 +654,7 @@ inline unsigned char Elf::getMachine() { return ehdr->e_machine; } inline unsigned int Elf::getSize() { ElfSection* section; for (section = shdr_section /* It's usually not far from the end */; - section->getNext() != nullptr; section = section->getNext()) - ; + section->getNext() != nullptr; section = section->getNext()); return section->getOffset() + section->getSize(); } diff --git a/config/nsinstall.c b/config/nsinstall.c index 363ae3eefdf4..675c733dba68 100644 --- a/config/nsinstall.c +++ b/config/nsinstall.c @@ -73,8 +73,7 @@ static int mkdirs(char* path, mode_t mode) { if (l > 1 && path[l - 1] == '.' && path[l - 2] == '/') path[l - 2] = 0; while (*path == '/' && path[1] == '/') path++; - for (cp = strrchr(path, '/'); cp && cp != path && *(cp - 1) == '/'; cp--) - ; + for (cp = strrchr(path, '/'); cp && cp != path && *(cp - 1) == '/'; cp--); if (cp && cp != path) { *cp = '\0'; if ((lstat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) && diff --git a/devtools/shared/heapsnapshot/AutoMemMap.h b/devtools/shared/heapsnapshot/AutoMemMap.h index f67dacf0df27..d8410d713d67 100644 --- a/devtools/shared/heapsnapshot/AutoMemMap.h +++ b/devtools/shared/heapsnapshot/AutoMemMap.h @@ -47,7 +47,7 @@ class MOZ_RAII AutoMemMap { public: explicit AutoMemMap() - : fileSize(0), fd(nullptr), fileMap(nullptr), addr(nullptr){}; + : fileSize(0), fd(nullptr), fileMap(nullptr), addr(nullptr) {}; ~AutoMemMap(); // Initialize this AutoMemMap. diff --git a/devtools/shared/heapsnapshot/DeserializedNode.h b/devtools/shared/heapsnapshot/DeserializedNode.h index cc831b4dc574..569d673e03cb 100644 --- a/devtools/shared/heapsnapshot/DeserializedNode.h +++ b/devtools/shared/heapsnapshot/DeserializedNode.h @@ -201,7 +201,7 @@ struct DeserializedStackFrame { functionDisplayName(nullptr), isSystem(false), isSelfHosted(false), - owner(nullptr){}; + owner(nullptr) {}; }; struct DeserializedStackFrame::HashPolicy { diff --git a/devtools/shared/heapsnapshot/HeapSnapshot.h b/devtools/shared/heapsnapshot/HeapSnapshot.h index a23fdc2c8610..f7877d8e4a40 100644 --- a/devtools/shared/heapsnapshot/HeapSnapshot.h +++ b/devtools/shared/heapsnapshot/HeapSnapshot.h @@ -173,7 +173,7 @@ class HeapSnapshot final : public nsISupports, public nsWrapperCache { // serializes it to disk, or memory, or a socket, etc. class CoreDumpWriter { public: - virtual ~CoreDumpWriter(){}; + virtual ~CoreDumpWriter() {}; // Write the given bits of metadata we would like to associate with this core // dump. diff --git a/docshell/base/SyncedContext.h b/docshell/base/SyncedContext.h index 679e07edc29a..e59d743913b5 100644 --- a/docshell/base/SyncedContext.h +++ b/docshell/base/SyncedContext.h @@ -317,7 +317,7 @@ using FieldSetterType = typename GetFieldSetterType::SetterArg; * remove fields of the wrong size. */ \ template \ struct Fields : eachfield(MOZ_DECL_SYNCED_FIELD_INHERIT) \ - syncedcontext::Empty {}; \ + syncedcontext::Empty{}; \ \ /* Struct containing the data for all synced fields as members. We filter \ * sizes to lay out fields of size 1, then 2, then 4 and last 8 or greater. \ diff --git a/docshell/base/nsIScrollObserver.h b/docshell/base/nsIScrollObserver.h index 9ff89002f002..165e3d64154d 100644 --- a/docshell/base/nsIScrollObserver.h +++ b/docshell/base/nsIScrollObserver.h @@ -31,13 +31,13 @@ class nsIScrollObserver : public nsISupports { * Called when an async panning/zooming transform has started being applied * and passed the scroll offset */ - MOZ_CAN_RUN_SCRIPT virtual void AsyncPanZoomStarted(){}; + MOZ_CAN_RUN_SCRIPT virtual void AsyncPanZoomStarted() {}; /** * Called when an async panning/zooming transform is no longer applied * and passed the scroll offset */ - MOZ_CAN_RUN_SCRIPT virtual void AsyncPanZoomStopped(){}; + MOZ_CAN_RUN_SCRIPT virtual void AsyncPanZoomStopped() {}; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIScrollObserver, NS_ISCROLLOBSERVER_IID) diff --git a/dom/base/ResponsiveImageSelector.cpp b/dom/base/ResponsiveImageSelector.cpp index e02561b1d739..e6579bf1d64f 100644 --- a/dom/base/ResponsiveImageSelector.cpp +++ b/dom/base/ResponsiveImageSelector.cpp @@ -50,8 +50,7 @@ static bool ParseFloat(const nsAString& aString, double& aDouble) { } if (IsAsciiDigit(*iter)) { - for (; iter != end && IsAsciiDigit(*iter); ++iter) - ; + for (; iter != end && IsAsciiDigit(*iter); ++iter); } else if (*iter == char16_t('.')) { // Do nothing, jumps to fraction part } else { @@ -67,8 +66,7 @@ static bool ParseFloat(const nsAString& aString, double& aDouble) { return false; } - for (; iter != end && IsAsciiDigit(*iter); ++iter) - ; + for (; iter != end && IsAsciiDigit(*iter); ++iter); } if (iter != end && (*iter == char16_t('e') || *iter == char16_t('E'))) { @@ -82,8 +80,7 @@ static bool ParseFloat(const nsAString& aString, double& aDouble) { return false; } - for (; iter != end && IsAsciiDigit(*iter); ++iter) - ; + for (; iter != end && IsAsciiDigit(*iter); ++iter); } if (iter != end) { @@ -118,8 +115,7 @@ void ResponsiveImageSelector::ParseSourceSet( // Extra commas at this point are a non-fatal syntax error. for (; iter != end && (nsContentUtils::IsHTMLWhitespace(*iter) || *iter == char16_t(',')); - ++iter) - ; + ++iter); if (iter == end) { break; @@ -128,8 +124,7 @@ void ResponsiveImageSelector::ParseSourceSet( url = iter; // Find end of url - for (; iter != end && !nsContentUtils::IsHTMLWhitespace(*iter); ++iter) - ; + for (; iter != end && !nsContentUtils::IsHTMLWhitespace(*iter); ++iter); // Omit trailing commas from URL. // Multiple commas are a non-fatal error. @@ -476,7 +471,7 @@ void ResponsiveImageCandidate::SetParameterAsDensity(double aDensity) { // there is no candidate type that uses all of these. This should generally // match the mValue union of ResponsiveImageCandidate. struct ResponsiveImageDescriptors { - ResponsiveImageDescriptors() : mInvalid(false){}; + ResponsiveImageDescriptors() : mInvalid(false) {}; Maybe mDensity; Maybe mWidth; @@ -603,8 +598,7 @@ bool ResponsiveImageCandidate::ConsumeDescriptors( // https://html.spec.whatwg.org/#parse-a-srcset-attribute // Skip initial whitespace - for (; iter != end && nsContentUtils::IsHTMLWhitespace(*iter); ++iter) - ; + for (; iter != end && nsContentUtils::IsHTMLWhitespace(*iter); ++iter); nsAString::const_iterator currentDescriptor = iter; @@ -628,8 +622,7 @@ bool ResponsiveImageCandidate::ConsumeDescriptors( // End of current descriptor, consume it, skip spaces // ("After descriptor" state in spec) before continuing descriptors.AddDescriptor(Substring(currentDescriptor, iter)); - for (; iter != end && nsContentUtils::IsHTMLWhitespace(*iter); ++iter) - ; + for (; iter != end && nsContentUtils::IsHTMLWhitespace(*iter); ++iter); if (iter == end) { break; } diff --git a/dom/base/TreeWalker.cpp b/dom/base/TreeWalker.cpp index e7a39dff1344..19360ee96180 100644 --- a/dom/base/TreeWalker.cpp +++ b/dom/base/TreeWalker.cpp @@ -27,8 +27,7 @@ TreeWalker::TreeWalker(nsINode* aRoot, uint32_t aWhatToShow, NodeFilter* aFilter) : nsTraversal(aRoot, aWhatToShow, aFilter), mCurrentNode(aRoot) {} -TreeWalker::~TreeWalker() { /* destructor code */ -} +TreeWalker::~TreeWalker() { /* destructor code */ } /* * nsISupports and cycle collection stuff diff --git a/dom/base/nsTraversal.cpp b/dom/base/nsTraversal.cpp index 33582a5e8d17..0709df0c02cf 100644 --- a/dom/base/nsTraversal.cpp +++ b/dom/base/nsTraversal.cpp @@ -25,8 +25,7 @@ nsTraversal::nsTraversal(nsINode* aRoot, uint32_t aWhatToShow, NS_ASSERTION(aRoot, "invalid root in call to nsTraversal constructor"); } -nsTraversal::~nsTraversal() { /* destructor code */ -} +nsTraversal::~nsTraversal() { /* destructor code */ } /* * Tests if and how a node should be filtered. Uses mWhatToShow and diff --git a/dom/cache/ActorChild.h b/dom/cache/ActorChild.h index e7d375173d2c..8bb206b52b2d 100644 --- a/dom/cache/ActorChild.h +++ b/dom/cache/ActorChild.h @@ -16,8 +16,7 @@ class CacheWorkerRef; class ActorChild { public: virtual void StartDestroy() = 0; - virtual void NoteDeletedActor() { /*no-op*/ - } + virtual void NoteDeletedActor() { /*no-op*/ } void SetWorkerRef(SafeRefPtr aWorkerRef); diff --git a/dom/fetch/FetchDriver.h b/dom/fetch/FetchDriver.h index 36dd5fb3dd0b..62fc251a2ecd 100644 --- a/dom/fetch/FetchDriver.h +++ b/dom/fetch/FetchDriver.h @@ -61,7 +61,7 @@ class FetchDriverObserver { }; virtual void OnResponseEnd(EndReason aReason, - JS::Handle aReasonDetails){}; + JS::Handle aReasonDetails) {}; nsIConsoleReportCollector* GetReporter() const { return mReporter; } diff --git a/dom/filesystem/GetFilesHelper.h b/dom/filesystem/GetFilesHelper.h index 2b15e6905996..e22e545de6ad 100644 --- a/dom/filesystem/GetFilesHelper.h +++ b/dom/filesystem/GetFilesHelper.h @@ -89,7 +89,7 @@ class GetFilesHelper : public Runnable, public GetFilesHelperBase { virtual void Work(ErrorResult& aRv); - virtual void Cancel(){}; + virtual void Cancel() {}; NS_IMETHOD Run() override; diff --git a/dom/html/HTMLMediaElement.h b/dom/html/HTMLMediaElement.h index 2065796b08b5..573774baf4b9 100644 --- a/dom/html/HTMLMediaElement.h +++ b/dom/html/HTMLMediaElement.h @@ -1806,7 +1806,7 @@ class HTMLMediaElement : public nsGenericHTMLElement, already_AddRefed CreatePlayPromise(ErrorResult& aRv) const; - virtual void MaybeBeginCloningVisually(){}; + virtual void MaybeBeginCloningVisually() {}; uint32_t GetPreloadDefault() const; uint32_t GetPreloadDefaultAuto() const; diff --git a/dom/html/HTMLTableCellElement.cpp b/dom/html/HTMLTableCellElement.cpp index c260323a8bd8..32eec1a8e9de 100644 --- a/dom/html/HTMLTableCellElement.cpp +++ b/dom/html/HTMLTableCellElement.cpp @@ -186,9 +186,7 @@ void HTMLTableCellElement::MapAttributesIntoRule( NS_IMETHODIMP_(bool) HTMLTableCellElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - {nsGkAtoms::align}, - {nsGkAtoms::valign}, - {nsGkAtoms::nowrap}, + {nsGkAtoms::align}, {nsGkAtoms::valign}, {nsGkAtoms::nowrap}, #if 0 // XXXldb If these are implemented, they might need to move to // GetAttributeChangeHint (depending on how, and preferably not). @@ -197,10 +195,7 @@ HTMLTableCellElement::IsAttributeMapped(const nsAtom* aAttribute) const { { nsGkAtoms::headers }, { nsGkAtoms::scope }, #endif - {nsGkAtoms::width}, - {nsGkAtoms::height}, - {nullptr} - }; + {nsGkAtoms::width}, {nsGkAtoms::height}, {nullptr}}; static const MappedAttributeEntry* const map[] = { attributes, diff --git a/dom/l10n/DOMLocalization.cpp b/dom/l10n/DOMLocalization.cpp index b4fcf149c6d7..1e1078c44220 100644 --- a/dom/l10n/DOMLocalization.cpp +++ b/dom/l10n/DOMLocalization.cpp @@ -214,7 +214,7 @@ class ElementTranslationHandler : public PromiseNativeHandler { public: explicit ElementTranslationHandler(DOMLocalization* aDOMLocalization, nsXULPrototypeDocument* aProto) - : mDOMLocalization(aDOMLocalization), mProto(aProto){}; + : mDOMLocalization(aDOMLocalization), mProto(aProto) {}; NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS(ElementTranslationHandler) diff --git a/dom/locks/LockRequestParent.h b/dom/locks/LockRequestParent.h index cdb4fc112740..b0ff1b03fe16 100644 --- a/dom/locks/LockRequestParent.h +++ b/dom/locks/LockRequestParent.h @@ -18,7 +18,7 @@ class LockRequestParent final : public PLockRequestParent { NS_INLINE_DECL_REFCOUNTING(LockRequestParent) explicit LockRequestParent(const IPCLockRequest& aRequest) - : mRequest(aRequest){}; + : mRequest(aRequest) {}; const IPCLockRequest& Data() { return mRequest; } diff --git a/dom/media/DOMMediaStream.h b/dom/media/DOMMediaStream.h index bfce7b65f02f..05056b6c3625 100644 --- a/dom/media/DOMMediaStream.h +++ b/dom/media/DOMMediaStream.h @@ -68,33 +68,33 @@ class DOMMediaStream : public DOMEventTargetHelper, * Called when the DOMMediaStream has a live track added, either by * script (addTrack()) or the source creating one. */ - virtual void NotifyTrackAdded(const RefPtr& aTrack){}; + virtual void NotifyTrackAdded(const RefPtr& aTrack) {}; /** * Called when the DOMMediaStream removes a live track from playback, either * by script (removeTrack(), track.stop()) or the source ending it. */ - virtual void NotifyTrackRemoved(const RefPtr& aTrack){}; + virtual void NotifyTrackRemoved(const RefPtr& aTrack) {}; /** * Called when the DOMMediaStream has become active. */ - virtual void NotifyActive(){}; + virtual void NotifyActive() {}; /** * Called when the DOMMediaStream has become inactive. */ - virtual void NotifyInactive(){}; + virtual void NotifyInactive() {}; /** * Called when the DOMMediaStream has become audible. */ - virtual void NotifyAudible(){}; + virtual void NotifyAudible() {}; /** * Called when the DOMMediaStream has become inaudible. */ - virtual void NotifyInaudible(){}; + virtual void NotifyInaudible() {}; protected: virtual ~TrackListener() = default; diff --git a/dom/media/GraphRunner.cpp b/dom/media/GraphRunner.cpp index eef05c6fe389..7ca4bb7a6420 100644 --- a/dom/media/GraphRunner.cpp +++ b/dom/media/GraphRunner.cpp @@ -112,7 +112,7 @@ void PromoteRenderingThreadAndroid() { ("GraphRunner promoted thread priority: %d", java::sdk::Process::GetThreadPriority(java::sdk::Process::MyTid()))); } -}; // namespace +}; // namespace #endif // MOZ_WIDGET_ANDROID NS_IMETHODIMP GraphRunner::Run() { diff --git a/dom/media/MediaDevices.h b/dom/media/MediaDevices.h index 5390a583b3d3..2949a038a9b6 100644 --- a/dom/media/MediaDevices.h +++ b/dom/media/MediaDevices.h @@ -56,7 +56,7 @@ class MediaDevices final : public DOMEventTargetHelper { JS::Handle aGivenProto) override; // No code needed, as MediaTrackSupportedConstraints members default to true. - void GetSupportedConstraints(MediaTrackSupportedConstraints& aResult){}; + void GetSupportedConstraints(MediaTrackSupportedConstraints& aResult) {}; already_AddRefed GetUserMedia( const MediaStreamConstraints& aConstraints, CallerType aCallerType, diff --git a/dom/media/MediaStreamTrack.cpp b/dom/media/MediaStreamTrack.cpp index 4235d96d1355..e973a41effa2 100644 --- a/dom/media/MediaStreamTrack.cpp +++ b/dom/media/MediaStreamTrack.cpp @@ -47,8 +47,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(MediaStreamTrackSource) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END auto MediaStreamTrackSource::ApplyConstraints( - const dom::MediaTrackConstraints& aConstraints, CallerType aCallerType) - -> RefPtr { + const dom::MediaTrackConstraints& aConstraints, + CallerType aCallerType) -> RefPtr { return ApplyConstraintsPromise::CreateAndReject( MakeRefPtr(MediaMgrError::Name::OverconstrainedError, ""), __func__); diff --git a/dom/media/MediaStreamTrack.h b/dom/media/MediaStreamTrack.h index 1dd2eacb8a6f..509674e479c2 100644 --- a/dom/media/MediaStreamTrack.h +++ b/dom/media/MediaStreamTrack.h @@ -173,7 +173,7 @@ class MediaStreamTrackSource : public nsISupports { /** * Same for GetSettings (no-op). */ - virtual void GetSettings(dom::MediaTrackSettings& aResult){}; + virtual void GetSettings(dom::MediaTrackSettings& aResult) {}; /** * Called by the source interface when all registered sinks with @@ -343,12 +343,12 @@ class MediaStreamTrackConsumer : public SupportsWeakPtr { * Unlike the "ended" event exposed to script this is called for any reason, * including MediaStreamTrack::Stop(). */ - virtual void NotifyEnded(MediaStreamTrack* aTrack){}; + virtual void NotifyEnded(MediaStreamTrack* aTrack) {}; /** * Called when the track's enabled state changes. */ - virtual void NotifyEnabledChanged(MediaStreamTrack* aTrack, bool aEnabled){}; + virtual void NotifyEnabledChanged(MediaStreamTrack* aTrack, bool aEnabled) {}; }; // clang-format off diff --git a/dom/media/doctor/MultiWriterQueue.h b/dom/media/doctor/MultiWriterQueue.h index b19c0039bacf..930c21cc0f78 100644 --- a/dom/media/doctor/MultiWriterQueue.h +++ b/dom/media/doctor/MultiWriterQueue.h @@ -36,8 +36,8 @@ class MOZ_CAPABILITY("mutex") MultiWriterQueueReaderLocking_Mutex { class MOZ_CAPABILITY("dummy lock") MultiWriterQueueReaderLocking_None { public: #ifndef DEBUG - void Lock() MOZ_CAPABILITY_ACQUIRE(){}; - void Unlock() MOZ_CAPABILITY_RELEASE(){}; + void Lock() MOZ_CAPABILITY_ACQUIRE() {}; + void Unlock() MOZ_CAPABILITY_RELEASE() {}; #else // DEBUG-mode checks to catch concurrent misuses. void Lock() MOZ_CAPABILITY_ACQUIRE() { diff --git a/dom/media/flac/FlacFrameParser.cpp b/dom/media/flac/FlacFrameParser.cpp index ac7a04017e86..fb8ebcb84613 100644 --- a/dom/media/flac/FlacFrameParser.cpp +++ b/dom/media/flac/FlacFrameParser.cpp @@ -38,7 +38,7 @@ FlacFrameParser::FlacFrameParser() mMaxFrameSize(0), mNumFrames(0), mFullMetadata(false), - mPacketCount(0){}; + mPacketCount(0) {}; FlacFrameParser::~FlacFrameParser() = default; diff --git a/dom/media/gtest/AudioVerifier.h b/dom/media/gtest/AudioVerifier.h index 096a442b2bb1..3e0b9cd919bf 100644 --- a/dom/media/gtest/AudioVerifier.h +++ b/dom/media/gtest/AudioVerifier.h @@ -59,8 +59,8 @@ class AudioVerifier { // Returns the maximum difference in value between two adjacent samples along // the sine curve. Sample MaxMagnitudeDifference() { - return static_cast(AudioGenerator::Amplitude() * - 2 * sin(2 * M_PI * mFrequency / mRate)); + return static_cast(AudioGenerator::Amplitude() * 2 * + sin(2 * M_PI * mFrequency / mRate)); } bool PreSilenceEnded() const { diff --git a/dom/media/gtest/TestDeviceInputTrack.cpp b/dom/media/gtest/TestDeviceInputTrack.cpp index fca06d5e4af0..fedb18f226e8 100644 --- a/dom/media/gtest/TestDeviceInputTrack.cpp +++ b/dom/media/gtest/TestDeviceInputTrack.cpp @@ -101,7 +101,7 @@ TEST_F(TestDeviceInputTrack, DeviceInputConsumerTrack) { } void ProcessInput(GraphTime aFrom, GraphTime aTo, - uint32_t aFlags) override{/* Ignored */}; + uint32_t aFlags) override { /* Ignored */ }; uint32_t NumberOfChannels() const override { if (mInputs.IsEmpty()) { @@ -134,9 +134,8 @@ TEST_F(TestDeviceInputTrack, DeviceInputConsumerTrack) { bool IsVoiceInput(MediaTrackGraph* aGraph) const override { return mIsVoice; }; - void DeviceChanged(MediaTrackGraph* aGraph) override { /* Ignored */ - } - void Disconnect(MediaTrackGraph* aGraph) override{/* Ignored */}; + void DeviceChanged(MediaTrackGraph* aGraph) override { /* Ignored */ } + void Disconnect(MediaTrackGraph* aGraph) override { /* Ignored */ }; void NotifySetRequestedInputProcessingParamsResult( MediaTrackGraph* aGraph, cubeb_input_processing_params aRequestedParams, const Result& aResult) override { diff --git a/dom/media/imagecapture/CaptureTask.cpp b/dom/media/imagecapture/CaptureTask.cpp index 42dbdde46e59..7ecaf5d4eed3 100644 --- a/dom/media/imagecapture/CaptureTask.cpp +++ b/dom/media/imagecapture/CaptureTask.cpp @@ -21,7 +21,7 @@ namespace mozilla { class CaptureTask::MediaTrackEventListener : public MediaTrackListener { public: explicit MediaTrackEventListener(CaptureTask* aCaptureTask) - : mCaptureTask(aCaptureTask){}; + : mCaptureTask(aCaptureTask) {}; // MediaTrackListener methods. void NotifyEnded(MediaTrackGraph* aGraph) override { diff --git a/dom/media/ipc/RDDProcessManager.cpp b/dom/media/ipc/RDDProcessManager.cpp index cb51b6828238..237c866fb8a4 100644 --- a/dom/media/ipc/RDDProcessManager.cpp +++ b/dom/media/ipc/RDDProcessManager.cpp @@ -192,8 +192,8 @@ RefPtr RDDProcessManager::LaunchRDDProcess() { } auto RDDProcessManager::EnsureRDDProcessAndCreateBridge( - base::ProcessId aOtherProcess, dom::ContentParentId aParentId) - -> RefPtr { + base::ProcessId aOtherProcess, + dom::ContentParentId aParentId) -> RefPtr { return InvokeAsync( GetMainThreadSerialEventTarget(), __func__, [aOtherProcess, aParentId, this]() -> RefPtr { diff --git a/dom/media/mediacontrol/MediaControlKeySource.h b/dom/media/mediacontrol/MediaControlKeySource.h index 4ab2c8b8bebb..a3261b31f9fe 100644 --- a/dom/media/mediacontrol/MediaControlKeySource.h +++ b/dom/media/mediacontrol/MediaControlKeySource.h @@ -107,9 +107,9 @@ class MediaControlKeySource { // Override these methods if the inherited key source want to know the change // for following attributes. For example, GeckoView would use these methods // to notify change to the embedded application. - virtual void SetEnableFullScreen(bool aIsEnabled){}; - virtual void SetEnablePictureInPictureMode(bool aIsEnabled){}; - virtual void SetPositionState(const Maybe& aState){}; + virtual void SetEnableFullScreen(bool aIsEnabled) {}; + virtual void SetEnablePictureInPictureMode(bool aIsEnabled) {}; + virtual void SetPositionState(const Maybe& aState) {}; protected: virtual ~MediaControlKeySource() = default; diff --git a/dom/media/mediasink/AudioDecoderInputTrack.h b/dom/media/mediasink/AudioDecoderInputTrack.h index 051964d78450..41d03f8ca2c4 100644 --- a/dom/media/mediasink/AudioDecoderInputTrack.h +++ b/dom/media/mediasink/AudioDecoderInputTrack.h @@ -70,10 +70,10 @@ class AudioDecoderInputTrack final : public ProcessedMediaTrack { }; struct EOS {}; - SPSCData() : mData(Empty()){}; - explicit SPSCData(ClearFutureData&& aArg) : mData(std::move(aArg)){}; - explicit SPSCData(DecodedData&& aArg) : mData(std::move(aArg)){}; - explicit SPSCData(EOS&& aArg) : mData(std::move(aArg)){}; + SPSCData() : mData(Empty()) {}; + explicit SPSCData(ClearFutureData&& aArg) : mData(std::move(aArg)) {}; + explicit SPSCData(DecodedData&& aArg) : mData(std::move(aArg)) {}; + explicit SPSCData(EOS&& aArg) : mData(std::move(aArg)) {}; bool HasData() const { return !mData.is(); } bool IsClearFutureData() const { return mData.is(); } diff --git a/dom/media/mediasink/MediaSink.h b/dom/media/mediasink/MediaSink.h index 293f0647729a..29807223048b 100644 --- a/dom/media/mediasink/MediaSink.h +++ b/dom/media/mediasink/MediaSink.h @@ -111,7 +111,7 @@ class MediaSink { // Single frame rendering operation may need to be done before playback // started (1st frame) or right after seek completed or playback stopped. // Do nothing if this sink has no video track. Can be called in any state. - virtual void Redraw(const VideoInfo& aInfo){}; + virtual void Redraw(const VideoInfo& aInfo) {}; // Begin a playback session with the provided start time in the media data // and media info. Must be called when playback is stopped. aStartTime is diff --git a/dom/media/platforms/SimpleMap.h b/dom/media/platforms/SimpleMap.h index 635ba6f085fa..307aa4a43fe9 100644 --- a/dom/media/platforms/SimpleMap.h +++ b/dom/media/platforms/SimpleMap.h @@ -43,7 +43,7 @@ class SimpleMap { using MapType = AutoTArray; public: - SimpleMap() : mLock("SimpleMap"){}; + SimpleMap() : mLock("SimpleMap") {}; // Check if aKey is in the map. bool Contains(const K& aKey) { diff --git a/dom/media/platforms/android/JavaCallbacksSupport.h b/dom/media/platforms/android/JavaCallbacksSupport.h index e79d7962092f..3e267c12ab19 100644 --- a/dom/media/platforms/android/JavaCallbacksSupport.h +++ b/dom/media/platforms/android/JavaCallbacksSupport.h @@ -44,7 +44,7 @@ class JavaCallbacksSupport } virtual void HandleOutputFormatChanged( - java::sdk::MediaFormat::Param aFormat){}; + java::sdk::MediaFormat::Param aFormat) {}; void OnOutputFormatChanged(jni::Object::Param aFormat) { if (!mCanceled) { diff --git a/dom/media/platforms/wmf/MFMediaEngineStream.h b/dom/media/platforms/wmf/MFMediaEngineStream.h index e11d9004987e..cdff86684eb3 100644 --- a/dom/media/platforms/wmf/MFMediaEngineStream.h +++ b/dom/media/platforms/wmf/MFMediaEngineStream.h @@ -127,7 +127,7 @@ class MFMediaEngineStream // Overwrite this method if inherited class needs to perform clean up on the // task queue when the stream gets shutdowned. - virtual void ShutdownCleanUpOnTaskQueue(){}; + virtual void ShutdownCleanUpOnTaskQueue() {}; // Inherited class must implement this method to return decoded data. it // should uses `mRawDataQueueForGeneratingOutput` to generate output. diff --git a/dom/media/webrtc/jsapi/PeerConnectionImpl.h b/dom/media/webrtc/jsapi/PeerConnectionImpl.h index d7b54ad721bd..0f2c5aa371e3 100644 --- a/dom/media/webrtc/jsapi/PeerConnectionImpl.h +++ b/dom/media/webrtc/jsapi/PeerConnectionImpl.h @@ -142,7 +142,7 @@ class PCUuidGenerator : public mozilla::JsepUuidGenerator { // elapsed time is recorded in seconds. struct PeerConnectionAutoTimer { PeerConnectionAutoTimer() - : mRefCnt(0), mStart(TimeStamp::Now()), mUsedAV(false){}; + : mRefCnt(0), mStart(TimeStamp::Now()), mUsedAV(false) {}; void RegisterConnection(); void UnregisterConnection(bool aContainedAV); bool IsStopped(); diff --git a/dom/media/webrtc/jsapi/RTCStatsIdGenerator.h b/dom/media/webrtc/jsapi/RTCStatsIdGenerator.h index 1391c029ad7f..5daf5280dfbd 100644 --- a/dom/media/webrtc/jsapi/RTCStatsIdGenerator.h +++ b/dom/media/webrtc/jsapi/RTCStatsIdGenerator.h @@ -29,7 +29,7 @@ class RTCStatsIdGenerator { dom::RTCStatsCollection* aIntoReport); private: - virtual ~RTCStatsIdGenerator(){}; + virtual ~RTCStatsIdGenerator() {}; nsString Id(const nsString& aKey); nsString Generate(); diff --git a/dom/media/webrtc/jsapi/RemoteTrackSource.cpp b/dom/media/webrtc/jsapi/RemoteTrackSource.cpp index 41c679e4319d..b27600809e76 100644 --- a/dom/media/webrtc/jsapi/RemoteTrackSource.cpp +++ b/dom/media/webrtc/jsapi/RemoteTrackSource.cpp @@ -51,8 +51,8 @@ void RemoteTrackSource::Destroy() { } auto RemoteTrackSource::ApplyConstraints( - const dom::MediaTrackConstraints& aConstraints, dom::CallerType aCallerType) - -> RefPtr { + const dom::MediaTrackConstraints& aConstraints, + dom::CallerType aCallerType) -> RefPtr { return ApplyConstraintsPromise::CreateAndReject( MakeRefPtr( dom::MediaStreamError::Name::OverconstrainedError, ""), diff --git a/dom/media/webrtc/jsapi/WebrtcGlobalStatsHistory.cpp b/dom/media/webrtc/jsapi/WebrtcGlobalStatsHistory.cpp index d17af937ada3..8b896248e7ab 100644 --- a/dom/media/webrtc/jsapi/WebrtcGlobalStatsHistory.cpp +++ b/dom/media/webrtc/jsapi/WebrtcGlobalStatsHistory.cpp @@ -162,9 +162,8 @@ auto WebrtcGlobalStatsHistory::Entry::Prune(const DOMHighResTimeStamp aBefore) // Note: we always keep the most recent SDP } -auto WebrtcGlobalStatsHistory::InitHistory(const nsAString& aPcId, - const bool aIsLongTermStatsDisabled) - -> void { +auto WebrtcGlobalStatsHistory::InitHistory( + const nsAString& aPcId, const bool aIsLongTermStatsDisabled) -> void { MOZ_ASSERT(XRE_IsParentProcess()); if (WebrtcGlobalStatsHistory::Get().MaybeGet(aPcId)) { return; diff --git a/dom/media/webrtc/sdp/SdpTelemetry.cpp b/dom/media/webrtc/sdp/SdpTelemetry.cpp index 7b3a6cec185d..57683f570dad 100644 --- a/dom/media/webrtc/sdp/SdpTelemetry.cpp +++ b/dom/media/webrtc/sdp/SdpTelemetry.cpp @@ -27,10 +27,9 @@ auto SdpTelemetry::RecordCompare(const SdpTelemetry::Results& aFirst, Telemetry::ScalarAdd(Telemetry::ScalarID::WEBRTC_SDP_PARSER_DIFF, bucket, 1); } -auto SdpTelemetry::BucketNameFragment(const SdpTelemetry::Results& aResult, - const SdpTelemetry::Modes& aMode, - const SdpTelemetry::Roles& aRole) - -> nsAutoString { +auto SdpTelemetry::BucketNameFragment( + const SdpTelemetry::Results& aResult, const SdpTelemetry::Modes& aMode, + const SdpTelemetry::Roles& aRole) -> nsAutoString { auto mode = [&]() -> std::string { switch (aMode) { case Modes::Parallel: diff --git a/dom/media/webrtc/sdp/SdpTelemetry.h b/dom/media/webrtc/sdp/SdpTelemetry.h index ce308a04ec28..a6c9ee08961a 100644 --- a/dom/media/webrtc/sdp/SdpTelemetry.h +++ b/dom/media/webrtc/sdp/SdpTelemetry.h @@ -27,8 +27,8 @@ class SdpTelemetry { static auto RecordParse(const Results& aResults, const Modes& aMode, const Roles& aRole) -> void; - static auto RecordSecondaryParse(const Results& aResult, const Modes& aMode) - -> void; + static auto RecordSecondaryParse(const Results& aResult, + const Modes& aMode) -> void; static auto RecordCompare(const Results& aFirst, const Results& aSecond, const Modes& aMode) -> void; diff --git a/dom/media/webspeech/synth/android/SpeechSynthesisService.h b/dom/media/webspeech/synth/android/SpeechSynthesisService.h index 98c5143cf690..6c7cb712e29d 100644 --- a/dom/media/webspeech/synth/android/SpeechSynthesisService.h +++ b/dom/media/webspeech/synth/android/SpeechSynthesisService.h @@ -21,7 +21,7 @@ class SpeechSynthesisService final NS_DECL_ISUPPORTS NS_DECL_NSISPEECHSERVICE - SpeechSynthesisService(){}; + SpeechSynthesisService() {}; void Setup(); @@ -46,7 +46,7 @@ class SpeechSynthesisService final static StaticRefPtr sSingleton; private: - virtual ~SpeechSynthesisService(){}; + virtual ~SpeechSynthesisService() {}; nsCOMPtr mTask; diff --git a/dom/prototype/PrototypeDocumentContentSink.h b/dom/prototype/PrototypeDocumentContentSink.h index bdfc1f114c90..53895e49daf8 100644 --- a/dom/prototype/PrototypeDocumentContentSink.h +++ b/dom/prototype/PrototypeDocumentContentSink.h @@ -69,10 +69,10 @@ class PrototypeDocumentContentSink final : public nsIStreamLoaderObserver, // nsIContentSink NS_IMETHOD WillParse(void) override { return NS_OK; }; NS_IMETHOD WillInterrupt(void) override { return NS_OK; }; - void WillResume() override{}; + void WillResume() override {}; NS_IMETHOD SetParser(nsParserBase* aParser) override; virtual void InitialTranslationCompleted() override; - virtual void FlushPendingNotifications(FlushType aType) override{}; + virtual void FlushPendingNotifications(FlushType aType) override {}; virtual void SetDocumentCharset(NotNull aEncoding) override; virtual nsISupports* GetTarget() override; virtual bool IsScriptExecuting() override; diff --git a/dom/script/ShadowRealmGlobalScope.h b/dom/script/ShadowRealmGlobalScope.h index cf7b2a3bd3fe..c5f7998208ab 100644 --- a/dom/script/ShadowRealmGlobalScope.h +++ b/dom/script/ShadowRealmGlobalScope.h @@ -39,7 +39,7 @@ class ShadowRealmGlobalScope final : public nsIGlobalObject, NS_DECLARE_STATIC_IID_ACCESSOR(SHADOWREALMGLOBALSCOPE_IID) explicit ShadowRealmGlobalScope(nsIGlobalObject* aCreatingGlobal) - : mCreatingGlobal(aCreatingGlobal){}; + : mCreatingGlobal(aCreatingGlobal) {}; nsIGlobalObject* GetCreatingGlobal() const { return mCreatingGlobal; } OriginTrials Trials() const override { return {}; } diff --git a/dom/serializers/nsXMLContentSerializer.h b/dom/serializers/nsXMLContentSerializer.h index 167255fe09dd..e3c95e7ee434 100644 --- a/dom/serializers/nsXMLContentSerializer.h +++ b/dom/serializers/nsXMLContentSerializer.h @@ -301,7 +301,7 @@ class nsXMLContentSerializer : public nsIContentSerializer { * the serialization of the end tag. * (called at the end of AppendElementStart) */ - virtual void AfterElementEnd(nsIContent* aContent, nsAString& aStr){}; + virtual void AfterElementEnd(nsIContent* aContent, nsAString& aStr) {}; /** * Returns true if a line break should be inserted before an element open tag diff --git a/dom/streams/QueueWithSizes.h b/dom/streams/QueueWithSizes.h index 5a5bb4903642..45cd6da4a917 100644 --- a/dom/streams/QueueWithSizes.h +++ b/dom/streams/QueueWithSizes.h @@ -21,7 +21,7 @@ namespace mozilla::dom { struct ValueWithSize : LinkedListElement { ValueWithSize(JS::Handle aValue, double aSize) - : mValue(aValue), mSize(aSize){}; + : mValue(aValue), mSize(aSize) {}; JS::Heap mValue; double mSize = 0.0f; diff --git a/dom/svg/SVGElement.h b/dom/svg/SVGElement.h index d9ad8b79ca9c..c6fab341830b 100644 --- a/dom/svg/SVGElement.h +++ b/dom/svg/SVGElement.h @@ -165,8 +165,7 @@ class SVGElement : public SVGElementBase // nsIContent // Only visible for SVGGraphicElement, so it's a no-op here, and that // subclass has the useful implementation. virtual void SetAnimateMotionTransform( - const mozilla::gfx::Matrix* aMatrix) { /*no-op*/ - } + const mozilla::gfx::Matrix* aMatrix) { /*no-op*/ } virtual const mozilla::gfx::Matrix* GetAnimateMotionTransform() const { return nullptr; } diff --git a/dom/system/mac/nsOSPermissionRequest.h b/dom/system/mac/nsOSPermissionRequest.h index 62e4360fee70..24640a56e5ba 100644 --- a/dom/system/mac/nsOSPermissionRequest.h +++ b/dom/system/mac/nsOSPermissionRequest.h @@ -11,7 +11,7 @@ class nsOSPermissionRequest : public nsOSPermissionRequestBase { public: - nsOSPermissionRequest(){}; + nsOSPermissionRequest() {}; NS_IMETHOD GetAudioCapturePermissionState(uint16_t* aAudio) override; diff --git a/dom/webauthn/WinWebAuthnService.h b/dom/webauthn/WinWebAuthnService.h index 8312ae83e1a8..21c8df2b0285 100644 --- a/dom/webauthn/WinWebAuthnService.h +++ b/dom/webauthn/WinWebAuthnService.h @@ -23,7 +23,8 @@ class WinWebAuthnService final : public nsIWebAuthnService { static nsresult EnsureWinWebAuthnModuleLoaded(); WinWebAuthnService() - : mTransactionState(Nothing(), "WinWebAuthnService::mTransactionState"){}; + : mTransactionState(Nothing(), "WinWebAuthnService::mTransactionState") { + }; private: ~WinWebAuthnService(); diff --git a/dom/workers/loader/WorkerLoadContext.cpp b/dom/workers/loader/WorkerLoadContext.cpp index a788d5173c7a..0515a960805e 100644 --- a/dom/workers/loader/WorkerLoadContext.cpp +++ b/dom/workers/loader/WorkerLoadContext.cpp @@ -19,8 +19,8 @@ WorkerLoadContext::WorkerLoadContext( mKind(aKind), mClientInfo(aClientInfo), mScriptLoader(aScriptLoader), - mOnlyExistingCachedResourcesAllowed( - aOnlyExistingCachedResourcesAllowed){}; + mOnlyExistingCachedResourcesAllowed(aOnlyExistingCachedResourcesAllowed) { + }; ThreadSafeRequestHandle::ThreadSafeRequestHandle( JS::loader::ScriptLoadRequest* aRequest, nsISerialEventTarget* aSyncTarget) diff --git a/dom/workers/remoteworkers/RemoteWorkerChild.cpp b/dom/workers/remoteworkers/RemoteWorkerChild.cpp index 9a4ca6028703..a04ea5ec1bc4 100644 --- a/dom/workers/remoteworkers/RemoteWorkerChild.cpp +++ b/dom/workers/remoteworkers/RemoteWorkerChild.cpp @@ -136,7 +136,7 @@ class RemoteWorkerCSPEventListener final : public nsICSPEventListener { NS_DECL_ISUPPORTS explicit RemoteWorkerCSPEventListener(RemoteWorkerChild* aActor) - : mActor(aActor){}; + : mActor(aActor) {}; NS_IMETHOD OnCSPViolationEvent(const nsAString& aJSON) override { mActor->CSPViolationPropagationOnMainThread(aJSON); diff --git a/dom/xslt/base/txErrorObserver.h b/dom/xslt/base/txErrorObserver.h index 30b541f2a91d..ea1944249c5a 100644 --- a/dom/xslt/base/txErrorObserver.h +++ b/dom/xslt/base/txErrorObserver.h @@ -16,7 +16,7 @@ class ErrorObserver { /** * Default Destructor for ErrorObserver **/ - virtual ~ErrorObserver(){}; + virtual ~ErrorObserver() {}; /** * Notifies this Error observer of a new error aRes diff --git a/editor/libeditor/CSSEditUtils.cpp b/editor/libeditor/CSSEditUtils.cpp index 15aec6a4ab4a..39ae58eaa7a7 100644 --- a/editor/libeditor/CSSEditUtils.cpp +++ b/editor/libeditor/CSSEditUtils.cpp @@ -171,8 +171,7 @@ static void ProcessMarginRightValue(const nsAString* aInputString, } } -#define CSS_EQUIV_TABLE_NONE \ - { CSSEditUtils::eCSSEditableProperty_NONE, 0 } +#define CSS_EQUIV_TABLE_NONE {CSSEditUtils::eCSSEditableProperty_NONE, 0} const CSSEditUtils::CSSEquivTable boldEquivTable[] = { {CSSEditUtils::eCSSEditableProperty_font_weight, true, false, ProcessBValue, diff --git a/editor/libeditor/HTMLEditUtils.cpp b/editor/libeditor/HTMLEditUtils.cpp index cf0f4fd04a36..271b4983730a 100644 --- a/editor/libeditor/HTMLEditUtils.cpp +++ b/editor/libeditor/HTMLEditUtils.cpp @@ -1204,13 +1204,10 @@ struct ElementInfo final { #ifdef DEBUG # define ELEM(_tag, _isContainer, _canContainSelf, _group, _canContainGroups) \ - { \ - eHTMLTag_##_tag, _group, _canContainGroups, _isContainer, \ - _canContainSelf \ - } + {eHTMLTag_##_tag, _group, _canContainGroups, _isContainer, _canContainSelf} #else # define ELEM(_tag, _isContainer, _canContainSelf, _group, _canContainGroups) \ - { _group, _canContainGroups, _isContainer, _canContainSelf } + {_group, _canContainGroups, _isContainer, _canContainSelf} #endif static const ElementInfo kElements[eHTMLTag_userdefined] = { diff --git a/editor/libeditor/HTMLEditorDataTransfer.cpp b/editor/libeditor/HTMLEditorDataTransfer.cpp index f7b785722aa6..25be128b66d5 100644 --- a/editor/libeditor/HTMLEditorDataTransfer.cpp +++ b/editor/libeditor/HTMLEditorDataTransfer.cpp @@ -1236,7 +1236,7 @@ HTMLEditor::HTMLWithContextInserter::InsertContents( rv != NS_SUCCESS_EDITOR_BUT_IGNORED_TRIVIAL_ERROR, "CreateContentResult::SuggestCaretPointTo() failed, but ignored"); break; // from the inner `for` loop - } // end of the inner `for` loop + } // end of the inner `for` loop } } if (lastInsertedPoint.IsSet()) { diff --git a/editor/libeditor/HTMLStyleEditor.cpp b/editor/libeditor/HTMLStyleEditor.cpp index 5aaff15ba481..e63ee3404c08 100644 --- a/editor/libeditor/HTMLStyleEditor.cpp +++ b/editor/libeditor/HTMLStyleEditor.cpp @@ -3698,7 +3698,7 @@ nsresult HTMLEditor::RemoveInlinePropertiesAsSubAction( // cases. FlushAndStopTrackingAndShrinkSelectionRange(); } // for-loop of selectionRanges - } // for-loop of styles + } // for-loop of styles MOZ_ASSERT(!selectionRanges.HasSavedRanges()); nsresult rv = selectionRanges.ApplyTo(SelectionRef()); diff --git a/editor/libeditor/InternetCiter.cpp b/editor/libeditor/InternetCiter.cpp index 330bff4aa089..53fb5a670f58 100644 --- a/editor/libeditor/InternetCiter.cpp +++ b/editor/libeditor/InternetCiter.cpp @@ -287,7 +287,7 @@ void InternetCiter::Rewrap(const nsAString& aInString, uint32_t aWrapCol, BreakLine(aOutString, outStringCol, citeLevel); } } // end inner loop within one line of aInString - } // end outer loop over lines of aInString + } // end outer loop over lines of aInString } } // namespace mozilla diff --git a/extensions/auth/gssapi.h b/extensions/auth/gssapi.h index 826d69df79d5..812ddf66ec68 100644 --- a/extensions/auth/gssapi.h +++ b/extensions/auth/gssapi.h @@ -240,8 +240,7 @@ typedef struct gss_channel_bindings_struct { #define GSS_C_NO_CONTEXT ((gss_ctx_id_t)0) #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t)0) #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t)0) -#define GSS_C_EMPTY_BUFFER \ - { 0, nullptr } +#define GSS_C_EMPTY_BUFFER {0, nullptr} /* * Some alternate names for a couple of the above diff --git a/gfx/2d/HelpersD2D.h b/gfx/2d/HelpersD2D.h index f4e54b34a3ab..5df20dec0183 100644 --- a/gfx/2d/HelpersD2D.h +++ b/gfx/2d/HelpersD2D.h @@ -958,12 +958,9 @@ class StreamingGeometrySink : public ID2D1SimplifiedGeometrySink { ToPoint(aSegments[i].point3)); } } - STDMETHOD(Close)() { /* Should never be called! */ - return S_OK; - } + STDMETHOD(Close)() { /* Should never be called! */ return S_OK; } STDMETHOD_(void, SetSegmentFlags) - (D2D1_PATH_SEGMENT aFlags) { /* Should never be called! */ - } + (D2D1_PATH_SEGMENT aFlags) { /* Should never be called! */ } STDMETHOD_(void, EndFigure)(D2D1_FIGURE_END aEnd) { AutoRestoreFP resetFloatingPoint; diff --git a/gfx/2d/PathD2D.cpp b/gfx/2d/PathD2D.cpp index de01b410a9bf..34ee356b561d 100644 --- a/gfx/2d/PathD2D.cpp +++ b/gfx/2d/PathD2D.cpp @@ -89,9 +89,7 @@ class OpeningGeometrySink : public ID2D1SimplifiedGeometrySink { EnsureFigureEnded(); return mSink->AddBeziers(aSegments, aCount); } - STDMETHOD(Close)() { /* Should never be called! */ - return S_OK; - } + STDMETHOD(Close)() { /* Should never be called! */ return S_OK; } STDMETHOD_(void, SetSegmentFlags)(D2D1_PATH_SEGMENT aFlags) { return mSink->SetSegmentFlags(aFlags); } diff --git a/gfx/gl/SharedSurface.h b/gfx/gl/SharedSurface.h index 12aace9e9e28..c23db166d4d4 100644 --- a/gfx/gl/SharedSurface.h +++ b/gfx/gl/SharedSurface.h @@ -108,11 +108,11 @@ class SharedSurface { virtual void Commit() {} protected: - virtual void LockProdImpl(){}; - virtual void UnlockProdImpl(){}; + virtual void LockProdImpl() {}; + virtual void UnlockProdImpl() {}; - virtual void ProducerAcquireImpl(){}; - virtual void ProducerReleaseImpl(){}; + virtual void ProducerAcquireImpl() {}; + virtual void ProducerReleaseImpl() {}; virtual void ProducerReadAcquireImpl() { ProducerAcquireImpl(); } virtual void ProducerReadReleaseImpl() { ProducerReleaseImpl(); } diff --git a/gfx/gl/SharedSurfaceEGL.h b/gfx/gl/SharedSurfaceEGL.h index 569421f945a1..390d657fc2a9 100644 --- a/gfx/gl/SharedSurfaceEGL.h +++ b/gfx/gl/SharedSurfaceEGL.h @@ -49,7 +49,7 @@ class SharedSurface_EGLImage final : public SharedSurface { virtual void ProducerReleaseImpl() override; virtual void ProducerReadAcquireImpl() override; - virtual void ProducerReadReleaseImpl() override{}; + virtual void ProducerReadReleaseImpl() override {}; Maybe ToSurfaceDescriptor() override; }; diff --git a/gfx/layers/AxisPhysicsModel.h b/gfx/layers/AxisPhysicsModel.h index 4aa6a69c11f1..c90356713671 100644 --- a/gfx/layers/AxisPhysicsModel.h +++ b/gfx/layers/AxisPhysicsModel.h @@ -55,14 +55,14 @@ class AxisPhysicsModel { protected: struct State { - State(double ap, double av) : p(ap), v(av){}; + State(double ap, double av) : p(ap), v(av) {}; double p; // Position double v; // Velocity }; struct Derivative { - Derivative() : dp(0.0), dv(0.0){}; - Derivative(double aDp, double aDv) : dp(aDp), dv(aDv){}; + Derivative() : dp(0.0), dv(0.0) {}; + Derivative(double aDp, double aDv) : dp(aDp), dv(aDv) {}; double dp; // dp / delta time = Position double dv; // dv / delta time = Velocity }; diff --git a/gfx/layers/TreeTraversal.h b/gfx/layers/TreeTraversal.h index 4c02a4e5b5fb..8d7b45a3ccfa 100644 --- a/gfx/layers/TreeTraversal.h +++ b/gfx/layers/TreeTraversal.h @@ -150,8 +150,9 @@ static auto ForEachNode(Node aRoot, const PreAction& aPreAction, * ForEachNode pre-order traversal, using TraversalFlag. */ template -auto ForEachNode(Node aRoot, const PreAction& aPreAction) -> std::enable_if_t< - std::is_same_v, bool> { +auto ForEachNode(Node aRoot, const PreAction& aPreAction) + -> std::enable_if_t< + std::is_same_v, bool> { return ForEachNode( aRoot, aPreAction, [](Node aNode) { return TraversalFlag::Continue; }); } @@ -184,8 +185,7 @@ template auto ForEachNodePostOrder(Node aRoot, const PostAction& aPostAction) -> std::enable_if_t, void> { - ForEachNode( - aRoot, [](Node aNode) {}, aPostAction); + ForEachNode(aRoot, [](Node aNode) {}, aPostAction); } /* diff --git a/gfx/layers/apz/test/gtest/APZCBasicTester.h b/gfx/layers/apz/test/gtest/APZCBasicTester.h index 13065f71f5f9..a79e51b72a63 100644 --- a/gfx/layers/apz/test/gtest/APZCBasicTester.h +++ b/gfx/layers/apz/test/gtest/APZCBasicTester.h @@ -58,8 +58,7 @@ class APZCBasicTester : public APZCTesterBase { } virtual void TearDown() { - while (mcc->RunThroughDelayedTasks()) - ; + while (mcc->RunThroughDelayedTasks()); apzc->Destroy(); tm->ClearTree(); tm->ClearContentController(); diff --git a/gfx/layers/apz/test/gtest/APZCTreeManagerTester.h b/gfx/layers/apz/test/gtest/APZCTreeManagerTester.h index 1f402bedc733..5ac0cf2b580f 100644 --- a/gfx/layers/apz/test/gtest/APZCTreeManagerTester.h +++ b/gfx/layers/apz/test/gtest/APZCTreeManagerTester.h @@ -38,8 +38,7 @@ class APZCTreeManagerTester : public APZCTesterBase { } virtual void TearDown() { - while (mcc->RunThroughDelayedTasks()) - ; + while (mcc->RunThroughDelayedTasks()); manager->ClearTree(); manager->ClearContentController(); diff --git a/gfx/layers/apz/test/gtest/TestEventRegions.cpp b/gfx/layers/apz/test/gtest/TestEventRegions.cpp index f0f262eb825a..edf34715e108 100644 --- a/gfx/layers/apz/test/gtest/TestEventRegions.cpp +++ b/gfx/layers/apz/test/gtest/TestEventRegions.cpp @@ -158,8 +158,7 @@ TEST_F(APZEventRegionsTesterMock, HitRegionImmediateResponse) { nsTArray targets; targets.AppendElement(left->GetGuid()); manager->SetTargetAPZC(result.mInputBlockId, targets); - while (mcc->RunThroughDelayedTasks()) - ; // this runs the tap event + while (mcc->RunThroughDelayedTasks()); // this runs the tap event check.Call("Tapped on left this time"); } diff --git a/gfx/layers/apz/test/gtest/TestGestureDetector.cpp b/gfx/layers/apz/test/gtest/TestGestureDetector.cpp index f5024e82080b..d2d60c033d94 100644 --- a/gfx/layers/apz/test/gtest/TestGestureDetector.cpp +++ b/gfx/layers/apz/test/gtest/TestGestureDetector.cpp @@ -133,8 +133,7 @@ TEST_F(APZCGestureDetectorTester, Pan_After_Pinch) { // Clear out any remaining fling animation and pending tasks apzc->AdvanceAnimationsUntilEnd(); - while (mcc->RunThroughDelayedTasks()) - ; + while (mcc->RunThroughDelayedTasks()); apzc->AssertStateIsReset(); } #endif @@ -225,8 +224,7 @@ TEST_F(APZCGestureDetectorTester, Pan_With_Tap) { // Clear out any remaining fling animation and pending tasks apzc->AdvanceAnimationsUntilEnd(); - while (mcc->RunThroughDelayedTasks()) - ; + while (mcc->RunThroughDelayedTasks()); apzc->AssertStateIsReset(); } @@ -286,14 +284,12 @@ class APZCFlingStopTester : public APZCGestureDetectorTester { HandleTap(TapType::eSingleTap, _, 0, apzc->GetGuid(), _, _)) .Times(tapCallsExpected); Tap(apzc, ScreenIntPoint(10, 10), 0); - while (mcc->RunThroughDelayedTasks()) - ; + while (mcc->RunThroughDelayedTasks()); // Deliver another tap, to make sure that taps are flowing properly once // the fling is aborted. Tap(apzc, ScreenIntPoint(100, 100), 0); - while (mcc->RunThroughDelayedTasks()) - ; + while (mcc->RunThroughDelayedTasks()); // Verify that we didn't advance any further after the fling was aborted, in // either case. @@ -847,8 +843,7 @@ TEST_F(APZCGestureDetectorTester, TapTimeoutInterruptedByWheel) { Wheel(apzc, ScreenIntPoint(10, 10), ScreenPoint(0, -10), mcc->Time()) .mInputBlockId; EXPECT_NE(result.mInputBlockId, wheelBlockId); - while (mcc->RunThroughDelayedTasks()) - ; + while (mcc->RunThroughDelayedTasks()); } TEST_F(APZCGestureDetectorTester, LongPressWithInputQueueDelay) { diff --git a/gfx/layers/client/CompositableClient.h b/gfx/layers/client/CompositableClient.h index 43107855b60e..8dff36e513e4 100644 --- a/gfx/layers/client/CompositableClient.h +++ b/gfx/layers/client/CompositableClient.h @@ -79,7 +79,7 @@ class CompositableClient { virtual void Dump(std::stringstream& aStream, const char* aPrefix = "", bool aDumpHtml = false, - TextureDumpMode aCompress = TextureDumpMode::Compress){}; + TextureDumpMode aCompress = TextureDumpMode::Compress) {}; virtual TextureInfo GetTextureInfo() const = 0; diff --git a/gfx/layers/client/GPUVideoTextureClient.h b/gfx/layers/client/GPUVideoTextureClient.h index 93b2e761caab..94bbeb77244c 100644 --- a/gfx/layers/client/GPUVideoTextureClient.h +++ b/gfx/layers/client/GPUVideoTextureClient.h @@ -28,7 +28,7 @@ class GPUVideoTextureData : public TextureData { bool Lock(OpenMode) override { return true; }; - void Unlock() override{}; + void Unlock() override {}; bool Serialize(SurfaceDescriptor& aOutDescriptor) override; diff --git a/gfx/layers/client/TextureClient.h b/gfx/layers/client/TextureClient.h index cf1701e3f090..d4dc298b4ff3 100644 --- a/gfx/layers/client/TextureClient.h +++ b/gfx/layers/client/TextureClient.h @@ -286,7 +286,7 @@ class TextureData { return false; }; - virtual void SyncWithObject(RefPtr aSyncObject){}; + virtual void SyncWithObject(RefPtr aSyncObject) {}; virtual TextureFlags GetTextureFlags() const { return TextureFlags::NO_FLAGS; diff --git a/gfx/thebes/gfxMacPlatformFontList.mm b/gfx/thebes/gfxMacPlatformFontList.mm index 2b8d1fa16a38..6d2a6666df10 100644 --- a/gfx/thebes/gfxMacPlatformFontList.mm +++ b/gfx/thebes/gfxMacPlatformFontList.mm @@ -85,7 +85,7 @@ class gfxSingleFaceMacFontFamily final : public gfxFontFamily { virtual ~gfxSingleFaceMacFontFamily() = default; void FindStyleVariationsLocked(FontInfoData* aFontInfoData = nullptr) - MOZ_REQUIRES(mLock) override{}; + MOZ_REQUIRES(mLock) override {}; void LocalizedName(nsACString& aLocalizedName) override; diff --git a/gfx/wr/swgl/src/rasterize.h b/gfx/wr/swgl/src/rasterize.h index a4419c655551..b26a5eedd7b6 100644 --- a/gfx/wr/swgl/src/rasterize.h +++ b/gfx/wr/swgl/src/rasterize.h @@ -806,7 +806,7 @@ static inline void draw_quad_spans(int nump, Point2D p[4], uint32_t z, // Helper to find the previous index in the points array, walking backward. #define PREV_POINT(idx) \ ({ \ - int cur = (idx)-1; \ + int cur = (idx) - 1; \ cur >= 0 ? cur : nump - 1; \ }) // Start looking for "left"-side and "right"-side descending edges starting diff --git a/hal/cocoa/CocoaBattery.cpp b/hal/cocoa/CocoaBattery.cpp index a6c4b689e12b..9496c02c2c7d 100644 --- a/hal/cocoa/CocoaBattery.cpp +++ b/hal/cocoa/CocoaBattery.cpp @@ -20,10 +20,10 @@ #define IOKIT_FRAMEWORK_PATH "/System/Library/Frameworks/IOKit.framework/IOKit" #ifndef kIOPSTimeRemainingUnknown -# define kIOPSTimeRemainingUnknown ((CFTimeInterval)-1.0) +# define kIOPSTimeRemainingUnknown ((CFTimeInterval) - 1.0) #endif #ifndef kIOPSTimeRemainingUnlimited -# define kIOPSTimeRemainingUnlimited ((CFTimeInterval)-2.0) +# define kIOPSTimeRemainingUnlimited ((CFTimeInterval) - 2.0) #endif using namespace mozilla::dom::battery; diff --git a/image/decoders/icon/nsIconURI.cpp b/image/decoders/icon/nsIconURI.cpp index 49e5302082d5..1136cb9584c7 100644 --- a/image/decoders/icon/nsIconURI.cpp +++ b/image/decoders/icon/nsIconURI.cpp @@ -197,8 +197,8 @@ static void extractAttributeValue(const char* aSearchString, aResult.Assign(startOfAttribute); } } // if we have a attribute value - } // if we have a attribute name - } // if we got non-null search string and attribute name values + } // if we have a attribute name + } // if we got non-null search string and attribute name values } nsresult nsMozIconURI::SetSpecInternal(const nsACString& aSpec) { diff --git a/image/decoders/icon/win/nsIconChannel.cpp b/image/decoders/icon/win/nsIconChannel.cpp index 6c93dc3bf200..b8ddcd890450 100644 --- a/image/decoders/icon/win/nsIconChannel.cpp +++ b/image/decoders/icon/win/nsIconChannel.cpp @@ -442,7 +442,7 @@ static nsresult MakeIconBuffer(HICON aIcon, ByteBuf* aOutBuffer) { } // if we got mask bits delete colorInfo; } // if we allocated the buffer - } // if we got mask size + } // if we got mask size DeleteDC(hDC); DeleteObject(iconInfo.hbmColor); diff --git a/image/imgTools.cpp b/image/imgTools.cpp index c3c61a3c4129..ac2029216e50 100644 --- a/image/imgTools.cpp +++ b/image/imgTools.cpp @@ -276,11 +276,9 @@ NS_IMPL_ISUPPORTS_INHERITED(ImageDecoderHelper, Runnable, NS_IMPL_ISUPPORTS(imgTools, imgITools) -imgTools::imgTools() { /* member initializers and constructor code */ -} +imgTools::imgTools() { /* member initializers and constructor code */ } -imgTools::~imgTools() { /* destructor code */ -} +imgTools::~imgTools() { /* destructor code */ } NS_IMETHODIMP imgTools::DecodeImageFromArrayBuffer(JS::Handle aArrayBuffer, diff --git a/intl/components/src/NumberParser.h b/intl/components/src/NumberParser.h index 97efec083679..b70bfa7f74b3 100644 --- a/intl/components/src/NumberParser.h +++ b/intl/components/src/NumberParser.h @@ -22,7 +22,7 @@ class NumberParser { static Result, ICUError> TryCreate( const char* aLocale, bool aUseGrouping); - NumberParser() : mNumberFormat(nullptr){}; + NumberParser() : mNumberFormat(nullptr) {}; NumberParser(const NumberParser&) = delete; NumberParser& operator=(const NumberParser&) = delete; ~NumberParser(); diff --git a/intl/lwbrk/th_char.h b/intl/lwbrk/th_char.h index a088228fff5a..b699d34d30cc 100644 --- a/intl/lwbrk/th_char.h +++ b/intl/lwbrk/th_char.h @@ -30,7 +30,7 @@ typedef tis_char th_char; # define TH_THAIBEGIN_ 0xa0 # define th_isthai(c) ((c) >= 0xa0) #endif -#define th_zcode(c) ((c)-TH_THAIBEGIN_) +#define th_zcode(c) ((c) - TH_THAIBEGIN_) enum TH_CHARNAME { TH_THAIBEGIN = TH_THAIBEGIN_, diff --git a/ipc/chromium/src/base/message_pump.h b/ipc/chromium/src/base/message_pump.h index 884c016d204d..7c3c374c4b9c 100644 --- a/ipc/chromium/src/base/message_pump.h +++ b/ipc/chromium/src/base/message_pump.h @@ -132,7 +132,7 @@ class MessagePump { virtual nsISerialEventTarget* GetXPCOMThread() { return nullptr; } protected: - virtual ~MessagePump(){}; + virtual ~MessagePump() {}; }; } // namespace base diff --git a/ipc/glue/ForkServer.h b/ipc/glue/ForkServer.h index ba4ed9d44ed1..c530e5131cfc 100644 --- a/ipc/glue/ForkServer.h +++ b/ipc/glue/ForkServer.h @@ -20,7 +20,7 @@ class ForkServer { static constexpr int kClientPipeFd = 3; ForkServer(); - ~ForkServer(){}; + ~ForkServer() {}; void InitProcess(int* aArgc, char*** aArgv); bool HandleMessages(); diff --git a/ipc/glue/MessagePump.cpp b/ipc/glue/MessagePump.cpp index 50c916608ca2..8c2ca969a9ca 100644 --- a/ipc/glue/MessagePump.cpp +++ b/ipc/glue/MessagePump.cpp @@ -259,8 +259,7 @@ void MessagePumpForChildProcess::Run(base::MessagePump::Delegate* aDelegate) { bool nestableTasksAllowed = loop->NestableTasksAllowed(); loop->SetNestableTasksAllowed(true); - while (aDelegate->DoWork()) - ; + while (aDelegate->DoWork()); loop->SetNestableTasksAllowed(nestableTasksAllowed); diff --git a/ipc/glue/NodeController.cpp b/ipc/glue/NodeController.cpp index 325eff183458..d3827adedbb3 100644 --- a/ipc/glue/NodeController.cpp +++ b/ipc/glue/NodeController.cpp @@ -162,10 +162,9 @@ bool NodeController::SendUserMessage(const PortRef& aPort, return false; } -auto NodeController::SerializeEventMessage(UniquePtr aEvent, - const NodeName* aRelayTarget, - uint32_t aType) - -> UniquePtr { +auto NodeController::SerializeEventMessage( + UniquePtr aEvent, const NodeName* aRelayTarget, + uint32_t aType) -> UniquePtr { UniquePtr message; if (aEvent->type() == Event::kUserMessage) { MOZ_DIAGNOSTIC_ASSERT( diff --git a/ipc/glue/UtilityAudioDecoderChild.h b/ipc/glue/UtilityAudioDecoderChild.h index 0a27cb4ea39b..88af46fbcb69 100644 --- a/ipc/glue/UtilityAudioDecoderChild.h +++ b/ipc/glue/UtilityAudioDecoderChild.h @@ -28,7 +28,7 @@ namespace mozilla::ipc { class UtilityAudioDecoderChildShutdownObserver : public nsIObserver { public: explicit UtilityAudioDecoderChildShutdownObserver(SandboxingKind aKind) - : mSandbox(aKind){}; + : mSandbox(aKind) {}; NS_DECL_ISUPPORTS diff --git a/js/public/Printer.h b/js/public/Printer.h index 644ffa9176ce..510d9582642e 100644 --- a/js/public/Printer.h +++ b/js/public/Printer.h @@ -202,8 +202,7 @@ class JS_PUBLIC_API GenericPrinter { virtual size_t index() const { return 0; } // In some printers, this ensure that the content is fully written. - virtual void flush() { /* Do nothing */ - } + virtual void flush() { /* Do nothing */ } // Report that a string operation failed to get the memory it requested. virtual void reportOutOfMemory(); diff --git a/js/public/PropertySpec.h b/js/public/PropertySpec.h index 0c37e598fbca..91782073c954 100644 --- a/js/public/PropertySpec.h +++ b/js/public/PropertySpec.h @@ -452,6 +452,6 @@ struct JSFunctionSpec { #define JS_SYM_FNSPEC(symbol, call, info, nargs, flags, selfHostedName) \ JS_FNSPEC(::JS::SymbolCode::symbol, call, info, nargs, flags, selfHostedName) #define JS_FNSPEC(name, call, info, nargs, flags, selfHostedName) \ - { JSFunctionSpec::Name(name), {call, info}, nargs, flags, selfHostedName } + {JSFunctionSpec::Name(name), {call, info}, nargs, flags, selfHostedName} #endif // js_PropertySpec_h diff --git a/js/public/Utility.h b/js/public/Utility.h index 25e351d740fe..2d414595aa4f 100644 --- a/js/public/Utility.h +++ b/js/public/Utility.h @@ -95,7 +95,7 @@ extern JS_PUBLIC_API uint32_t GetThreadType(void); # else inline bool InitThreadType(void) { return true; } -inline void SetThreadType(ThreadType t){}; +inline void SetThreadType(ThreadType t) {}; inline uint32_t GetThreadType(void) { return 0; } inline uint32_t GetAllocationThreadType(void) { return 0; } inline uint32_t GetStackCheckThreadType(void) { return 0; } diff --git a/js/src/debugger/Debugger.h b/js/src/debugger/Debugger.h index 537e47b913dd..d9d06e685599 100644 --- a/js/src/debugger/Debugger.h +++ b/js/src/debugger/Debugger.h @@ -428,7 +428,7 @@ class MOZ_RAII EvalOptions { EnvKind kind_; public: - explicit EvalOptions(EnvKind kind) : kind_(kind){}; + explicit EvalOptions(EnvKind kind) : kind_(kind) {}; ~EvalOptions() = default; const char* filename() const { return filename_.get(); } unsigned lineno() const { return lineno_; } diff --git a/js/src/devtools/rootAnalysis/t/virtual/source.cpp b/js/src/devtools/rootAnalysis/t/virtual/source.cpp index 980546f38d0c..06b36b9ac12d 100644 --- a/js/src/devtools/rootAnalysis/t/virtual/source.cpp +++ b/js/src/devtools/rootAnalysis/t/virtual/source.cpp @@ -138,7 +138,7 @@ class nsISupports { class nsIPrincipal : public nsISupports { public: - ~nsIPrincipal() override{}; + ~nsIPrincipal() override {}; }; struct JSPrincipals { diff --git a/js/src/ds/BitArray.h b/js/src/ds/BitArray.h index f8a6aad45521..c9e88928e85b 100644 --- a/js/src/ds/BitArray.h +++ b/js/src/ds/BitArray.h @@ -53,7 +53,7 @@ class BitArray { WordT map[numSlots]; public: - constexpr BitArray() : map(){}; + constexpr BitArray() : map() {}; void clear(bool value) { memset(map, value ? 0xFF : 0, sizeof(map)); diff --git a/js/src/frontend/AsyncEmitter.h b/js/src/frontend/AsyncEmitter.h index 778f708c4fe9..69d19994e0b2 100644 --- a/js/src/frontend/AsyncEmitter.h +++ b/js/src/frontend/AsyncEmitter.h @@ -157,7 +157,7 @@ class MOZ_STACK_CLASS AsyncEmitter { [[nodiscard]] bool emitFinalYield(); public: - explicit AsyncEmitter(BytecodeEmitter* bce) : bce_(bce){}; + explicit AsyncEmitter(BytecodeEmitter* bce) : bce_(bce) {}; [[nodiscard]] bool prepareForParamsWithoutExpressionOrDestructuring(); [[nodiscard]] bool prepareForParamsWithExpressionOrDestructuring(); diff --git a/js/src/frontend/CompilationStencil.h b/js/src/frontend/CompilationStencil.h index c1e98f475407..592d09c056d2 100644 --- a/js/src/frontend/CompilationStencil.h +++ b/js/src/frontend/CompilationStencil.h @@ -171,29 +171,29 @@ class InputScope { }; inline InputScope enclosing() const; bool hasOnChain(ScopeKind kind) const { - return scope_.match( - [=](const Scope* ptr) { return ptr->hasOnChain(kind); }, - [=](const ScopeStencilRef& ref) { - ScopeStencilRef it = ref; - while (true) { - const ScopeStencil& scope = it.scope(); - if (scope.kind() == kind) { - return true; - } - if (scope.kind() == ScopeKind::Module && - kind == ScopeKind::Global) { - return true; - } - if (!scope.hasEnclosing()) { - break; - } - new (&it) ScopeStencilRef{ref.context_, scope.enclosing()}; - } - return false; - }, - [=](const FakeStencilGlobalScope&) { - return kind == ScopeKind::Global; - }); + return scope_.match([=](const Scope* ptr) { return ptr->hasOnChain(kind); }, + [=](const ScopeStencilRef& ref) { + ScopeStencilRef it = ref; + while (true) { + const ScopeStencil& scope = it.scope(); + if (scope.kind() == kind) { + return true; + } + if (scope.kind() == ScopeKind::Module && + kind == ScopeKind::Global) { + return true; + } + if (!scope.hasEnclosing()) { + break; + } + new (&it) ScopeStencilRef{ref.context_, + scope.enclosing()}; + } + return false; + }, + [=](const FakeStencilGlobalScope&) { + return kind == ScopeKind::Global; + }); } uint32_t environmentChainLength() const { return scope_.match( diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp index 7060a6edb1a0..f31f0da99227 100644 --- a/js/src/frontend/TokenStream.cpp +++ b/js/src/frontend/TokenStream.cpp @@ -3603,7 +3603,7 @@ bool TokenStreamSpecific::getStringOrTemplateToken( unit = char16_t(val); break; } // default - } // switch (AssertedCast(CodeUnitValue(toUnit(unit)))) + } // switch (AssertedCast(CodeUnitValue(toUnit(unit)))) if (!this->charBuffer.append(unit)) { return false; diff --git a/js/src/frontend/TypedIndex.h b/js/src/frontend/TypedIndex.h index c75d59ae3db8..fb877441fd90 100644 --- a/js/src/frontend/TypedIndex.h +++ b/js/src/frontend/TypedIndex.h @@ -18,7 +18,7 @@ namespace frontend { template struct TypedIndex { TypedIndex() = default; - constexpr explicit TypedIndex(uint32_t index) : index(index){}; + constexpr explicit TypedIndex(uint32_t index) : index(index) {}; uint32_t index = 0; diff --git a/js/src/jit/FlushICache.h b/js/src/jit/FlushICache.h index dd15bdc8ff4c..b276f2b9756b 100644 --- a/js/src/jit/FlushICache.h +++ b/js/src/jit/FlushICache.h @@ -18,10 +18,9 @@ namespace jit { #if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64) -inline void FlushICache(void* code, size_t size) { - // No-op. Code and data caches are coherent on x86 and x64. +inline void FlushICache(void* code, size_t size){ + // No-op. Code and data caches are coherent on x86 and x64. } - #elif (defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_ARM64)) || \ (defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)) || \ defined(JS_CODEGEN_LOONG64) || defined(JS_CODEGEN_RISCV64) diff --git a/js/src/jit/PerfSpewer.h b/js/src/jit/PerfSpewer.h index 8b04dc4419f7..54c41f676699 100644 --- a/js/src/jit/PerfSpewer.h +++ b/js/src/jit/PerfSpewer.h @@ -197,7 +197,7 @@ class PerfSpewerRangeRecorder { void appendEntry(UniqueChars& desc); public: - explicit PerfSpewerRangeRecorder(MacroAssembler& masm_) : masm(masm_){}; + explicit PerfSpewerRangeRecorder(MacroAssembler& masm_) : masm(masm_) {}; void recordOffset(const char* name); void recordOffset(const char* name, JSContext* cx, JSScript* script); void recordVMWrapperOffset(const char* name); diff --git a/js/src/jsapi-tests/testGCAllocator.cpp b/js/src/jsapi-tests/testGCAllocator.cpp index c740a3b10b33..360e1d77f04a 100644 --- a/js/src/jsapi-tests/testGCAllocator.cpp +++ b/js/src/jsapi-tests/testGCAllocator.cpp @@ -248,8 +248,7 @@ bool positionIsCorrect(const char* str, void* base, void** chunkPool, int len = strlen(str); int i; // Find the index of the desired address. - for (i = 0; i < len && str[i] != 'o'; ++i) - ; + for (i = 0; i < len && str[i] != 'o'; ++i); void* desired = (void*)(uintptr_t(base) + i * Chunk); // Map the regions indicated by str. for (i = 0; i < len; ++i) { diff --git a/js/src/vm/JSAtomState.h b/js/src/vm/JSAtomState.h index 12e49dcd0a1e..2d60b94bfb2c 100644 --- a/js/src/vm/JSAtomState.h +++ b/js/src/vm/JSAtomState.h @@ -35,9 +35,9 @@ struct JSAtomState { JS_FOR_EACH_WELL_KNOWN_SYMBOL(PROPERTYNAME_FIELD) #undef PROPERTYNAME_FIELD - js::ImmutableTenuredPtr* wellKnownSymbolNames() { + js::ImmutableTenuredPtr* wellKnownSymbolNames(){ #define FIRST_PROPERTYNAME_FIELD(name) return &name; - JS_FOR_EACH_WELL_KNOWN_SYMBOL(FIRST_PROPERTYNAME_FIELD) + JS_FOR_EACH_WELL_KNOWN_SYMBOL(FIRST_PROPERTYNAME_FIELD) #undef FIRST_PROPERTYNAME_FIELD } diff --git a/js/src/vm/PropertyAndElement.cpp b/js/src/vm/PropertyAndElement.cpp index 419e629f2f56..bb11ea06a050 100644 --- a/js/src/vm/PropertyAndElement.cpp +++ b/js/src/vm/PropertyAndElement.cpp @@ -304,7 +304,7 @@ JS_PUBLIC_API bool JS_DefineProperty(JSContext* cx, JS::Handle obj, cx, obj, name, JS::Handle::fromMarkedLocation(&value), attrs); } -#define AUTO_NAMELEN(s, n) (((n) == (size_t)-1) ? js_strlen(s) : (n)) +#define AUTO_NAMELEN(s, n) (((n) == (size_t) - 1) ? js_strlen(s) : (n)) JS_PUBLIC_API bool JS_DefineUCProperty(JSContext* cx, JS::Handle obj, const char16_t* name, size_t namelen, diff --git a/js/src/vm/SavedStacks.h b/js/src/vm/SavedStacks.h index e622b20cbbac..cd00a040038a 100644 --- a/js/src/vm/SavedStacks.h +++ b/js/src/vm/SavedStacks.h @@ -238,8 +238,7 @@ class SavedStacks { WeakHeapPtr script; jsbytecode* pc; - void trace(JSTracer* trc) { /* PCKey is weak. */ - } + void trace(JSTracer* trc) { /* PCKey is weak. */ } bool traceWeak(JSTracer* trc) { return TraceWeakEdge(trc, &script, "traceWeak"); } diff --git a/js/src/wasm/WasmBCFrame.h b/js/src/wasm/WasmBCFrame.h index 0713761250c1..74a9f31e3e8f 100644 --- a/js/src/wasm/WasmBCFrame.h +++ b/js/src/wasm/WasmBCFrame.h @@ -125,7 +125,7 @@ class StackResultsLoc { Maybe height_; public: - StackResultsLoc() : bytes_(0), count_(0){}; + StackResultsLoc() : bytes_(0), count_(0) {}; StackResultsLoc(uint32_t bytes, size_t count, uint32_t height) : bytes_(bytes), count_(count), height_(Some(height)) { MOZ_ASSERT(bytes != 0); diff --git a/js/xpconnect/public/xpc_make_class.h b/js/xpconnect/public/xpc_make_class.h index c500046af309..b00265675ea3 100644 --- a/js/xpconnect/public/xpc_make_class.h +++ b/js/xpconnect/public/xpc_make_class.h @@ -48,74 +48,73 @@ extern const js::ClassExtension XPC_WN_JSClassExtension; #define XPC_MAKE_CLASS_OPS(_flags) \ { \ - /* addProperty */ \ - ((_flags) & XPC_SCRIPTABLE_USE_JSSTUB_FOR_ADDPROPERTY) ? nullptr \ - : ((_flags) & XPC_SCRIPTABLE_ALLOW_PROP_MODS_DURING_RESOLVE) \ - ? XPC_WN_MaybeResolvingPropertyStub \ - : XPC_WN_CannotModifyPropertyStub, \ + /* addProperty */ \ + ((_flags) & XPC_SCRIPTABLE_USE_JSSTUB_FOR_ADDPROPERTY) ? nullptr \ + : ((_flags) & XPC_SCRIPTABLE_ALLOW_PROP_MODS_DURING_RESOLVE) \ + ? XPC_WN_MaybeResolvingPropertyStub \ + : XPC_WN_CannotModifyPropertyStub, \ \ - /* delProperty */ \ - ((_flags) & XPC_SCRIPTABLE_USE_JSSTUB_FOR_DELPROPERTY) ? nullptr \ - : ((_flags) & XPC_SCRIPTABLE_ALLOW_PROP_MODS_DURING_RESOLVE) \ - ? XPC_WN_MaybeResolvingDeletePropertyStub \ - : XPC_WN_CannotDeletePropertyStub, \ + /* delProperty */ \ + ((_flags) & XPC_SCRIPTABLE_USE_JSSTUB_FOR_DELPROPERTY) ? nullptr \ + : ((_flags) & XPC_SCRIPTABLE_ALLOW_PROP_MODS_DURING_RESOLVE) \ + ? XPC_WN_MaybeResolvingDeletePropertyStub \ + : XPC_WN_CannotDeletePropertyStub, \ \ - /* enumerate */ \ - ((_flags) & XPC_SCRIPTABLE_WANT_NEWENUMERATE) \ - ? nullptr /* We will use newEnumerate set below in this case */ \ - : XPC_WN_Shared_Enumerate, \ + /* enumerate */ \ + ((_flags) & XPC_SCRIPTABLE_WANT_NEWENUMERATE) \ + ? nullptr /* We will use newEnumerate set below in this case */ \ + : XPC_WN_Shared_Enumerate, \ \ - /* newEnumerate */ \ - ((_flags) & XPC_SCRIPTABLE_WANT_NEWENUMERATE) ? XPC_WN_NewEnumerate \ - : nullptr, \ + /* newEnumerate */ \ + ((_flags) & XPC_SCRIPTABLE_WANT_NEWENUMERATE) ? XPC_WN_NewEnumerate \ + : nullptr, \ \ - /* resolve */ /* We have to figure out resolve strategy at call time \ - */ \ - XPC_WN_Helper_Resolve, \ + /* resolve */ /* We have to figure out resolve strategy at call time \ + */ \ + XPC_WN_Helper_Resolve, \ \ - /* mayResolve */ \ - nullptr, \ + /* mayResolve */ \ + nullptr, \ \ - /* finalize */ \ - ((_flags) & XPC_SCRIPTABLE_WANT_FINALIZE) ? XPC_WN_Helper_Finalize \ - : XPC_WN_NoHelper_Finalize, \ + /* finalize */ \ + ((_flags) & XPC_SCRIPTABLE_WANT_FINALIZE) ? XPC_WN_Helper_Finalize \ + : XPC_WN_NoHelper_Finalize, \ \ - /* call */ \ - ((_flags) & XPC_SCRIPTABLE_WANT_CALL) ? XPC_WN_Helper_Call : nullptr, \ + /* call */ \ + ((_flags) & XPC_SCRIPTABLE_WANT_CALL) ? XPC_WN_Helper_Call : nullptr, \ \ - /* construct */ \ - ((_flags) & XPC_SCRIPTABLE_WANT_CONSTRUCT) ? XPC_WN_Helper_Construct \ - : nullptr, \ + /* construct */ \ + ((_flags) & XPC_SCRIPTABLE_WANT_CONSTRUCT) ? XPC_WN_Helper_Construct \ + : nullptr, \ \ - /* trace */ \ - ((_flags) & XPC_SCRIPTABLE_IS_GLOBAL_OBJECT) \ - ? JS_GlobalObjectTraceHook \ - : XPCWrappedNative_Trace, \ + /* trace */ \ + ((_flags) & XPC_SCRIPTABLE_IS_GLOBAL_OBJECT) ? JS_GlobalObjectTraceHook \ + : XPCWrappedNative_Trace, \ } -#define XPC_MAKE_CLASS(_name, _flags, _classOps) \ - { \ - /* name */ \ - _name, \ - \ - /* flags */ \ - JSCLASS_SLOT0_IS_NSISUPPORTS | JSCLASS_IS_WRAPPED_NATIVE | \ - JSCLASS_FOREGROUND_FINALIZE | \ - (((_flags) & XPC_SCRIPTABLE_IS_GLOBAL_OBJECT) \ - ? XPCONNECT_GLOBAL_FLAGS \ - : JSCLASS_HAS_RESERVED_SLOTS(1)), \ - \ - /* cOps */ \ - _classOps, \ - \ - /* spec */ \ - nullptr, \ - \ - /* ext */ \ - &XPC_WN_JSClassExtension, \ - \ - /* oOps */ \ - nullptr, \ +#define XPC_MAKE_CLASS(_name, _flags, _classOps) \ + { \ + /* name */ \ + _name, \ + \ + /* flags */ \ + JSCLASS_SLOT0_IS_NSISUPPORTS | JSCLASS_IS_WRAPPED_NATIVE | \ + JSCLASS_FOREGROUND_FINALIZE | \ + (((_flags) & XPC_SCRIPTABLE_IS_GLOBAL_OBJECT) \ + ? XPCONNECT_GLOBAL_FLAGS \ + : JSCLASS_HAS_RESERVED_SLOTS(1)), \ + \ + /* cOps */ \ + _classOps, \ + \ + /* spec */ \ + nullptr, \ + \ + /* ext */ \ + &XPC_WN_JSClassExtension, \ + \ + /* oOps */ \ + nullptr, \ } #endif diff --git a/js/xpconnect/src/XPCRuntimeService.cpp b/js/xpconnect/src/XPCRuntimeService.cpp index 2c283ea2bce9..0b1cf0e56bb0 100644 --- a/js/xpconnect/src/XPCRuntimeService.cpp +++ b/js/xpconnect/src/XPCRuntimeService.cpp @@ -23,8 +23,8 @@ NS_IMPL_ISUPPORTS(BackstagePass, nsIXPCScriptable, nsIGlobalObject, nsISupportsWeakReference) BackstagePass::BackstagePass() - : mPrincipal(nsContentUtils::GetSystemPrincipal()), mWrapper(nullptr) {} - + : mPrincipal(nsContentUtils::GetSystemPrincipal()), + mWrapper(nullptr){} // XXX(nika): It appears we don't have support for mayresolve hooks in // nsIXPCScriptable, and I don't really want to add it because I'd rather just // kill nsIXPCScriptable alltogether, so we don't use it here. @@ -42,7 +42,8 @@ BackstagePass::BackstagePass() XPC_SCRIPTABLE_DONT_REFLECT_INTERFACE_NAMES) #include "xpc_map_end.h" /* This will #undef the above */ -JSObject* BackstagePass::GetGlobalJSObject() { + JSObject + * BackstagePass::GetGlobalJSObject() { if (mWrapper) { return mWrapper->GetFlatJSObject(); } diff --git a/js/xpconnect/wrappers/XrayWrapper.h b/js/xpconnect/wrappers/XrayWrapper.h index fb0c8b36c642..44d1a3a4f75e 100644 --- a/js/xpconnect/wrappers/XrayWrapper.h +++ b/js/xpconnect/wrappers/XrayWrapper.h @@ -383,7 +383,7 @@ class XrayWrapper : public Base { public: constexpr explicit XrayWrapper(unsigned flags) : Base(flags | WrapperFactory::IS_XRAY_WRAPPER_FLAG, - /* aHasPrototype = */ true){}; + /* aHasPrototype = */ true) {}; /* Standard internal methods. */ virtual bool getOwnPropertyDescriptor( diff --git a/layout/base/nsBidiPresUtils.cpp b/layout/base/nsBidiPresUtils.cpp index 0331a7e5a0f4..ced33e447171 100644 --- a/layout/base/nsBidiPresUtils.cpp +++ b/layout/base/nsBidiPresUtils.cpp @@ -1103,7 +1103,7 @@ nsresult nsBidiPresUtils::ResolveParagraph(BidiParagraphData* aBpd) { contentOffset + fragmentLength); } } // isTextFrame - } // not bidi control frame + } // not bidi control frame int32_t temp = runLength; runLength -= fragmentLength; fragmentLength -= temp; diff --git a/layout/mathml/nsMathMLChar.cpp b/layout/mathml/nsMathMLChar.cpp index 3599fa96754e..038f87e3b7be 100644 --- a/layout/mathml/nsMathMLChar.cpp +++ b/layout/mathml/nsMathMLChar.cpp @@ -1193,8 +1193,7 @@ bool nsMathMLChar::StretchEnumContext::TryParts( int32_t i; // Try and find the first existing part and then determine the extremal // horizontal metrics of the parts. - for (i = 0; i <= 3 && !textRun[i]; i++) - ; + for (i = 0; i <= 3 && !textRun[i]; i++); if (i == 4) { NS_ERROR("Cannot stretch - All parts missing"); return false; @@ -1227,8 +1226,7 @@ bool nsMathMLChar::StretchEnumContext::TryParts( int32_t i; // Try and find the first existing part and then determine the extremal // vertical metrics of the parts. - for (i = 0; i <= 3 && !textRun[i]; i++) - ; + for (i = 0; i <= 3 && !textRun[i]; i++); if (i == 4) { NS_ERROR("Cannot stretch - All parts missing"); return false; diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index da5dedc8c106..0ccce4c2aee0 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -740,8 +740,8 @@ void nsTableRowGroupFrame::CalculateRowBSizes(nsPresContext* aPresContext, } // if (rowSpan > 1) cellFrame = cellFrame->GetNextCell(); } // while (cellFrame) - } // if (tableFrame->RowHasSpanningCells(startRowIndex + rowIndex) { - } // while (rowFrame) + } // if (tableFrame->RowHasSpanningCells(startRowIndex + rowIndex) { + } // while (rowFrame) } // pct bsize rows have already got their content bsizes. diff --git a/media/webrtc/signaling/gtest/MockCall.h b/media/webrtc/signaling/gtest/MockCall.h index 717ef2bc13db..1fd17d933aa0 100644 --- a/media/webrtc/signaling/gtest/MockCall.h +++ b/media/webrtc/signaling/gtest/MockCall.h @@ -192,7 +192,7 @@ class MockVideoReceiveStream : public webrtc::VideoReceiveStreamInterface { virtual void SetAssociatedPayloadTypes( std::map associated_payload_types) override {} - virtual void UpdateRtxSsrc(uint32_t ssrc) override{}; + virtual void UpdateRtxSsrc(uint32_t ssrc) override {}; virtual ~MockVideoReceiveStream() {} @@ -316,7 +316,7 @@ class MockCall : public webrtc::Call { return nullptr; } - virtual ~MockCall(){}; + virtual ~MockCall() {}; const RefPtr mCallWrapper; mozilla::Maybe diff --git a/media/wmf-clearkey/WMFClearKeyCDM.h b/media/wmf-clearkey/WMFClearKeyCDM.h index 765cac36f0a2..2dc1ea5305d4 100644 --- a/media/wmf-clearkey/WMFClearKeyCDM.h +++ b/media/wmf-clearkey/WMFClearKeyCDM.h @@ -112,14 +112,14 @@ class SessionManagerWrapper final : public RefCounted, private cdm::Host_10 { const cdm::KeyInformation* aKeysInfo, uint32_t aKeysInfoCount) override; void OnExpirationChange(const char* aSessionId, uint32_t aSessionIdSize, - cdm::Time aNewExpiryTime) override{ - // No need to implement this because the session would never expire in - // testing. + cdm::Time aNewExpiryTime) override { + // No need to implement this because the session would never expire in + // testing. }; void OnSessionClosed(const char* aSessionId, - uint32_t aSessionIdSize) override{ - // No need to implement this because session doesn't have close callback - // or events. + uint32_t aSessionIdSize) override { + // No need to implement this because session doesn't have close callback + // or events. }; cdm::FileIO* CreateFileIO(cdm::FileIOClient* aClient) override { // We don't support this because we only support temporary session. @@ -129,7 +129,7 @@ class SessionManagerWrapper final : public RefCounted, private cdm::Host_10 { const char* aChallenge, uint32_t aChallengeSize) override {} void EnableOutputProtection(uint32_t aDesiredProtectionMask) override {} - void QueryOutputProtectionStatus() override{}; + void QueryOutputProtectionStatus() override {}; void OnDeferredInitializationDone(cdm::StreamType aStreamType, cdm::Status aDecoderStatus) override {} void RequestStorageId(uint32_t aVersion) override {} diff --git a/memory/build/mozmemory_utils.h b/memory/build/mozmemory_utils.h index af9e96b4c7b1..3c0e23ecffbc 100644 --- a/memory/build/mozmemory_utils.h +++ b/memory/build/mozmemory_utils.h @@ -45,8 +45,8 @@ struct StallSpecs { // ``` // template - auto StallAndRetry(DelayFunc&& aDelayFunc, OpFunc&& aOperation) const - -> decltype(aOperation()) { + auto StallAndRetry(DelayFunc&& aDelayFunc, + OpFunc&& aOperation) const -> decltype(aOperation()) { { // Explicit typecheck for OpFunc, to provide an explicit error message. using detail::is_std_optional; diff --git a/memory/gtest/TestJemalloc.cpp b/memory/gtest/TestJemalloc.cpp index 7cb19674ccaf..ad2b37a92ead 100644 --- a/memory/gtest/TestJemalloc.cpp +++ b/memory/gtest/TestJemalloc.cpp @@ -349,9 +349,9 @@ class SizeClassesBetween { }; #define ALIGNMENT_CEILING(s, alignment) \ - (((s) + ((alignment)-1)) & (~((alignment)-1))) + (((s) + ((alignment) - 1)) & (~((alignment) - 1))) -#define ALIGNMENT_FLOOR(s, alignment) ((s) & (~((alignment)-1))) +#define ALIGNMENT_FLOOR(s, alignment) ((s) & (~((alignment) - 1))) static bool IsSameRoundedHugeClass(size_t aSize1, size_t aSize2, jemalloc_stats_t& aStats) { diff --git a/mfbt/Attributes.h b/mfbt/Attributes.h index 3be46cf5a824..956d2759819a 100644 --- a/mfbt/Attributes.h +++ b/mfbt/Attributes.h @@ -866,11 +866,11 @@ * warning, so use pragmas to disable the warning. */ # ifdef __clang__ -# define MOZ_HEAP_ALLOCATOR \ - _Pragma("clang diagnostic push") \ - _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ - __attribute__((annotate("moz_heap_allocator"))) \ - _Pragma("clang diagnostic pop") +# define MOZ_HEAP_ALLOCATOR \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((annotate("moz_heap_allocator"))) _Pragma( \ + "clang diagnostic pop") # else # define MOZ_HEAP_ALLOCATOR __attribute__((annotate("moz_heap_allocator"))) # endif diff --git a/mfbt/Buffer.h b/mfbt/Buffer.h index c4e0a4be92e0..12156e58e079 100644 --- a/mfbt/Buffer.h +++ b/mfbt/Buffer.h @@ -39,7 +39,7 @@ class Buffer final { * Construct zero-lenth Buffer (without actually pointing to a heap * allocation). */ - Buffer() : mData(nullptr), mLength(0){}; + Buffer() : mData(nullptr), mLength(0) {}; /** * Construct from raw parts. diff --git a/mfbt/tests/TestAtomicBitfields.cpp b/mfbt/tests/TestAtomicBitfields.cpp index 9f561c6b7bbd..a6ed672afb88 100644 --- a/mfbt/tests/TestAtomicBitfields.cpp +++ b/mfbt/tests/TestAtomicBitfields.cpp @@ -109,18 +109,18 @@ void TestDocumentationExample() { MOZ_RELEASE_ASSERT(val.LoadLargeAndInCharge() == int_max); \ } -#define GENERATE_TEST_LOPSIDED(aSize) \ - struct LopsidedA##aSize { \ - MOZ_ATOMIC_BITFIELDS(mAtomicFields, aSize, \ - ((bool, HappyLittleBit, 1), \ - (uint##aSize##_t, LargeAndInCharge, ((aSize)-1)))) \ - }; \ - struct LopsidedB##aSize { \ - MOZ_ATOMIC_BITFIELDS(mAtomicFields, aSize, \ - ((uint##aSize##_t, LargeAndInCharge, ((aSize)-1)), \ - (bool, HappyLittleBit, 1))) \ - }; \ - GENERATE_TEST_LOPSIDED_FUNC(A, aSize); \ +#define GENERATE_TEST_LOPSIDED(aSize) \ + struct LopsidedA##aSize { \ + MOZ_ATOMIC_BITFIELDS(mAtomicFields, aSize, \ + ((bool, HappyLittleBit, 1), \ + (uint##aSize##_t, LargeAndInCharge, ((aSize) - 1)))) \ + }; \ + struct LopsidedB##aSize { \ + MOZ_ATOMIC_BITFIELDS(mAtomicFields, aSize, \ + ((uint##aSize##_t, LargeAndInCharge, ((aSize) - 1)), \ + (bool, HappyLittleBit, 1))) \ + }; \ + GENERATE_TEST_LOPSIDED_FUNC(A, aSize); \ GENERATE_TEST_LOPSIDED_FUNC(B, aSize); #define TEST_LOPSIDED(aSize) \ diff --git a/mfbt/tests/TestMaybe.cpp b/mfbt/tests/TestMaybe.cpp index ea39b2864c11..dad2b43e804b 100644 --- a/mfbt/tests/TestMaybe.cpp +++ b/mfbt/tests/TestMaybe.cpp @@ -1026,13 +1026,11 @@ static bool TestComparisonOperators() { // class (i.e. that the compiler doesn't warn when we invoke the superclass's // destructor explicitly in |reset()|. class MySuperClass { - virtual void VirtualMethod() { /* do nothing */ - } + virtual void VirtualMethod() { /* do nothing */ } }; class MyDerivedClass : public MySuperClass { - void VirtualMethod() override { /* do nothing */ - } + void VirtualMethod() override { /* do nothing */ } }; static bool TestVirtualFunction() { diff --git a/mfbt/tests/TestNotNull.cpp b/mfbt/tests/TestNotNull.cpp index b9a62ea4d9ad..fdead1ff4a3c 100644 --- a/mfbt/tests/TestNotNull.cpp +++ b/mfbt/tests/TestNotNull.cpp @@ -21,7 +21,7 @@ using mozilla::WrapNotNull; class Blah { public: Blah() : mX(0) {} - void blah(){}; + void blah() {}; int mX; }; diff --git a/mfbt/tests/gtest/TestSpan.cpp b/mfbt/tests/gtest/TestSpan.cpp index fb7db0d158c1..54e92091ba18 100644 --- a/mfbt/tests/gtest/TestSpan.cpp +++ b/mfbt/tests/gtest/TestSpan.cpp @@ -1233,37 +1233,39 @@ SPAN_TEST(from_cstring) { } } -SPAN_TEST(from_convertible_Span_constructor){{Span avd; -Span avcd = avd; -static_cast(avcd); -} +SPAN_TEST(from_convertible_Span_constructor) { + { + Span avd; + Span avcd = avd; + static_cast(avcd); + } -{ + { #ifdef CONFIRM_COMPILATION_ERRORS - Span avd; - Span avb = avd; - static_cast(avb); + Span avd; + Span avb = avd; + static_cast(avb); #endif -} + } #ifdef CONFIRM_COMPILATION_ERRORS -{ - Span s; - Span s2 = s; - static_cast(s2); -} + { + Span s; + Span s2 = s; + static_cast(s2); + } -{ - Span s; - Span s2 = s; - static_cast(s2); -} + { + Span s; + Span s2 = s; + static_cast(s2); + } -{ - Span s; - Span s2 = s; - static_cast(s2); -} + { + Span s; + Span s2 = s; + static_cast(s2); + } #endif } diff --git a/mobile/android/components/geckoview/GeckoViewInputStream.h b/mobile/android/components/geckoview/GeckoViewInputStream.h index ac48e0db259b..46a69fad67f8 100644 --- a/mobile/android/components/geckoview/GeckoViewInputStream.h +++ b/mobile/android/components/geckoview/GeckoViewInputStream.h @@ -17,7 +17,7 @@ class GeckoViewInputStream : public nsIInputStream { explicit GeckoViewInputStream( mozilla::java::GeckoViewInputStream::LocalRef aInstance) - : mInstance(aInstance){}; + : mInstance(aInstance) {}; bool isClosed() const; protected: diff --git a/modules/libmar/src/mar_read.c b/modules/libmar/src/mar_read.c index 679dc258d6ae..c1123fb52a25 100644 --- a/modules/libmar/src/mar_read.c +++ b/modules/libmar/src/mar_read.c @@ -149,8 +149,7 @@ static int mar_read_index(MarFile* mar) { bufptr = buf; bufend = buf + size_of_index; - while (bufptr < bufend && mar_consume_index(mar, &bufptr, bufend) == 0) - ; + while (bufptr < bufend && mar_consume_index(mar, &bufptr, bufend) == 0); free(buf); return (bufptr == bufend) ? 0 : -1; diff --git a/mozglue/baseprofiler/core/shared-libraries-linux.cc b/mozglue/baseprofiler/core/shared-libraries-linux.cc index 84680bb59bd4..9a4bfc19e064 100644 --- a/mozglue/baseprofiler/core/shared-libraries-linux.cc +++ b/mozglue/baseprofiler/core/shared-libraries-linux.cc @@ -851,5 +851,4 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf() { return info; } -void SharedLibraryInfo::Initialize() { /* do nothing */ -} +void SharedLibraryInfo::Initialize() { /* do nothing */ } diff --git a/mozglue/baseprofiler/core/shared-libraries-win32.cc b/mozglue/baseprofiler/core/shared-libraries-win32.cc index 2a453612d3ca..fc92914101f2 100644 --- a/mozglue/baseprofiler/core/shared-libraries-win32.cc +++ b/mozglue/baseprofiler/core/shared-libraries-win32.cc @@ -194,5 +194,4 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoFromPath(const wchar_t* aPath) { return sharedLibraryInfo; } -void SharedLibraryInfo::Initialize() { /* do nothing */ -} +void SharedLibraryInfo::Initialize() { /* do nothing */ } diff --git a/mozglue/misc/TimeStamp_darwin.cpp b/mozglue/misc/TimeStamp_darwin.cpp index ec29917985d6..6c7e1b87a880 100644 --- a/mozglue/misc/TimeStamp_darwin.cpp +++ b/mozglue/misc/TimeStamp_darwin.cpp @@ -132,8 +132,7 @@ void TimeStamp::Startup() { // sake of ToSecondsSigDigits() for (sResolutionSigDigs = 1; !(sResolutionSigDigs == sResolution || 10 * sResolutionSigDigs > sResolution); - sResolutionSigDigs *= 10) - ; + sResolutionSigDigs *= 10); gInitialized = true; } diff --git a/mozglue/misc/TimeStamp_posix.cpp b/mozglue/misc/TimeStamp_posix.cpp index ba32a230eb09..6f87118a103e 100644 --- a/mozglue/misc/TimeStamp_posix.cpp +++ b/mozglue/misc/TimeStamp_posix.cpp @@ -197,8 +197,7 @@ void TimeStamp::Startup() { // sake of ToSecondsSigDigits() for (sResolutionSigDigs = 1; !(sResolutionSigDigs == sResolution || 10 * sResolutionSigDigs > sResolution); - sResolutionSigDigs *= 10) - ; + sResolutionSigDigs *= 10); gInitialized = true; } @@ -321,14 +320,16 @@ uint64_t TimeStamp::ComputeProcessUptime() { } int mib[] = { - CTL_KERN, - KERN_PROC, - KERN_PROC_PID, - getpid(), + // clang-format off + CTL_KERN, + KERN_PROC, + KERN_PROC_PID, + getpid(), # if defined(__NetBSD__) || defined(__OpenBSD__) - sizeof(KINFO_PROC), - 1, + sizeof(KINFO_PROC), + 1, # endif + // clang-format on }; u_int mibLen = sizeof(mib) / sizeof(mib[0]); diff --git a/mozglue/misc/TimeStamp_windows.cpp b/mozglue/misc/TimeStamp_windows.cpp index 81da34409d18..5ad23138b054 100644 --- a/mozglue/misc/TimeStamp_windows.cpp +++ b/mozglue/misc/TimeStamp_windows.cpp @@ -245,8 +245,7 @@ static void InitResolution() { // sake of ToSecondsSigDigits() ULONGLONG sigDigs; for (sigDigs = 1; !(sigDigs == result || 10 * sigDigs > result); - sigDigs *= 10) - ; + sigDigs *= 10); sResolutionSigDigs = sigDigs; } diff --git a/mozglue/misc/WindowsDpiAwareness.h b/mozglue/misc/WindowsDpiAwareness.h index 589415da6d05..4ba641cc95a2 100644 --- a/mozglue/misc/WindowsDpiAwareness.h +++ b/mozglue/misc/WindowsDpiAwareness.h @@ -21,9 +21,9 @@ typedef enum DPI_AWARENESS { DPI_AWARENESS_PER_MONITOR_AWARE = 2 } DPI_AWARENESS; -# define DPI_AWARENESS_CONTEXT_UNAWARE ((DPI_AWARENESS_CONTEXT)-1) -# define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT)-2) -# define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT)-3) +# define DPI_AWARENESS_CONTEXT_UNAWARE ((DPI_AWARENESS_CONTEXT) - 1) +# define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT) - 2) +# define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT) - 3) # define DPI_AWARENESS_CONTEXT_DECLARED #endif // (DPI_AWARENESS_CONTEXT_DECLARED) diff --git a/mozglue/misc/WindowsUnwindInfo.h b/mozglue/misc/WindowsUnwindInfo.h index 3667b5f2bc80..be76670d2d98 100644 --- a/mozglue/misc/WindowsUnwindInfo.h +++ b/mozglue/misc/WindowsUnwindInfo.h @@ -290,7 +290,7 @@ class IterableUnwindInfo { : mInfo(aInfo), mIndex(aIndex), mSlotsCount(aSlotsCount), - mIsValid(aIsValid){}; + mIsValid(aIsValid) {}; UnwindInfo& mInfo; uint8_t mIndex; diff --git a/netwerk/dns/DNSAdditionalInfo.h b/netwerk/dns/DNSAdditionalInfo.h index 658b9623dd6c..2df274f1078b 100644 --- a/netwerk/dns/DNSAdditionalInfo.h +++ b/netwerk/dns/DNSAdditionalInfo.h @@ -16,7 +16,7 @@ class DNSAdditionalInfo : public nsIDNSAdditionalInfo { NS_DECL_NSIDNSADDITIONALINFO public: explicit DNSAdditionalInfo(const nsACString& aURL, int32_t aPort) - : mURL(aURL), mPort(aPort){}; + : mURL(aURL), mPort(aPort) {}; static nsCString URL(nsIDNSAdditionalInfo* aInfo) { nsCString url; if (aInfo) { diff --git a/netwerk/dns/HTTPSSVC.cpp b/netwerk/dns/HTTPSSVC.cpp index d36bdf91a26d..2a292d0947e7 100644 --- a/netwerk/dns/HTTPSSVC.cpp +++ b/netwerk/dns/HTTPSSVC.cpp @@ -33,7 +33,7 @@ class SvcParam : public nsISVCParam, NS_DECL_NSISVCPARAMIPV6HINT NS_DECL_NSISVCPARAMODOHCONFIG public: - explicit SvcParam(const SvcParamType& value) : mValue(value){}; + explicit SvcParam(const SvcParamType& value) : mValue(value) {}; private: virtual ~SvcParam() = default; diff --git a/netwerk/protocol/http/nsAHttpTransaction.h b/netwerk/protocol/http/nsAHttpTransaction.h index 06912c369590..de49af71fbda 100644 --- a/netwerk/protocol/http/nsAHttpTransaction.h +++ b/netwerk/protocol/http/nsAHttpTransaction.h @@ -184,7 +184,7 @@ class nsAHttpTransaction : public nsSupportsWeakReference { virtual void SetIsHttp2Websocket(bool) {} virtual bool IsHttp2Websocket() { return false; } virtual void SetTRRInfo(nsIRequest::TRRMode aMode, - TRRSkippedReason aSkipReason){}; + TRRSkippedReason aSkipReason) {}; // We call this function if we want to use alt-svc host again on the next // restart. If this function is not called on the next restart the diff --git a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp index de9927386207..e6a87ccf73f0 100644 --- a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp +++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp @@ -523,7 +523,7 @@ bool mozTXTToHTMLConv::FindURL(const char16_t* aInString, int32_t aInLength, state[check] = success; } } // if - } // for + } // for return state[check] == success; } @@ -933,12 +933,10 @@ int32_t mozTXTToHTMLConv::CiteLevelTXT(const char16_t* line, uint32_t i = logLineStart; #ifdef QUOTE_RECOGNITION_AGGRESSIVE - for (; int32_t(i) < lineLength && IsSpace(line[i]); i++) - ; + for (; int32_t(i) < lineLength && IsSpace(line[i]); i++); for (; int32_t(i) < lineLength && IsAsciiAlpha(line[i]) && nsCRT::IsUpper(line[i]); - i++) - ; + i++); if (int32_t(i) < lineLength && (line[i] == '>' || line[i] == ']')) #else if (int32_t(i) < lineLength && line[i] == '>') diff --git a/netwerk/wifi/freebsd/FreeBsdWifiScanner.cpp b/netwerk/wifi/freebsd/FreeBsdWifiScanner.cpp index c2a27d5ee280..f6dd6e73cc8e 100644 --- a/netwerk/wifi/freebsd/FreeBsdWifiScanner.cpp +++ b/netwerk/wifi/freebsd/FreeBsdWifiScanner.cpp @@ -31,8 +31,8 @@ using namespace mozilla; #define LOG(args) MOZ_LOG(gWifiMonitorLog, mozilla::LogLevel::Debug, args) -WifiScannerImpl::WifiScannerImpl(){}; -WifiScannerImpl::~WifiScannerImpl(){}; +WifiScannerImpl::WifiScannerImpl() {}; +WifiScannerImpl::~WifiScannerImpl() {}; nsresult WifiScannerImpl::GetAccessPointsFromWLAN( nsTArray>& accessPoints) { diff --git a/parser/html/nsHtml5String.h b/parser/html/nsHtml5String.h index d6864cdbf7bc..3f0fbd4d9a4b 100644 --- a/parser/html/nsHtml5String.h +++ b/parser/html/nsHtml5String.h @@ -129,7 +129,7 @@ class nsHtml5String final { /** * Constructor from raw bits. */ - explicit nsHtml5String(uintptr_t aBits) : mBits(aBits){}; + explicit nsHtml5String(uintptr_t aBits) : mBits(aBits) {}; /** * Zero if null, one if empty, otherwise tagged pointer diff --git a/parser/html/nsHtml5TreeOperation.h b/parser/html/nsHtml5TreeOperation.h index fd38cd8a24fb..841317817bce 100644 --- a/parser/html/nsHtml5TreeOperation.h +++ b/parser/html/nsHtml5TreeOperation.h @@ -217,7 +217,7 @@ struct opAppendCommentToDocument { int32_t mLength; explicit opAppendCommentToDocument(char16_t* aBuffer, int32_t aLength) - : mBuffer(aBuffer), mLength(aLength){}; + : mBuffer(aBuffer), mLength(aLength) {}; }; class nsHtml5TreeOperationStringPair { @@ -320,7 +320,7 @@ struct opGetFosterParent { struct opMarkAsBroken { nsresult mResult; - explicit opMarkAsBroken(nsresult aResult) : mResult(aResult){}; + explicit opMarkAsBroken(nsresult aResult) : mResult(aResult) {}; }; struct opRunScriptThatMayDocumentWriteOrBlock { @@ -372,7 +372,7 @@ struct opUpdateCharsetSource { nsCharsetSource mCharsetSource; explicit opUpdateCharsetSource(nsCharsetSource aCharsetSource) - : mCharsetSource(aCharsetSource){}; + : mCharsetSource(aCharsetSource) {}; }; struct opCharsetSwitchTo { @@ -384,7 +384,7 @@ struct opCharsetSwitchTo { int32_t aCharsetSource, int32_t aLineNumber) : mEncoding(aEncoding), mCharsetSource(aCharsetSource), - mLineNumber(aLineNumber){}; + mLineNumber(aLineNumber) {}; }; struct opUpdateStyleSheet { @@ -398,7 +398,7 @@ struct opUpdateStyleSheet { struct opProcessOfflineManifest { char16_t* mUrl; - explicit opProcessOfflineManifest(char16_t* aUrl) : mUrl(aUrl){}; + explicit opProcessOfflineManifest(char16_t* aUrl) : mUrl(aUrl) {}; }; struct opMarkMalformedIfScript { @@ -449,14 +449,14 @@ struct opMaybeComplainAboutCharset { explicit opMaybeComplainAboutCharset(char* aMsgId, bool aError, int32_t aLineNumber) - : mMsgId(aMsgId), mError(aError), mLineNumber(aLineNumber){}; + : mMsgId(aMsgId), mError(aError), mLineNumber(aLineNumber) {}; }; struct opMaybeComplainAboutDeepTree { int32_t mLineNumber; explicit opMaybeComplainAboutDeepTree(int32_t aLineNumber) - : mLineNumber(aLineNumber){}; + : mLineNumber(aLineNumber) {}; }; struct opAddClass { @@ -486,7 +486,7 @@ struct opAddViewSourceBase { int32_t mLength; explicit opAddViewSourceBase(char16_t* aBuffer, int32_t aLength) - : mBuffer(aBuffer), mLength(aLength){}; + : mBuffer(aBuffer), mLength(aLength) {}; }; struct opAddErrorType { diff --git a/parser/htmlparser/nsExpatDriver.cpp b/parser/htmlparser/nsExpatDriver.cpp index 4da2444f84cc..d365cec7dee9 100644 --- a/parser/htmlparser/nsExpatDriver.cpp +++ b/parser/htmlparser/nsExpatDriver.cpp @@ -734,7 +734,7 @@ class RLBoxExpatClosure { public: RLBoxExpatClosure(RLBoxExpatSandboxData* aSbxData, tainted_expat aExpatParser) - : mSbxData(aSbxData), mExpatParser(aExpatParser){}; + : mSbxData(aSbxData), mExpatParser(aExpatParser) {}; inline rlbox_sandbox_expat* Sandbox() const { return mSbxData->Sandbox(); }; inline tainted_expat Parser() const { return mExpatParser; }; diff --git a/parser/htmlparser/nsParser.cpp b/parser/htmlparser/nsParser.cpp index 04d02e2084a8..0d81e1c4ad2e 100644 --- a/parser/htmlparser/nsParser.cpp +++ b/parser/htmlparser/nsParser.cpp @@ -891,7 +891,7 @@ static bool ExtractCharsetFromXmlDeclaration(const unsigned char* aBytes, } } } // if (!versionFound) - } // for + } // for } return !oCharset.IsEmpty(); } diff --git a/testing/gtest/mozilla/WaitFor.h b/testing/gtest/mozilla/WaitFor.h index 86df72fb108b..4444d7aef39a 100644 --- a/testing/gtest/mozilla/WaitFor.h +++ b/testing/gtest/mozilla/WaitFor.h @@ -88,8 +88,8 @@ template using TakeNPromise = MozPromise>, bool, true>; template -auto TakeN(MediaEventSourceImpl& aEvent, size_t aN) - -> RefPtr> { +auto TakeN(MediaEventSourceImpl& aEvent, + size_t aN) -> RefPtr> { using Storage = std::vector>; using Promise = TakeNPromise; using Values = media::Refcountable; diff --git a/testing/mochitest/ssltunnel/ssltunnel.cpp b/testing/mochitest/ssltunnel/ssltunnel.cpp index 4e61b96d3e55..53b9822bf71a 100644 --- a/testing/mochitest/ssltunnel/ssltunnel.cpp +++ b/testing/mochitest/ssltunnel/ssltunnel.cpp @@ -919,10 +919,10 @@ void HandleConnection(void* data) { buffers[s2].compact(); } } - } // PR_POLL_WRITE handling + } // PR_POLL_WRITE handling LOG_END_BLOCK(); // end the log - } // for... - } // while, poll + } // for... + } // while, poll } else client_error = true; diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtectionStorage.h b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtectionStorage.h index 8d1d4e0417e9..36cbbcad174c 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtectionStorage.h +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtectionStorage.h @@ -41,7 +41,7 @@ class BounceTrackingProtectionStorage final : public nsIObserver, public: BounceTrackingProtectionStorage() : mMonitor("mozilla::BounceTrackingProtectionStorage::mMonitor"), - mPendingWrites(0){}; + mPendingWrites(0) {}; // Initialises the storage including the on-disk database. [[nodiscard]] nsresult Init(); diff --git a/toolkit/components/ctypes/tests/jsctypes-test.cpp b/toolkit/components/ctypes/tests/jsctypes-test.cpp index 6170e08c124b..9f0e191a57f4 100644 --- a/toolkit/components/ctypes/tests/jsctypes-test.cpp +++ b/toolkit/components/ctypes/tests/jsctypes-test.cpp @@ -121,8 +121,7 @@ CTYPES_FOR_EACH_TYPE(DEFINE_CDECL_TYPE_STATS) template int32_t StrLen(const T* string) { const T* end; - for (end = string; *end; ++end) - ; + for (end = string; *end; ++end); return end - string; } diff --git a/toolkit/components/mediasniffer/nsMediaSniffer.h b/toolkit/components/mediasniffer/nsMediaSniffer.h index 9608e2e643c5..369c53fb52aa 100644 --- a/toolkit/components/mediasniffer/nsMediaSniffer.h +++ b/toolkit/components/mediasniffer/nsMediaSniffer.h @@ -20,11 +20,8 @@ #define NS_MEDIA_SNIFFER_CONTRACTID "@mozilla.org/media/sniffer;1" -#define PATTERN_ENTRY(mask, pattern, contentType) \ - { \ - (const uint8_t*)mask, (const uint8_t*)pattern, sizeof(mask) - 1, \ - contentType \ - } +#define PATTERN_ENTRY(mask, pattern, contentType) \ + {(const uint8_t*)mask, (const uint8_t*)pattern, sizeof(mask) - 1, contentType} struct nsMediaSnifferEntry { const uint8_t* mMask; diff --git a/toolkit/components/places/tests/gtest/places_test_harness.h b/toolkit/components/places/tests/gtest/places_test_harness.h index f1f1d388cdba..936b9346eaf2 100644 --- a/toolkit/components/places/tests/gtest/places_test_harness.h +++ b/toolkit/components/places/tests/gtest/places_test_harness.h @@ -49,8 +49,7 @@ struct Test { void (*func)(void); const char* const name; }; -#define PTEST(aName) \ - { aName, #aName } +#define PTEST(aName) {aName, #aName} /** * Runs the next text. diff --git a/toolkit/components/telemetry/core/Telemetry.cpp b/toolkit/components/telemetry/core/Telemetry.cpp index 3214210c3926..5f99375dac49 100644 --- a/toolkit/components/telemetry/core/Telemetry.cpp +++ b/toolkit/components/telemetry/core/Telemetry.cpp @@ -1361,8 +1361,7 @@ struct TrackedDBEntry { TrackedDBEntry(TrackedDBEntry&) = delete; }; -#define TRACKEDDB_ENTRY(_name) \ - { _name, (sizeof(_name) - 1) } +#define TRACKEDDB_ENTRY(_name) {_name, (sizeof(_name) - 1)} // An allowlist of database names. If the database name exactly matches one of // these then its SQL statements will always be recorded. diff --git a/toolkit/components/telemetry/core/TelemetryScalar.cpp b/toolkit/components/telemetry/core/TelemetryScalar.cpp index 312e25ddc4b6..5c863e00976c 100644 --- a/toolkit/components/telemetry/core/TelemetryScalar.cpp +++ b/toolkit/components/telemetry/core/TelemetryScalar.cpp @@ -796,7 +796,7 @@ class KeyedScalar { : mScalarName(info.name()), mScalarKeyCount(info.key_count), mScalarKeyOffset(info.key_offset), - mMaximumNumberOfKeys(kMaximumNumberOfKeys){}; + mMaximumNumberOfKeys(kMaximumNumberOfKeys) {}; ~KeyedScalar() = default; // Set, Add and SetMaximum functions as described in the Telemetry IDL. diff --git a/toolkit/components/telemetry/pingsender/pingsender_unix_common.cpp b/toolkit/components/telemetry/pingsender/pingsender_unix_common.cpp index 1f201d177e61..5f71f2304585 100644 --- a/toolkit/components/telemetry/pingsender/pingsender_unix_common.cpp +++ b/toolkit/components/telemetry/pingsender/pingsender_unix_common.cpp @@ -90,19 +90,17 @@ CurlWrapper::~CurlWrapper() { bool CurlWrapper::Init() { const char* libcurlPaths[] = { #if defined(XP_MACOSX) - // macOS - "/usr/lib/libcurl.dylib", - "/usr/lib/libcurl.4.dylib", - "/usr/lib/libcurl.3.dylib", + // macOS + "/usr/lib/libcurl.dylib", + "/usr/lib/libcurl.4.dylib", + "/usr/lib/libcurl.3.dylib", #else // Linux, *BSD, ... - "libcurl.so", - "libcurl.so.4", - // Debian gives libcurl a different name when it is built against GnuTLS - "libcurl-gnutls.so", - "libcurl-gnutls.so.4", - // Older versions in case we find nothing better - "libcurl.so.3", - "libcurl-gnutls.so.3", // See above for Debian + "libcurl.so", "libcurl.so.4", + // Debian gives libcurl a different name when it is built against GnuTLS + "libcurl-gnutls.so", "libcurl-gnutls.so.4", + // Older versions in case we find nothing better + "libcurl.so.3", + "libcurl-gnutls.so.3", // See above for Debian #endif }; diff --git a/toolkit/mozapps/update/updater/launchchild_osx.mm b/toolkit/mozapps/update/updater/launchchild_osx.mm index b64e85980c22..7af2bafce341 100644 --- a/toolkit/mozapps/update/updater/launchchild_osx.mm +++ b/toolkit/mozapps/update/updater/launchchild_osx.mm @@ -369,8 +369,7 @@ bool ObtainUpdaterArguments(int* aArgc, char*** aArgv, while ([self shouldKeepRunning] && [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode - beforeDate:[NSDate distantFuture]]) - ; + beforeDate:[NSDate distantFuture]]); return ![self wasAborted]; } diff --git a/toolkit/system/androidproxy/nsAndroidSystemProxySettings.cpp b/toolkit/system/androidproxy/nsAndroidSystemProxySettings.cpp index 15dabfe14f4d..50674d8d096b 100644 --- a/toolkit/system/androidproxy/nsAndroidSystemProxySettings.cpp +++ b/toolkit/system/androidproxy/nsAndroidSystemProxySettings.cpp @@ -16,7 +16,7 @@ class nsAndroidSystemProxySettings : public nsISystemProxySettings { NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISYSTEMPROXYSETTINGS - nsAndroidSystemProxySettings(){}; + nsAndroidSystemProxySettings() {}; private: virtual ~nsAndroidSystemProxySettings() {} @@ -49,7 +49,7 @@ nsAndroidSystemProxySettings::GetSystemWPADSetting(bool* aSystemWPADSetting) { return NS_OK; } -void test(){}; +void test() {}; NS_IMPL_COMPONENT_FACTORY(nsAndroidSystemProxySettings) { return mozilla::MakeAndAddRef() diff --git a/toolkit/system/windowsDHCPClient/WindowsNetworkFunctionsWrapper.h b/toolkit/system/windowsDHCPClient/WindowsNetworkFunctionsWrapper.h index 2da6a9ff33d3..d6276e25abcd 100644 --- a/toolkit/system/windowsDHCPClient/WindowsNetworkFunctionsWrapper.h +++ b/toolkit/system/windowsDHCPClient/WindowsNetworkFunctionsWrapper.h @@ -24,7 +24,7 @@ namespace windowsDHCPClient { class WindowsNetworkFunctionsWrapper : nsISupports { public: NS_DECL_THREADSAFE_ISUPPORTS - WindowsNetworkFunctionsWrapper(){}; + WindowsNetworkFunctionsWrapper() {}; virtual ULONG GetAdaptersAddressesWrapped( _In_ ULONG aFamily, _In_ ULONG aFlags, _In_ PVOID aReserved, @@ -38,7 +38,7 @@ class WindowsNetworkFunctionsWrapper : nsISupports { _Inout_ LPDWORD apSize, _In_ LPWSTR aRequestIdStr); protected: - virtual ~WindowsNetworkFunctionsWrapper(){}; + virtual ~WindowsNetworkFunctionsWrapper() {}; }; } // namespace windowsDHCPClient diff --git a/toolkit/system/windowsDHCPClient/nsWindowsDHCPClient.h b/toolkit/system/windowsDHCPClient/nsWindowsDHCPClient.h index d1d3eac0f055..d2f26601352e 100644 --- a/toolkit/system/windowsDHCPClient/nsWindowsDHCPClient.h +++ b/toolkit/system/windowsDHCPClient/nsWindowsDHCPClient.h @@ -21,10 +21,10 @@ class nsWindowsDHCPClient final : public nsIDHCPClient { explicit nsWindowsDHCPClient( WindowsNetworkFunctionsWrapper* aNetworkFunctions = new WindowsNetworkFunctionsWrapper()) - : mNetworkFunctions(aNetworkFunctions){}; + : mNetworkFunctions(aNetworkFunctions) {}; private: - ~nsWindowsDHCPClient(){}; + ~nsWindowsDHCPClient() {}; WindowsNetworkFunctionsWrapper* mNetworkFunctions; }; diff --git a/toolkit/system/windowsPackageManager/nsWindowsPackageManager.h b/toolkit/system/windowsPackageManager/nsWindowsPackageManager.h index 30cc8a288e1d..f2fa38e732f4 100644 --- a/toolkit/system/windowsPackageManager/nsWindowsPackageManager.h +++ b/toolkit/system/windowsPackageManager/nsWindowsPackageManager.h @@ -18,7 +18,7 @@ class nsWindowsPackageManager final : public nsIWindowsPackageManager { NS_DECL_NSIWINDOWSPACKAGEMANAGER private: - ~nsWindowsPackageManager(){}; + ~nsWindowsPackageManager() {}; }; } // namespace system diff --git a/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp b/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp index 94487505c3d2..202ba77d5fd0 100644 --- a/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp +++ b/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp @@ -23,10 +23,10 @@ class nsWindowsSystemProxySettings final : public nsISystemProxySettings { NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISYSTEMPROXYSETTINGS - nsWindowsSystemProxySettings(){}; + nsWindowsSystemProxySettings() {}; private: - ~nsWindowsSystemProxySettings(){}; + ~nsWindowsSystemProxySettings() {}; bool MatchOverride(const nsACString& aHost); bool PatternMatch(const nsACString& aHost, const nsACString& aOverride); diff --git a/toolkit/xre/dllservices/tests/TestDllInterceptor.cpp b/toolkit/xre/dllservices/tests/TestDllInterceptor.cpp index 166b9012c2f1..8d921b8c68c0 100644 --- a/toolkit/xre/dllservices/tests/TestDllInterceptor.cpp +++ b/toolkit/xre/dllservices/tests/TestDllInterceptor.cpp @@ -76,7 +76,7 @@ struct payload { }; extern "C" __declspec(dllexport) __declspec(noinline) payload - rotatePayload(payload p) { +rotatePayload(payload p) { UINT64 tmp = p.a; p.a = p.b; p.b = p.c; @@ -88,7 +88,7 @@ extern "C" __declspec(dllexport) __declspec(noinline) payload // We cannot use rotatePayload for that purpose because our detour cannot hook // a function detoured already. Please keep this function always unhooked. extern "C" __declspec(dllexport) __declspec(noinline) payload - payloadNotHooked(payload p) { +payloadNotHooked(payload p) { // Do something different from rotatePayload to avoid ICF. p.a ^= p.b; p.b ^= p.c; diff --git a/toolkit/xre/dllservices/tests/gtest/TestDLLBlocklist.cpp b/toolkit/xre/dllservices/tests/gtest/TestDLLBlocklist.cpp index 938f63a524f1..4daa3301ba04 100644 --- a/toolkit/xre/dllservices/tests/gtest/TestDLLBlocklist.cpp +++ b/toolkit/xre/dllservices/tests/gtest/TestDLLBlocklist.cpp @@ -66,7 +66,7 @@ class TestDLLLoadObserver : public nsIObserver { explicit TestDLLLoadObserver(DLLFilter dllFilter) : mDllFilter(std::move(dllFilter)), mMainThreadNotificationsCount(0), - mNonMainThreadNotificationsCount(0){}; + mNonMainThreadNotificationsCount(0) {}; NS_DECL_THREADSAFE_ISUPPORTS diff --git a/toolkit/xre/nsNativeAppSupportUnix.cpp b/toolkit/xre/nsNativeAppSupportUnix.cpp index bed9e546db2d..b606f0891175 100644 --- a/toolkit/xre/nsNativeAppSupportUnix.cpp +++ b/toolkit/xre/nsNativeAppSupportUnix.cpp @@ -124,7 +124,7 @@ class nsNativeAppSupportUnix : public nsNativeAppSupportBase { public: #if MOZ_X11 nsNativeAppSupportUnix() - : mSessionConnection(nullptr), mClientState(STATE_DISCONNECTED){}; + : mSessionConnection(nullptr), mClientState(STATE_DISCONNECTED) {}; ~nsNativeAppSupportUnix() { // this goes out of scope after "web-workers-shutdown" async shutdown phase // so it's safe to disconnect here (i.e. the application won't lose data) @@ -143,7 +143,7 @@ class nsNativeAppSupportUnix : public nsNativeAppSupportBase { Bool fast); static void DieCB(SmcConn smc_conn, SmPointer client_data); static void InteractCB(SmcConn smc_conn, SmPointer client_data); - static void SaveCompleteCB(SmcConn smc_conn, SmPointer client_data){}; + static void SaveCompleteCB(SmcConn smc_conn, SmPointer client_data) {}; static void ShutdownCancelledCB(SmcConn smc_conn, SmPointer client_data); void DoInteract(); void SetClientState(ClientState aState) { diff --git a/tools/jprof/leaky.cpp b/tools/jprof/leaky.cpp index 91e9d8aa8239..7cc0ca394869 100644 --- a/tools/jprof/leaky.cpp +++ b/tools/jprof/leaky.cpp @@ -575,8 +575,7 @@ void leaky::generateReportHTML(FILE* fp, int* countArray, int count, int totalTimerHits = count; int* rankingTable = new int[usefulSymbols]; - for (int cnt = usefulSymbols; --cnt >= 0; rankingTable[cnt] = cnt) - ; + for (int cnt = usefulSymbols; --cnt >= 0; rankingTable[cnt] = cnt); // Drat. I would use ::qsort() but I would need a global variable and my // intro-pascal professor threatened to flunk anyone who used globals. diff --git a/tools/jprof/stub/libmalloc.cpp b/tools/jprof/stub/libmalloc.cpp index 3003543a93ce..c249cf9e4b8a 100644 --- a/tools/jprof/stub/libmalloc.cpp +++ b/tools/jprof/stub/libmalloc.cpp @@ -610,7 +610,7 @@ NS_EXPORT_(void) setupProfilingStuff(void) { timerMilliSec = 0; /* This makes JP_FIRST work right. */ realTime = 1; /* It's the _R_TC and all. ;) */ -# define IS_POWER_OF_TWO(x) (((x) & ((x)-1)) == 0) +# define IS_POWER_OF_TWO(x) (((x) & ((x) - 1)) == 0) if (!IS_POWER_OF_TWO(rtcHz) || rtcHz < 2) { fprintf(stderr, diff --git a/tools/profiler/core/PowerCounters.h b/tools/profiler/core/PowerCounters.h index df511e87ec09..e9adf00f591d 100644 --- a/tools/profiler/core/PowerCounters.h +++ b/tools/profiler/core/PowerCounters.h @@ -54,7 +54,7 @@ class PowerCounters { defined(GP_PLAT_amd64_linux) || defined(GP_PLAT_arm64_android) explicit PowerCounters(); #else - explicit PowerCounters(){}; + explicit PowerCounters() {}; #endif #if defined(_MSC_VER) || defined(GP_PLAT_amd64_darwin) || \ defined(GP_PLAT_arm64_android) @@ -66,7 +66,7 @@ class PowerCounters { defined(GP_PLAT_arm64_android) void Sample(); #else - void Sample(){}; + void Sample() {}; #endif using CountVector = mozilla::Vector, 4>; diff --git a/tools/profiler/core/ProfilerCPUFreq.h b/tools/profiler/core/ProfilerCPUFreq.h index a01f1277c9f9..00a1e596b227 100644 --- a/tools/profiler/core/ProfilerCPUFreq.h +++ b/tools/profiler/core/ProfilerCPUFreq.h @@ -46,9 +46,9 @@ class ProfilerCPUFreq { uint32_t GetCPUSpeedMHz(unsigned cpuId); # endif #else - explicit ProfilerCPUFreq(){}; - ~ProfilerCPUFreq(){}; - void Sample(){}; + explicit ProfilerCPUFreq() {}; + ~ProfilerCPUFreq() {}; + void Sample() {}; #endif private: diff --git a/tools/profiler/core/shared-libraries-linux.cc b/tools/profiler/core/shared-libraries-linux.cc index fce1ecfa5c8a..ec969e98e2eb 100644 --- a/tools/profiler/core/shared-libraries-linux.cc +++ b/tools/profiler/core/shared-libraries-linux.cc @@ -277,5 +277,4 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf() { return info; } -void SharedLibraryInfo::Initialize() { /* do nothing */ -} +void SharedLibraryInfo::Initialize() { /* do nothing */ } diff --git a/tools/profiler/core/shared-libraries-win32.cc b/tools/profiler/core/shared-libraries-win32.cc index 1dc0d06836bd..44423952620d 100644 --- a/tools/profiler/core/shared-libraries-win32.cc +++ b/tools/profiler/core/shared-libraries-win32.cc @@ -142,5 +142,4 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoFromPath(const wchar_t* aPath) { return sharedLibraryInfo; } -void SharedLibraryInfo::Initialize() { /* do nothing */ -} +void SharedLibraryInfo::Initialize() { /* do nothing */ } diff --git a/tools/profiler/public/ETWTools.h b/tools/profiler/public/ETWTools.h index cbd73004babc..e7c172f5b146 100644 --- a/tools/profiler/public/ETWTools.h +++ b/tools/profiler/public/ETWTools.h @@ -329,8 +329,8 @@ static inline void EmitETWMarker(const mozilla::ProfilerString8View& aName, return; } - static const __declspec(allocate(_tlgSegMetadataEvents)) __declspec( - align(1)) constexpr StaticMetaData + static const __declspec(allocate(_tlgSegMetadataEvents)) + __declspec(align(1)) constexpr StaticMetaData staticData; // Allocate the exact amount of descriptors required by this event. diff --git a/tools/profiler/tests/gtest/LulTestInfrastructure.h b/tools/profiler/tests/gtest/LulTestInfrastructure.h index 83b239fb73e4..305ecbeab899 100644 --- a/tools/profiler/tests/gtest/LulTestInfrastructure.h +++ b/tools/profiler/tests/gtest/LulTestInfrastructure.h @@ -258,7 +258,7 @@ enum Endianness { class Section { public: explicit Section(Endianness endianness = kUnsetEndian) - : endianness_(endianness){}; + : endianness_(endianness) {}; // A base class destructor should be either public and virtual, // or protected and nonvirtual. diff --git a/uriloader/exthandler/mac/nsDecodeAppleFile.cpp b/uriloader/exthandler/mac/nsDecodeAppleFile.cpp index 69f13ab8c815..1bd053b68b35 100644 --- a/uriloader/exthandler/mac/nsDecodeAppleFile.cpp +++ b/uriloader/exthandler/mac/nsDecodeAppleFile.cpp @@ -180,8 +180,7 @@ NS_IMETHODIMP nsDecodeAppleFile::Write(const char* buffer, uint32_t bufferSize, m_headers.magic == APPLESINGLE_MAGIC) && m_headers.version == VERSION && m_headers.entriesCount) { /* Just to be sure, the filler must contains only 0 */ - for (i = 0; i < 4 && m_headers.fill[i] == 0L; i++) - ; + for (i = 0; i < 4 && m_headers.fill[i] == 0L; i++); if (i == 4) m_state = parseEntries; } m_dataBufferLength = 0; diff --git a/uriloader/exthandler/nsOSHelperAppServiceChild.h b/uriloader/exthandler/nsOSHelperAppServiceChild.h index 05c2195d10e1..400bd01019c2 100644 --- a/uriloader/exthandler/nsOSHelperAppServiceChild.h +++ b/uriloader/exthandler/nsOSHelperAppServiceChild.h @@ -19,7 +19,7 @@ class nsIMIMEInfo; */ class nsOSHelperAppServiceChild : public nsExternalHelperAppService { public: - nsOSHelperAppServiceChild(){}; + nsOSHelperAppServiceChild() {}; virtual ~nsOSHelperAppServiceChild() = default; NS_IMETHOD GetProtocolHandlerInfoFromOS(const nsACString& aScheme, diff --git a/widget/android/jni/Natives.h b/widget/android/jni/Natives.h index 45b351ba215c..f9739f3e885f 100644 --- a/widget/android/jni/Natives.h +++ b/widget/android/jni/Natives.h @@ -279,10 +279,11 @@ class NativePtrPicker { // so we only enable this overload if Impl is refcounted AND it does not // implement OnWeakNonIntrusiveDetach. Yields type REFPTR. template - static auto Test(void*) -> std::enable_if_t< - std::conjunction_v, - std::negation>>, - ResultTypeT>; + static auto Test(void*) + -> std::enable_if_t< + std::conjunction_v, + std::negation>>, + ResultTypeT>; // This overload uses '...' as its param to make its arguments less specific; // the compiler prefers more-specific overloads to less-specific ones. diff --git a/widget/gtk/DBusMenu.cpp b/widget/gtk/DBusMenu.cpp index 8672de40ef8d..8ba7739f4ab5 100644 --- a/widget/gtk/DBusMenu.cpp +++ b/widget/gtk/DBusMenu.cpp @@ -34,8 +34,9 @@ static bool sLibPresent; return sLibPresent; } sInitialized = true; -#define FUNC(name, type, params) \ - {#name, (DBusMenuFunc*)&DBusMenuFunctions::s_##name}, +#define FUNC(name, type, params) \ + { #name, (DBusMenuFunc*)&DBusMenuFunctions::s_##name } \ + , static const DBusMenuDynamicFunction kDbusmenuGlibSymbols[] = { DBUSMENU_GLIB_FUNCTIONS}; static const DBusMenuDynamicFunction kDbusmenuGtkSymbols[] = { diff --git a/widget/gtk/DMABufSurface.h b/widget/gtk/DMABufSurface.h index 9bb8928cca92..6849b07f130e 100644 --- a/widget/gtk/DMABufSurface.h +++ b/widget/gtk/DMABufSurface.h @@ -161,7 +161,7 @@ class DMABufSurface { virtual void ReleaseSurface() = 0; #ifdef DEBUG - virtual void DumpToFile(const char* pFile){}; + virtual void DumpToFile(const char* pFile) {}; #endif DMABufSurface(SurfaceType aSurfaceType); diff --git a/widget/gtk/WaylandBuffer.h b/widget/gtk/WaylandBuffer.h index 34bdb87ff50e..1de136258b91 100644 --- a/widget/gtk/WaylandBuffer.h +++ b/widget/gtk/WaylandBuffer.h @@ -49,7 +49,7 @@ class WaylandBuffer { virtual already_AddRefed Lock() { return nullptr; }; virtual void* GetImageData() { return nullptr; } virtual GLuint GetTexture() { return 0; } - virtual void DestroyGLResources(){}; + virtual void DestroyGLResources() {}; LayoutDeviceIntSize GetSize() { return mSize; }; bool IsMatchingSize(const LayoutDeviceIntSize& aSize) { diff --git a/widget/gtk/nsNativeThemeGTK.cpp b/widget/gtk/nsNativeThemeGTK.cpp index 5c858d231344..54f331992c19 100644 --- a/widget/gtk/nsNativeThemeGTK.cpp +++ b/widget/gtk/nsNativeThemeGTK.cpp @@ -947,9 +947,8 @@ bool nsNativeThemeGTK::GetWidgetOverflow(nsDeviceContext* aContext, return true; } -auto nsNativeThemeGTK::IsWidgetNonNative(nsIFrame* aFrame, - StyleAppearance aAppearance) - -> NonNative { +auto nsNativeThemeGTK::IsWidgetNonNative( + nsIFrame* aFrame, StyleAppearance aAppearance) -> NonNative { if (IsWidgetAlwaysNonNative(aFrame, aAppearance)) { return NonNative::Always; } diff --git a/widget/gtk/nsSound.cpp b/widget/gtk/nsSound.cpp index 0530c7322410..81dd18d880b2 100644 --- a/widget/gtk/nsSound.cpp +++ b/widget/gtk/nsSound.cpp @@ -63,7 +63,7 @@ static ca_proplist_sets_fn ca_proplist_sets; static ca_context_play_full_fn ca_context_play_full; struct ScopedCanberraFile { - explicit ScopedCanberraFile(nsIFile* file) : mFile(file){}; + explicit ScopedCanberraFile(nsIFile* file) : mFile(file) {}; ~ScopedCanberraFile() { if (mFile) { diff --git a/widget/gtk/nsUserIdleServiceGTK.cpp b/widget/gtk/nsUserIdleServiceGTK.cpp index 4cdc5ba13dd4..8f7e3f3b3371 100644 --- a/widget/gtk/nsUserIdleServiceGTK.cpp +++ b/widget/gtk/nsUserIdleServiceGTK.cpp @@ -120,7 +120,7 @@ class UserIdleServiceX11 : public UserIdleServiceImpl { } explicit UserIdleServiceX11(nsUserIdleServiceGTK* aUserIdleService) - : UserIdleServiceImpl(aUserIdleService){}; + : UserIdleServiceImpl(aUserIdleService) {}; ~UserIdleServiceX11() { # ifdef MOZ_X11 @@ -238,7 +238,7 @@ class UserIdleServiceMutter : public UserIdleServiceImpl { } explicit UserIdleServiceMutter(nsUserIdleServiceGTK* aUserIdleService) - : UserIdleServiceImpl(aUserIdleService){}; + : UserIdleServiceImpl(aUserIdleService) {}; ~UserIdleServiceMutter() { if (mCancellable) { diff --git a/widget/gtk/nsUserIdleServiceGTK.h b/widget/gtk/nsUserIdleServiceGTK.h index 1a5ed9784068..3a683de78bc4 100644 --- a/widget/gtk/nsUserIdleServiceGTK.h +++ b/widget/gtk/nsUserIdleServiceGTK.h @@ -17,7 +17,7 @@ class nsUserIdleServiceGTK; class UserIdleServiceImpl { public: explicit UserIdleServiceImpl(nsUserIdleServiceGTK* aUserIdleService) - : mUserIdleServiceGTK(aUserIdleService){}; + : mUserIdleServiceGTK(aUserIdleService) {}; virtual bool PollIdleTime(uint32_t* aIdleTime) = 0; virtual bool ProbeImplementation() = 0; diff --git a/widget/gtk/vaapitest/vaapitest.cpp b/widget/gtk/vaapitest/vaapitest.cpp index e2c0e0a742bc..6c824a5895c7 100644 --- a/widget/gtk/vaapitest/vaapitest.cpp +++ b/widget/gtk/vaapitest/vaapitest.cpp @@ -52,8 +52,7 @@ static constexpr struct { VAProfile mVAProfile; const char* mName; } kVAAPiProfileName[] = { -#define MAP(v) \ - { VAProfile##v, #v } +#define MAP(v) {VAProfile##v, #v} MAP(H264ConstrainedBaseline), MAP(H264Main), MAP(H264High), diff --git a/widget/headless/HeadlessLookAndFeel.h b/widget/headless/HeadlessLookAndFeel.h index 4e61b9e95d5f..0c212015e59a 100644 --- a/widget/headless/HeadlessLookAndFeel.h +++ b/widget/headless/HeadlessLookAndFeel.h @@ -34,7 +34,7 @@ class HeadlessLookAndFeel : public nsXPLookAndFeel { explicit HeadlessLookAndFeel(); virtual ~HeadlessLookAndFeel(); - void NativeInit() final{}; + void NativeInit() final {}; nsresult NativeGetInt(IntID, int32_t& aResult) override; nsresult NativeGetFloat(FloatID, float& aResult) override; nsresult NativeGetColor(ColorID, ColorScheme, nscolor& aResult) override; diff --git a/widget/tests/gtest/TestTimeConverter.cpp b/widget/tests/gtest/TestTimeConverter.cpp index 22cbc3f9e61e..84df6f93c869 100644 --- a/widget/tests/gtest/TestTimeConverter.cpp +++ b/widget/tests/gtest/TestTimeConverter.cpp @@ -97,11 +97,12 @@ using TimeConverter = SystemTimeConverter; // Checks the expectation that the TimeStamp `ts` is exactly `ms` milliseconds // after the baseline timestamp. This is a macro so gtest still gives us useful // line numbers for failures. -#define EXPECT_TS(ts, ms) \ - EXPECT_EQ((ts)-MockTimeStamp::Baseline(), TimeDuration::FromMilliseconds(ms)) +#define EXPECT_TS(ts, ms) \ + EXPECT_EQ((ts) - MockTimeStamp::Baseline(), \ + TimeDuration::FromMilliseconds(ms)) #define EXPECT_TS_FUZZY(ts, ms) \ - EXPECT_DOUBLE_EQ(((ts)-MockTimeStamp::Baseline()).ToMilliseconds(), ms) + EXPECT_DOUBLE_EQ(((ts) - MockTimeStamp::Baseline()).ToMilliseconds(), ms) TEST(TimeConverter, SanityCheck) { diff --git a/widget/windows/ScreenHelperWin.h b/widget/windows/ScreenHelperWin.h index 275014232a5e..c0d11a87712c 100644 --- a/widget/windows/ScreenHelperWin.h +++ b/widget/windows/ScreenHelperWin.h @@ -14,7 +14,7 @@ namespace widget { class ScreenHelperWin final : public ScreenManager::Helper { public: - ScreenHelperWin(){}; + ScreenHelperWin() {}; ~ScreenHelperWin() override {} static void RefreshScreens(); diff --git a/widget/windows/nsNativeThemeWin.cpp b/widget/windows/nsNativeThemeWin.cpp index b988fb4ec58a..1cbad3777c9b 100644 --- a/widget/windows/nsNativeThemeWin.cpp +++ b/widget/windows/nsNativeThemeWin.cpp @@ -70,9 +70,8 @@ bool nsNativeThemeWin::IsWidgetAlwaysNonNative(nsIFrame* aFrame, aAppearance == StyleAppearance::SpinnerDownbutton; } -auto nsNativeThemeWin::IsWidgetNonNative(nsIFrame* aFrame, - StyleAppearance aAppearance) - -> NonNative { +auto nsNativeThemeWin::IsWidgetNonNative( + nsIFrame* aFrame, StyleAppearance aAppearance) -> NonNative { if (IsWidgetAlwaysNonNative(aFrame, aAppearance)) { return NonNative::Always; } diff --git a/widget/windows/nsWindowDbg.cpp b/widget/windows/nsWindowDbg.cpp index 8125a8532b21..929f9a5a2c39 100644 --- a/widget/windows/nsWindowDbg.cpp +++ b/widget/windows/nsWindowDbg.cpp @@ -391,8 +391,7 @@ void RectParamInfo(nsCString& str, uint64_t value, const char* name, rect->top, rect->right, rect->bottom); } -#define VALANDNAME_ENTRY(_msg) \ - { _msg, #_msg } +#define VALANDNAME_ENTRY(_msg) {_msg, #_msg} void CreateStructParamInfo(nsCString& str, uint64_t value, const char* name, bool /* isPreCall */) { diff --git a/widget/windows/tests/gtest/TestJumpListBuilder.cpp b/widget/windows/tests/gtest/TestJumpListBuilder.cpp index 531e3264658d..c2160c90b7e1 100644 --- a/widget/windows/tests/gtest/TestJumpListBuilder.cpp +++ b/widget/windows/tests/gtest/TestJumpListBuilder.cpp @@ -255,7 +255,7 @@ class TestingJumpListBackend : public JumpListBackend { Monitor& GetMonitor() { return mMonitor; } protected: - virtual ~TestingJumpListBackend() override{}; + virtual ~TestingJumpListBackend() override {}; private: Monitor mMonitor; diff --git a/xpcom/base/AvailableMemoryWatcher.h b/xpcom/base/AvailableMemoryWatcher.h index a5acfbb7c538..ec137e5035a5 100644 --- a/xpcom/base/AvailableMemoryWatcher.h +++ b/xpcom/base/AvailableMemoryWatcher.h @@ -60,9 +60,9 @@ class nsAvailableMemoryWatcherBase : public nsIAvailableMemoryWatcherBase, nsAvailableMemoryWatcherBase(); #if defined(XP_DARWIN) - virtual void OnMemoryPressureChanged(MacMemoryPressureLevel aNewLevel){}; + virtual void OnMemoryPressureChanged(MacMemoryPressureLevel aNewLevel) {}; virtual void AddChildAnnotations( - const UniquePtr& aCrashReporter){}; + const UniquePtr& aCrashReporter) {}; #endif NS_DECL_THREADSAFE_ISUPPORTS diff --git a/xpcom/base/AvailableMemoryWatcherMac.cpp b/xpcom/base/AvailableMemoryWatcherMac.cpp index de6901f8d58d..1ebdd4738a95 100644 --- a/xpcom/base/AvailableMemoryWatcherMac.cpp +++ b/xpcom/base/AvailableMemoryWatcherMac.cpp @@ -75,7 +75,7 @@ class nsAvailableMemoryWatcher final : public nsITimerCallback, const UniquePtr& aCrashReporter) override; private: - ~nsAvailableMemoryWatcher(){}; + ~nsAvailableMemoryWatcher() {}; void OnMemoryPressureChangedInternal(MacMemoryPressureLevel aNewLevel, bool aIsInitialLevel); diff --git a/xpcom/base/RLBoxSandboxPool.h b/xpcom/base/RLBoxSandboxPool.h index 47f389354896..2564605efbd3 100644 --- a/xpcom/base/RLBoxSandboxPool.h +++ b/xpcom/base/RLBoxSandboxPool.h @@ -42,7 +42,7 @@ class RLBoxSandboxPool : public nsITimerCallback, public nsINamed { RLBoxSandboxPool(size_t aDelaySeconds = 10) : mPool(), mDelaySeconds(aDelaySeconds), - mMutex("RLBoxSandboxPool::mMutex"){}; + mMutex("RLBoxSandboxPool::mMutex") {}; void Push(UniquePtr sbx); // PopOrCreate returns a sandbox from the pool if the pool is not empty and diff --git a/xpcom/base/nsDebugImpl.cpp b/xpcom/base/nsDebugImpl.cpp index 81305ccdb9e2..ffbb26495c48 100644 --- a/xpcom/base/nsDebugImpl.cpp +++ b/xpcom/base/nsDebugImpl.cpp @@ -184,6 +184,7 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult) { defined(__NetBSD__) || defined(__OpenBSD__) // Specify the info we're looking for int mib[] = { + // clang-format off CTL_KERN, KERN_PROC, KERN_PROC_PID, @@ -192,6 +193,7 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult) { sizeof(KINFO_PROC), 1, # endif + // clang-format on }; u_int mibSize = sizeof(mib) / sizeof(int); diff --git a/xpcom/base/nsDumpUtils.h b/xpcom/base/nsDumpUtils.h index 7aa9c6b735c8..fb4844101ad3 100644 --- a/xpcom/base/nsDumpUtils.h +++ b/xpcom/base/nsDumpUtils.h @@ -56,7 +56,7 @@ class FdWatcher : public MessageLoopForIO::Watcher, public nsIObserver { * function is also called when you're at eof (read() returns 0 in this case). */ virtual void OnFileCanReadWithoutBlocking(int aFd) override = 0; - virtual void OnFileCanWriteWithoutBlocking(int aFd) override{}; + virtual void OnFileCanWriteWithoutBlocking(int aFd) override {}; NS_DECL_THREADSAFE_ISUPPORTS diff --git a/xpcom/base/nsMacPreferencesReader.h b/xpcom/base/nsMacPreferencesReader.h index 40d5af553a71..49b78b0b9186 100644 --- a/xpcom/base/nsMacPreferencesReader.h +++ b/xpcom/base/nsMacPreferencesReader.h @@ -25,7 +25,7 @@ class nsMacPreferencesReader : public nsIMacPreferencesReader { NS_DECL_ISUPPORTS NS_DECL_NSIMACPREFERENCESREADER - nsMacPreferencesReader(){}; + nsMacPreferencesReader() {}; protected: virtual ~nsMacPreferencesReader() = default; diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index a3a2a247f678..f4ef9ff72345 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -194,6 +194,7 @@ using namespace dom; return NS_ERROR_FAILURE; # endif int mib[] = { + // clang-format off CTL_KERN, KERN_PROC, KERN_PROC_PID, @@ -202,6 +203,7 @@ using namespace dom; sizeof(KINFO_PROC), 1, # endif + // clang-format on }; u_int miblen = sizeof(mib) / sizeof(mib[0]); size_t size = sizeof(KINFO_PROC); diff --git a/xpcom/build/perfprobe.h b/xpcom/build/perfprobe.h index e5a038232274..cdfddd5024d4 100644 --- a/xpcom/build/perfprobe.h +++ b/xpcom/build/perfprobe.h @@ -47,7 +47,7 @@ class Probe { nsresult Trigger(); protected: - ~Probe(){}; + ~Probe() {}; Probe(const nsCID& aGUID, const nsACString& aName, ProbeManager* aManager); friend class ProbeManager; diff --git a/xpcom/ds/PLDHashTable.h b/xpcom/ds/PLDHashTable.h index f1d741791ca9..4667cd1afd0c 100644 --- a/xpcom/ds/PLDHashTable.h +++ b/xpcom/ds/PLDHashTable.h @@ -600,8 +600,8 @@ class PLDHashTable { }; template - auto WithEntryHandle(const void* aKey, F&& aFunc) - -> std::invoke_result_t { + auto WithEntryHandle(const void* aKey, + F&& aFunc) -> std::invoke_result_t { return std::forward(aFunc)(MakeEntryHandle(aKey)); } diff --git a/xpcom/ds/Tokenizer.cpp b/xpcom/ds/Tokenizer.cpp index 3b0f6b02dd23..279d09ca6448 100644 --- a/xpcom/ds/Tokenizer.cpp +++ b/xpcom/ds/Tokenizer.cpp @@ -549,7 +549,7 @@ auto TokenizerBase::Parse(Token& aToken) const -> aToken = Token::Char(*mCursor); return next; } // switch (state) - } // while (next < end) + } // while (next < end) MOZ_ASSERT(!mInputFinished); return mCursor; diff --git a/xpcom/ds/nsExpirationTracker.h b/xpcom/ds/nsExpirationTracker.h index cc35017b2a25..6a8bacb924a8 100644 --- a/xpcom/ds/nsExpirationTracker.h +++ b/xpcom/ds/nsExpirationTracker.h @@ -374,14 +374,14 @@ class ExpirationTrackerImpl { * done while still holding the lock. It will be called once after each timer * event, and each low memory event has been handled. */ - virtual void NotifyHandlerEndLocked(const AutoLock&){}; + virtual void NotifyHandlerEndLocked(const AutoLock&) {}; /** * This may be overridden to perform any post-aging work that needs to be * done outside the lock. It will be called once after each * NotifyEndTransactionLocked call. */ - virtual void NotifyHandlerEnd(){}; + virtual void NotifyHandlerEnd() {}; virtual Mutex& GetMutex() = 0; diff --git a/xpcom/ds/nsTArray.h b/xpcom/ds/nsTArray.h index c088f1c4bdd2..1689051993e4 100644 --- a/xpcom/ds/nsTArray.h +++ b/xpcom/ds/nsTArray.h @@ -2474,11 +2474,9 @@ auto nsTArray_Impl::AssignInternal(const Item* aArray, template template -auto nsTArray_Impl::ReplaceElementsAtInternal(index_type aStart, - size_type aCount, - const Item* aArray, - size_type aArrayLen) - -> value_type* { +auto nsTArray_Impl::ReplaceElementsAtInternal( + index_type aStart, size_type aCount, const Item* aArray, + size_type aArrayLen) -> value_type* { if (MOZ_UNLIKELY(aStart > Length())) { mozilla::detail::InvalidArrayIndex_CRASH(aStart, Length()); } @@ -2576,10 +2574,8 @@ auto nsTArray_Impl::RemoveElementsBy(Predicate aPredicate) template template -auto nsTArray_Impl::InsertElementsAtInternal(index_type aIndex, - size_type aCount, - const Item& aItem) - -> value_type* { +auto nsTArray_Impl::InsertElementsAtInternal( + index_type aIndex, size_type aCount, const Item& aItem) -> value_type* { if (!ActualAlloc::Successful(this->template InsertSlotsAt( aIndex, aCount, sizeof(value_type), MOZ_ALIGNOF(value_type)))) { return nullptr; @@ -2617,9 +2613,8 @@ auto nsTArray_Impl::InsertElementAtInternal(index_type aIndex) template template -auto nsTArray_Impl::InsertElementAtInternal(index_type aIndex, - Item&& aItem) - -> value_type* { +auto nsTArray_Impl::InsertElementAtInternal( + index_type aIndex, Item&& aItem) -> value_type* { if (MOZ_UNLIKELY(aIndex > Length())) { mozilla::detail::InvalidArrayIndex_CRASH(aIndex, Length()); } @@ -2638,9 +2633,8 @@ auto nsTArray_Impl::InsertElementAtInternal(index_type aIndex, template template -auto nsTArray_Impl::AppendElementsInternal(const Item* aArray, - size_type aArrayLen) - -> value_type* { +auto nsTArray_Impl::AppendElementsInternal( + const Item* aArray, size_type aArrayLen) -> value_type* { if (!ActualAlloc::Successful(this->template ExtendCapacity( Length(), aArrayLen, sizeof(value_type)))) { return nullptr; diff --git a/xpcom/ds/nsTHashtable.h b/xpcom/ds/nsTHashtable.h index d4a385551f0a..b991261de495 100644 --- a/xpcom/ds/nsTHashtable.h +++ b/xpcom/ds/nsTHashtable.h @@ -429,8 +429,8 @@ class MOZ_NEEDS_NO_VTABLE_TYPE nsTHashtable { }; template - auto WithEntryHandle(KeyType aKey, F&& aFunc) - -> std::invoke_result_t { + auto WithEntryHandle(KeyType aKey, + F&& aFunc) -> std::invoke_result_t { return this->mTable.WithEntryHandle( EntryType::KeyToPointer(aKey), [&aKey, &aFunc](auto entryHandle) -> decltype(auto) { @@ -874,8 +874,8 @@ class nsTHashtable> }; template - auto WithEntryHandle(KeyType aKey, F aFunc) - -> std::invoke_result_t { + auto WithEntryHandle(KeyType aKey, + F aFunc) -> std::invoke_result_t { return Base::WithEntryHandle(aKey, [&aFunc](auto entryHandle) { return aFunc(EntryHandle{std::move(entryHandle)}); }); diff --git a/xpcom/string/nsTSubstring.cpp b/xpcom/string/nsTSubstring.cpp index 5658b794c635..0cdd83d353e7 100644 --- a/xpcom/string/nsTSubstring.cpp +++ b/xpcom/string/nsTSubstring.cpp @@ -97,13 +97,10 @@ nsTSubstring::BulkWrite(size_type aCapacity, size_type aPrefixToPreserve, } template -auto nsTSubstring::StartBulkWriteImpl(size_type aCapacity, - size_type aPrefixToPreserve, - bool aAllowShrinking, - size_type aSuffixLength, - size_type aOldSuffixStart, - size_type aNewSuffixStart) - -> mozilla::Result { +auto nsTSubstring::StartBulkWriteImpl( + size_type aCapacity, size_type aPrefixToPreserve, bool aAllowShrinking, + size_type aSuffixLength, size_type aOldSuffixStart, + size_type aNewSuffixStart) -> mozilla::Result { // Note! Capacity does not include room for the terminating null char. MOZ_ASSERT(aPrefixToPreserve <= aCapacity, @@ -1024,8 +1021,7 @@ void nsTSubstring::StripChars(const char_type* aChars) { char_type theChar = *from++; const char_type* test = aChars; - for (; *test && *test != theChar; ++test) - ; + for (; *test && *test != theChar; ++test); if (!*test) { // Not stripped, copy this char. diff --git a/xpcom/tests/TestStreamUtils.cpp b/xpcom/tests/TestStreamUtils.cpp index 1a24656617d4..cb42564c938f 100644 --- a/xpcom/tests/TestStreamUtils.cpp +++ b/xpcom/tests/TestStreamUtils.cpp @@ -38,8 +38,7 @@ static bool test_consume_stream() { //---- typedef bool (*TestFunc)(); -#define DECL_TEST(name) \ - { #name, name } +#define DECL_TEST(name) {#name, name} static const struct Test { const char* name; diff --git a/xpcom/tests/gtest/TestExpirationTracker.cpp b/xpcom/tests/gtest/TestExpirationTracker.cpp index de55d6f90731..3d44fd3da553 100644 --- a/xpcom/tests/gtest/TestExpirationTracker.cpp +++ b/xpcom/tests/gtest/TestExpirationTracker.cpp @@ -171,8 +171,7 @@ static bool test_random4() { return test_random<4>(); } static bool test_random8() { return test_random<8>(); } typedef bool (*TestFunc)(); -#define DECL_TEST(name) \ - { #name, name } +#define DECL_TEST(name) {#name, name} static const struct Test { const char* name; diff --git a/xpcom/tests/gtest/TestMozPromise.cpp b/xpcom/tests/gtest/TestMozPromise.cpp index 02dbef711442..2e8a8fb601e1 100644 --- a/xpcom/tests/gtest/TestMozPromise.cpp +++ b/xpcom/tests/gtest/TestMozPromise.cpp @@ -447,9 +447,7 @@ TEST(MozPromise, Chaining) } // We will hit the assertion if we don't disconnect the leaf Request // in the promise chain. - p->Then( - queue, __func__, []() {}, []() {}) - ->Track(holder); + p->Then(queue, __func__, []() {}, []() {})->Track(holder); }); } diff --git a/xpcom/tests/gtest/TestTArray2.cpp b/xpcom/tests/gtest/TestTArray2.cpp index 2ccf7df4fa97..d265e4415de7 100644 --- a/xpcom/tests/gtest/TestTArray2.cpp +++ b/xpcom/tests/gtest/TestTArray2.cpp @@ -83,11 +83,9 @@ static bool test_basic_array(ElementType* data, size_t dataLen, if (ary.Length() != (oldLen - 1)) return false; if (!(ary == ary)) return false; - if (ary.ApplyIf( - extra, []() { return true; }, []() { return false; })) + if (ary.ApplyIf(extra, []() { return true; }, []() { return false; })) return false; - if (ary.ApplyIf( - extra, [](size_t) { return true; }, []() { return false; })) + if (ary.ApplyIf(extra, [](size_t) { return true; }, []() { return false; })) return false; // On a non-const array, ApplyIf's first lambda may use either const or non- // const element types. @@ -107,8 +105,7 @@ static bool test_basic_array(ElementType* data, size_t dataLen, []() { return false; })) return false; - if (cary.ApplyIf( - extra, []() { return true; }, []() { return false; })) + if (cary.ApplyIf(extra, []() { return true; }, []() { return false; })) if (cary.ApplyIf( extra, [](size_t) { return true; }, []() { return false; })) // On a const array, ApplyIf's first lambda must only use const element @@ -159,11 +156,9 @@ static bool test_basic_array(ElementType* data, size_t dataLen, ary.Clear(); if (ary.IndexOf(extra) != ary.NoIndex) return false; if (ary.LastIndexOf(extra) != ary.NoIndex) return false; - if (ary.ApplyIf( - extra, []() { return true; }, []() { return false; })) + if (ary.ApplyIf(extra, []() { return true; }, []() { return false; })) return false; - if (cary.ApplyIf( - extra, []() { return true; }, []() { return false; })) + if (cary.ApplyIf(extra, []() { return true; }, []() { return false; })) return false; ary.Clear(); @@ -986,8 +981,8 @@ TEST(TArray, test_indexof) // we should not find the 5! auto no_index = array.NoIndex; // Fixes gtest compilation error. ASSERT_EQ(array.IndexOf(5, 1), no_index); - ASSERT_FALSE(array.ApplyIf( - 5, 1, []() { return true; }, []() { return false; })); + ASSERT_FALSE( + array.ApplyIf(5, 1, []() { return true; }, []() { return false; })); } //---- diff --git a/xpcom/tests/gtest/TestThreadUtils.cpp b/xpcom/tests/gtest/TestThreadUtils.cpp index 96b134288597..e334d74fda4e 100644 --- a/xpcom/tests/gtest/TestThreadUtils.cpp +++ b/xpcom/tests/gtest/TestThreadUtils.cpp @@ -1059,7 +1059,7 @@ struct SpyWithISupports : public ISpyWithISupports, public Spy { virtual ~SpyWithISupports() = default; public: - explicit SpyWithISupports(int aID) : Spy(aID){}; + explicit SpyWithISupports(int aID) : Spy(aID) {}; NS_DECL_ISUPPORTS NS_IMETHOD_(nsrefcnt) RefCnt() override { return mRefCnt; } NS_IMETHOD_(int32_t) ID() override { return mID; } diff --git a/xpcom/threads/MozPromise.h b/xpcom/threads/MozPromise.h index 3155d9ea63d3..b89ea39726e6 100644 --- a/xpcom/threads/MozPromise.h +++ b/xpcom/threads/MozPromise.h @@ -1109,21 +1109,21 @@ class MozPromise : public MozPromiseBase { template auto Then(Ts&&... aArgs) -> decltype(std::declval().Then( - std::forward(aArgs)...)) { + std::forward(aArgs)...)) { return static_cast>(*this)->Then( std::forward(aArgs)...); } template auto Map(Ts&&... aArgs) -> decltype(std::declval().Map( - std::forward(aArgs)...)) { + std::forward(aArgs)...)) { return static_cast>(*this)->Map( std::forward(aArgs)...); } template auto MapErr(Ts&&... aArgs) -> decltype(std::declval().MapErr( - std::forward(aArgs)...)) { + std::forward(aArgs)...)) { return static_cast>(*this)->MapErr( std::forward(aArgs)...); } @@ -1586,7 +1586,7 @@ class MozPromiseHolder public: using MozPromiseHolderBase< PromiseType, MozPromiseHolder>::MozPromiseHolderBase; - static constexpr void Check(){}; + static constexpr void Check() {}; }; template diff --git a/xpcom/threads/nsIIdleRunnable.h b/xpcom/threads/nsIIdleRunnable.h index 7fe614915417..2b9e001a8566 100644 --- a/xpcom/threads/nsIIdleRunnable.h +++ b/xpcom/threads/nsIIdleRunnable.h @@ -31,7 +31,7 @@ class nsIIdleRunnable : public nsISupports { * Notify the task of a point in time in the future when the task * should stop executing. */ - virtual void SetDeadline(mozilla::TimeStamp aDeadline){}; + virtual void SetDeadline(mozilla::TimeStamp aDeadline) {}; virtual void SetTimer(uint32_t aDelay, nsIEventTarget* aTarget) { MOZ_ASSERT_UNREACHABLE( "The nsIIdleRunnable instance does not support " diff --git a/xpcom/threads/nsTimerImpl.cpp b/xpcom/threads/nsTimerImpl.cpp index b350e9c0a9be..6c2b0a211b7e 100644 --- a/xpcom/threads/nsTimerImpl.cpp +++ b/xpcom/threads/nsTimerImpl.cpp @@ -44,7 +44,7 @@ using mozilla::TimeStamp; // the timer thread. class TimerThreadWrapper { public: - constexpr TimerThreadWrapper() : mThread(nullptr){}; + constexpr TimerThreadWrapper() : mThread(nullptr) {}; ~TimerThreadWrapper() = default; nsresult Init();