From f9ad6258221d89d8ee8e543c2ff8b21a42dbd285 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 10 Nov 2023 23:34:34 +0100 Subject: Issue #2342 - Fix attribute order in misc files (found by clang builds) --- dom/base/nsContentAreaDragDrop.cpp | 3 +-- js/src/builtin/SymbolObject.h | 20 ++++++++++---------- js/src/ds/InlineTable.h | 16 ++++++++-------- js/src/ds/LifoAlloc.h | 4 ++-- js/src/frontend/BytecodeEmitter.h | 4 ++-- js/src/wasm/WasmTextUtils.cpp | 8 ++++---- 6 files changed, 27 insertions(+), 28 deletions(-) diff --git a/dom/base/nsContentAreaDragDrop.cpp b/dom/base/nsContentAreaDragDrop.cpp index 49aeb2a774..9e23767e96 100644 --- a/dom/base/nsContentAreaDragDrop.cpp +++ b/dom/base/nsContentAreaDragDrop.cpp @@ -84,8 +84,7 @@ private: nsIContent **outImageOrLinkNode, bool* outDragSelectedText); static already_AddRefed FindParentLinkNode(nsIContent* inNode); - static [[nodiscard]] nsresult - GetAnchorURL(nsIContent* inNode, nsAString& outURL); + [[nodiscard]] static nsresult GetAnchorURL(nsIContent* inNode, nsAString& outURL); static void GetNodeString(nsIContent* inNode, nsAString & outNodeString); static void CreateLinkText(const nsAString& inURL, const nsAString & inText, nsAString& outLinkText); diff --git a/js/src/builtin/SymbolObject.h b/js/src/builtin/SymbolObject.h index 96d8010bdd..49f608583c 100644 --- a/js/src/builtin/SymbolObject.h +++ b/js/src/builtin/SymbolObject.h @@ -38,22 +38,22 @@ class SymbolObject : public NativeObject setFixedSlot(PRIMITIVE_VALUE_SLOT, SymbolValue(symbol)); } - static [[nodiscard]] bool construct(JSContext* cx, unsigned argc, Value* vp); + [[nodiscard]] static bool construct(JSContext* cx, unsigned argc, Value* vp); // Static methods. - static [[nodiscard]] bool for_(JSContext* cx, unsigned argc, Value* vp); - static [[nodiscard]] bool keyFor(JSContext* cx, unsigned argc, Value* vp); + [[nodiscard]] static bool for_(JSContext* cx, unsigned argc, Value* vp); + [[nodiscard]] static bool keyFor(JSContext* cx, unsigned argc, Value* vp); // Methods defined on Symbol.prototype. - static [[nodiscard]] bool toString_impl(JSContext* cx, const CallArgs& args); - static [[nodiscard]] bool toString(JSContext* cx, unsigned argc, Value* vp); - static [[nodiscard]] bool valueOf_impl(JSContext* cx, const CallArgs& args); - static [[nodiscard]] bool valueOf(JSContext* cx, unsigned argc, Value* vp); - static [[nodiscard]] bool toPrimitive(JSContext* cx, unsigned argc, Value* vp); + [[nodiscard]] static bool toString_impl(JSContext* cx, const CallArgs& args); + [[nodiscard]] static bool toString(JSContext* cx, unsigned argc, Value* vp); + [[nodiscard]] static bool valueOf_impl(JSContext* cx, const CallArgs& args); + [[nodiscard]] static bool valueOf(JSContext* cx, unsigned argc, Value* vp); + [[nodiscard]] static bool toPrimitive(JSContext* cx, unsigned argc, Value* vp); // Properties defined on Symbol.prototype. - static [[nodiscard]] bool descriptionGetter_impl(JSContext* cx, const CallArgs& args); - static [[nodiscard]] bool descriptionGetter(JSContext* cx, unsigned argc, Value *vp); + [[nodiscard]] static bool descriptionGetter_impl(JSContext* cx, const CallArgs& args); + [[nodiscard]] static bool descriptionGetter(JSContext* cx, unsigned argc, Value *vp); static const JSPropertySpec properties[]; static const JSFunctionSpec methods[]; diff --git a/js/src/ds/InlineTable.h b/js/src/ds/InlineTable.h index 5793e78533..26ba284f0e 100644 --- a/js/src/ds/InlineTable.h +++ b/js/src/ds/InlineTable.h @@ -90,8 +90,8 @@ class InlineTable return true; } - MOZ_NEVER_INLINE - [[nodiscard]] bool switchAndAdd(const InlineEntry& entry) { + [[nodiscard]] MOZ_NEVER_INLINE + bool switchAndAdd(const InlineEntry& entry) { if (!switchToTable()) return false; @@ -284,8 +284,8 @@ class InlineTable template - MOZ_ALWAYS_INLINE - [[nodiscard]] bool add(AddPtr& p, KeyInput&& key, Args&&... args) { + [[nodiscard]] MOZ_ALWAYS_INLINE + bool add(AddPtr& p, KeyInput&& key, Args&&... args) { MOZ_ASSERT(!p); MOZ_ASSERT(keyNonZero(key)); @@ -530,8 +530,8 @@ class InlineMap } template - MOZ_ALWAYS_INLINE - [[nodiscard]] bool add(AddPtr& p, KeyInput&& key, ValueInput&& value) { + [[nodiscard]] MOZ_ALWAYS_INLINE + bool add(AddPtr& p, KeyInput&& key, ValueInput&& value) { return impl_.add(p, mozilla::Forward(key), mozilla::Forward(value)); } @@ -661,8 +661,8 @@ class InlineSet } template - MOZ_ALWAYS_INLINE - [[nodiscard]] bool add(AddPtr& p, TInput&& key) { + [[nodiscard]] MOZ_ALWAYS_INLINE + bool add(AddPtr& p, TInput&& key) { return impl_.add(p, mozilla::Forward(key)); } diff --git a/js/src/ds/LifoAlloc.h b/js/src/ds/LifoAlloc.h index 1c64dd44d9..0e4e544cad 100644 --- a/js/src/ds/LifoAlloc.h +++ b/js/src/ds/LifoAlloc.h @@ -312,8 +312,8 @@ class LifoAlloc // Ensures that enough space exists to satisfy N bytes worth of // allocation requests, not necessarily contiguous. Note that this does // not guarantee a successful single allocation of N bytes. - MOZ_ALWAYS_INLINE - [[nodiscard]] bool ensureUnusedApproximate(size_t n) { + [[nodiscard]] MOZ_ALWAYS_INLINE + bool ensureUnusedApproximate(size_t n) { AutoFallibleScope fallibleAllocator(this); size_t total = 0; for (BumpChunk* chunk = latest; chunk; chunk = chunk->next()) { diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter.h index 0ce4f6c1a3..aef575b1cd 100644 --- a/js/src/frontend/BytecodeEmitter.h +++ b/js/src/frontend/BytecodeEmitter.h @@ -299,8 +299,8 @@ struct MOZ_STACK_CLASS BytecodeEmitter Scope* outermostScope() const { return scopeList.vector[0]; } Scope* innermostScope() const; - MOZ_ALWAYS_INLINE - [[nodiscard]] bool makeAtomIndex(JSAtom* atom, uint32_t* indexp) { + [[nodiscard]] MOZ_ALWAYS_INLINE + bool makeAtomIndex(JSAtom* atom, uint32_t* indexp) { MOZ_ASSERT(atomIndices); AtomIndexMap::AddPtr p = atomIndices->lookupForAdd(atom); if (p) { diff --git a/js/src/wasm/WasmTextUtils.cpp b/js/src/wasm/WasmTextUtils.cpp index b09504fa2b..5cff1c9ce1 100644 --- a/js/src/wasm/WasmTextUtils.cpp +++ b/js/src/wasm/WasmTextUtils.cpp @@ -27,7 +27,7 @@ using namespace js::jit; using mozilla::IsNaN; template -bool +[[nodiscard]] bool js::wasm::RenderInBase(StringBuffer& sb, uint64_t num) { uint64_t n = num; @@ -52,7 +52,7 @@ js::wasm::RenderInBase(StringBuffer& sb, uint64_t num) template bool js::wasm::RenderInBase<10>(StringBuffer& sb, uint64_t num); template -bool +[[nodiscard]] bool js::wasm::RenderNaN(StringBuffer& sb, Raw num) { typedef typename mozilla::FloatingPoint Traits; @@ -73,5 +73,5 @@ js::wasm::RenderNaN(StringBuffer& sb, Raw num) RenderInBase<16>(sb, payload); } -template [[nodiscard]] bool js::wasm::RenderNaN(StringBuffer& b, Raw num); -template [[nodiscard]] bool js::wasm::RenderNaN(StringBuffer& b, Raw num); +template bool js::wasm::RenderNaN(StringBuffer& b, Raw num); +template bool js::wasm::RenderNaN(StringBuffer& b, Raw num); -- cgit v1.2.3