Skip to content

Commit

Permalink
Bug 1856795 - ride along: use = default; on some recently modified fi…
Browse files Browse the repository at this point in the history
…les r=emilio

More on:
https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html

Command:
L=$(hg export -r tip|grep +++|cut -d/ -f2-)
./mach static-analysis check --checks="-*, modernize-use-equals-default" --fix $L

Differential Revision: https://phabricator.services.mozilla.com/D191016
  • Loading branch information
sylvestre committed Oct 15, 2023
1 parent d0f6c7f commit 1e77675
Show file tree
Hide file tree
Showing 39 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion accessible/atk/ApplicationAccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using namespace mozilla::a11y;

// ApplicationAccessibleWrap

ApplicationAccessibleWrap::ApplicationAccessibleWrap() {}
ApplicationAccessibleWrap::ApplicationAccessibleWrap() = default;

ApplicationAccessibleWrap::~ApplicationAccessibleWrap() {
AccessibleWrap::ShutdownAtkObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ using testing::ReturnRef;

// A mock DeserializedStackFrame for testing.
struct MockDeserializedStackFrame : public DeserializedStackFrame {
MockDeserializedStackFrame() {}
MockDeserializedStackFrame() = default;
};

DEF_TEST(DeserializedStackFrameUbiStackFrames, {
Expand Down
2 changes: 1 addition & 1 deletion devtools/shared/heapsnapshot/tests/gtest/DevTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ MATCHER_P(EdgeTo, id, "") {
// A mock `Writer` class to be used with testing `WriteHeapGraph`.
class MockWriter : public CoreDumpWriter {
public:
virtual ~MockWriter() override {}
virtual ~MockWriter() override = default;
MOCK_METHOD2(writeNode,
bool(const JS::ubi::Node&, CoreDumpWriter::EdgePolicy));
MOCK_METHOD1(writeMetadata, bool(uint64_t));
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsFrameMessageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ class nsAsyncMessageToSameProcessParent
: public nsSameProcessAsyncMessageBase,
public SameProcessMessageQueue::Runnable {
public:
nsAsyncMessageToSameProcessParent() {}
nsAsyncMessageToSameProcessParent() = default;
nsresult HandleMessage() override {
nsFrameMessageManager* ppm =
nsFrameMessageManager::sSameProcessParentManager;
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsGlobalWindowOuter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ const nsOuterWindowProxy nsOuterWindowProxy::singleton;

class nsChromeOuterWindowProxy : public nsOuterWindowProxy {
public:
constexpr nsChromeOuterWindowProxy() {}
constexpr nsChromeOuterWindowProxy() = default;

const char* className(JSContext* cx,
JS::Handle<JSObject*> wrapper) const override;
Expand Down
2 changes: 1 addition & 1 deletion dom/html/ConstraintValidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ bool ConstraintValidation::CheckValidity() {
return nsIConstraintValidation::CheckValidity(*content);
}

ConstraintValidation::ConstraintValidation() {}
ConstraintValidation::ConstraintValidation() = default;

void ConstraintValidation::SetCustomValidity(const nsAString& aError) {
mCustomValidity.Assign(aError);
Expand Down
2 changes: 1 addition & 1 deletion dom/ipc/SharedMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static inline void AlignTo(size_t* aOffset, size_t aAlign) {
}
}

SharedMap::SharedMap() {}
SharedMap::SharedMap() = default;

SharedMap::SharedMap(nsIGlobalObject* aGlobal, const FileDescriptor& aMapFile,
size_t aMapSize, nsTArray<RefPtr<BlobImpl>>&& aBlobs)
Expand Down
2 changes: 1 addition & 1 deletion dom/media/gtest/TestWebMWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const uint32_t FIXED_FRAMESIZE = 500;

class TestWebMWriter : public WebMWriter {
public:
TestWebMWriter() {}
TestWebMWriter() = default;

// When we append an I-Frame into WebM muxer, the muxer will treat previous
// data as "a cluster".
Expand Down
6 changes: 3 additions & 3 deletions dom/media/webrtc/sdp/SdpAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class SdpAttribute {
};

explicit SdpAttribute(AttributeType type) : mType(type) {}
virtual ~SdpAttribute() {}
virtual ~SdpAttribute() = default;

virtual SdpAttribute* Clone() const = 0;

Expand Down Expand Up @@ -1228,7 +1228,7 @@ class SdpFmtpAttributeList : public SdpAttribute {
explicit Parameters(SdpRtpmapAttributeList::CodecType aCodec)
: codec_type(aCodec) {}

virtual ~Parameters() {}
virtual ~Parameters() = default;
virtual Parameters* Clone() const = 0;
virtual void Serialize(std::ostream& os) const = 0;
virtual bool CompareEq(const Parameters& other) const = 0;
Expand Down Expand Up @@ -1269,7 +1269,7 @@ class SdpFmtpAttributeList : public SdpAttribute {

RtxParameters() : Parameters(SdpRtpmapAttributeList::kRtx) {}

virtual ~RtxParameters() {}
virtual ~RtxParameters() = default;

virtual Parameters* Clone() const override {
return new RtxParameters(*this);
Expand Down
2 changes: 1 addition & 1 deletion dom/media/webrtc/transport/stun_socket_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static std::ostream& operator<<(std::ostream& aStream, UINT12 aId) {

class STUNUDPSocketFilter : public nsISocketFilter {
public:
STUNUDPSocketFilter() {}
STUNUDPSocketFilter() = default;

// Allocated/freed and used on the PBackground IPC thread
NS_DECL_ISUPPORTS
Expand Down
2 changes: 1 addition & 1 deletion dom/media/webrtc/transport/test/ice_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static std::string Resolve(const std::string& fqdn, int address_family) {

class StunTest : public MtransportTest {
public:
StunTest() {}
StunTest() = default;

void SetUp() override {
MtransportTest::SetUp();
Expand Down
2 changes: 1 addition & 1 deletion gfx/2d/Path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static double CubicRoot(double aValue) {
struct PointD : public BasePoint<double, PointD> {
typedef BasePoint<double, PointD> Super;

PointD() {}
PointD() = default;
PointD(double aX, double aY) : Super(aX, aY) {}
MOZ_IMPLICIT PointD(const Point& aPoint) : Super(aPoint.x, aPoint.y) {}

Expand Down
2 changes: 1 addition & 1 deletion gfx/vr/service/PuppetSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using namespace mozilla::gfx;

namespace mozilla::gfx {

PuppetSession::PuppetSession() {}
PuppetSession::PuppetSession() = default;

PuppetSession::~PuppetSession() { Shutdown(); }

Expand Down
4 changes: 2 additions & 2 deletions image/imgFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class DrawableFrameRef final {
typedef gfx::DataSourceSurface DataSourceSurface;

public:
DrawableFrameRef() {}
DrawableFrameRef() = default;

explicit DrawableFrameRef(imgFrame* aFrame) : mFrame(aFrame) {
MOZ_ASSERT(aFrame);
Expand Down Expand Up @@ -373,7 +373,7 @@ class RawAccessFrameRef final {
aOther.mData = nullptr;
}

~RawAccessFrameRef() {}
~RawAccessFrameRef() = default;

RawAccessFrameRef& operator=(RawAccessFrameRef&& aOther) {
MOZ_ASSERT(this != &aOther, "Self-moves are prohibited");
Expand Down
4 changes: 2 additions & 2 deletions ipc/chromium/src/base/histogram.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ double Histogram::GetPeakBucketSize(const SampleSet& snapshot) const {

Histogram::SampleSet::SampleSet() : sum_(0), redundant_count_(0) {}

Histogram::SampleSet::~SampleSet() {}
Histogram::SampleSet::~SampleSet() = default;

void Histogram::SampleSet::Resize(const Histogram& histogram) {
size_t oldSize = counts_.Length();
Expand Down Expand Up @@ -428,7 +428,7 @@ void Histogram::SampleSet::Add(const SampleSet& other) {
// buckets.
//------------------------------------------------------------------------------

LinearHistogram::~LinearHistogram() {}
LinearHistogram::~LinearHistogram() = default;

Histogram* LinearHistogram::FactoryGet(Sample minimum, Sample maximum,
size_t bucket_count, Flags flags,
Expand Down
4 changes: 2 additions & 2 deletions ipc/chromium/src/base/lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
class Lock {
public:
// Optimized wrapper implementation
Lock() {}
~Lock() {}
Lock() = default;
~Lock() = default;
void Acquire() { lock_.Lock(); }
void Release() { lock_.Unlock(); }

Expand Down
2 changes: 1 addition & 1 deletion js/src/builtin/TestingFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4647,7 +4647,7 @@ static bool IsAvxPresent(JSContext* cx, unsigned argc, Value* vp) {

class ShellAllocationMetadataBuilder : public AllocationMetadataBuilder {
public:
ShellAllocationMetadataBuilder() {}
ShellAllocationMetadataBuilder() = default;

virtual JSObject* build(JSContext* cx, HandleObject,
AutoEnterOOMUnsafeRegion& oomUnsafe) const override;
Expand Down
4 changes: 2 additions & 2 deletions js/src/jit/RegisterSets.h
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ class AllocatableSetAccessors<RegisterSet> {
}

public:
AllocatableSetAccessors() {}
AllocatableSetAccessors() = default;
explicit constexpr AllocatableSetAccessors(SetType) = delete;
explicit constexpr AllocatableSetAccessors(RegisterSet set) : set_(set) {}

Expand Down Expand Up @@ -641,7 +641,7 @@ class LiveSetAccessors<RegisterSet> {
}

public:
LiveSetAccessors() {}
LiveSetAccessors() = default;
explicit constexpr LiveSetAccessors(SetType) = delete;
explicit constexpr LiveSetAccessors(RegisterSet set) : set_(set) {}

Expand Down
2 changes: 1 addition & 1 deletion js/src/jsapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3955,7 +3955,7 @@ void JSErrorBase::freeMessage() {
message_ = JS::ConstUTF8CharsZ();
}

JSErrorNotes::JSErrorNotes() {}
JSErrorNotes::JSErrorNotes() = default;

JSErrorNotes::~JSErrorNotes() = default;

Expand Down
2 changes: 1 addition & 1 deletion js/src/vm/SavedStacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class SavedStacks {
// An alloction metadata builder that marks cells with the JavaScript stack
// at which they were allocated.
struct MetadataBuilder : public AllocationMetadataBuilder {
MetadataBuilder() {}
MetadataBuilder() = default;
virtual JSObject* build(JSContext* cx, HandleObject obj,
AutoEnterOOMUnsafeRegion& oomUnsafe) const override;
};
Expand Down
2 changes: 1 addition & 1 deletion js/src/vm/SharedImmutableStringsCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class SharedImmutableStringsCache {

Set set;

Inner() {}
Inner() = default;

Inner(const Inner&) = delete;
Inner& operator=(const Inner&) = delete;
Expand Down
2 changes: 1 addition & 1 deletion js/src/vm/Stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class AbstractFramePtr {

class NullFramePtr : public AbstractFramePtr {
public:
NullFramePtr() {}
NullFramePtr() = default;
};

enum MaybeConstruct { NO_CONSTRUCT = false, CONSTRUCT = true };
Expand Down
2 changes: 1 addition & 1 deletion js/src/vm/UbiNodeCensus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class BucketCount : public CountType {
};

public:
explicit BucketCount() {}
explicit BucketCount() = default;

void destructCount(CountBase& countBase) override {
Count& count = static_cast<Count&>(countBase);
Expand Down
2 changes: 1 addition & 1 deletion js/src/wasm/WasmTypeDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class FuncType {
}

public:
FuncType() {}
FuncType() = default;
FuncType(ValTypeVector&& args, ValTypeVector&& results)
: args_(std::move(args)), results_(std::move(results)) {}

Expand Down
4 changes: 2 additions & 2 deletions js/src/wasm/WasmValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class LitVal {
Cell cell_;

public:
LitVal() {}
LitVal() = default;

explicit LitVal(ValType type) : type_(type) {
switch (type.kind()) {
Expand Down Expand Up @@ -259,7 +259,7 @@ WASM_DECLARE_CACHEABLE_POD(LitVal::Cell);

class MOZ_NON_PARAM Val : public LitVal {
public:
Val() {}
Val() = default;
explicit Val(ValType type) : LitVal(type) {}
explicit Val(const LitVal& val);
explicit Val(uint32_t i32) : LitVal(i32) {}
Expand Down
2 changes: 1 addition & 1 deletion memory/replace/dmd/DMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ class DeadBlock {
mSlopSize(aLb.SlopSize()),
mAllocStackTrace(aLb.AllocStackTrace()) {}

~DeadBlock() {}
~DeadBlock() = default;

size_t ReqSize() const { return mReqSize; }
size_t SlopSize() const { return mSlopSize; }
Expand Down
2 changes: 1 addition & 1 deletion memory/replace/phc/PHC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class InfallibleAllocPolicy {

class StackTrace : public phc::StackTrace {
public:
StackTrace() {}
StackTrace() = default;

void Clear() { mLength = 0; }

Expand Down
2 changes: 1 addition & 1 deletion modules/libpref/Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3373,7 +3373,7 @@ void Preferences::AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
}

class PreferenceServiceReporter final : public nsIMemoryReporter {
~PreferenceServiceReporter() {}
~PreferenceServiceReporter() = default;

public:
NS_DECL_ISUPPORTS
Expand Down
2 changes: 1 addition & 1 deletion mozglue/misc/AutoProfilerLabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class MOZ_RAII AutoProfilerLabelData {
// Does not preserve behavior in JS record/replay.
class Mutex : private mozilla::detail::MutexImpl {
public:
Mutex() {}
Mutex() = default;
void Lock() { mozilla::detail::MutexImpl::lock(); }
void Unlock() { mozilla::detail::MutexImpl::unlock(); }
};
Expand Down
4 changes: 2 additions & 2 deletions netwerk/base/nsBufferedStreams.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class nsBufferedInputStream final : public nsBufferedStream,
NS_DECL_NSIASYNCINPUTSTREAMLENGTH
NS_DECL_NSIINPUTSTREAMLENGTHCALLBACK

nsBufferedInputStream() {}
nsBufferedInputStream() = default;

static nsresult Create(REFNSIID aIID, void** aResult);

Expand Down Expand Up @@ -146,7 +146,7 @@ class nsBufferedOutputStream : public nsBufferedStream,
NS_DECL_NSIBUFFEREDOUTPUTSTREAM
NS_DECL_NSISTREAMBUFFERACCESS

nsBufferedOutputStream() {}
nsBufferedOutputStream() = default;

static nsresult Create(REFNSIID aIID, void** aResult);

Expand Down
2 changes: 1 addition & 1 deletion netwerk/base/nsStreamLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace mozilla {
namespace net {

nsStreamLoader::nsStreamLoader() {}
nsStreamLoader::nsStreamLoader() = default;

NS_IMETHODIMP
nsStreamLoader::Init(nsIStreamLoaderObserver* aStreamObserver,
Expand Down
4 changes: 2 additions & 2 deletions security/manager/ssl/ScopedNSSTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class DigestBase {
*/
class Digest : public DigestBase {
public:
explicit Digest() {}
explicit Digest() = default;

static nsresult DigestBuf(SECOidTag hashAlg, Span<const uint8_t> buf,
/*out*/ nsTArray<uint8_t>& out) {
Expand Down Expand Up @@ -263,7 +263,7 @@ class Digest : public DigestBase {
// NS_ENSURE_SUCCESS(rv, rv);
class HMAC : public DigestBase {
public:
explicit HMAC() {}
explicit HMAC() = default;

nsresult Begin(SECOidTag hashAlg, Span<const uint8_t> key) {
if (!EnsureNSSInitializedChromeOrContent()) {
Expand Down
2 changes: 1 addition & 1 deletion storage/mozStorageAsyncStatement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ NS_IMPL_CI_INTERFACE_GETTER(AsyncStatement, mozIStorageAsyncStatement,

class AsyncStatementClassInfo : public nsIClassInfo {
public:
constexpr AsyncStatementClassInfo() {}
constexpr AsyncStatementClassInfo() = default;

NS_DECL_ISUPPORTS_INHERITED

Expand Down
2 changes: 1 addition & 1 deletion storage/mozStorageStatement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ NS_IMPL_CI_INTERFACE_GETTER(Statement, mozIStorageStatement,

class StatementClassInfo : public nsIClassInfo {
public:
constexpr StatementClassInfo() {}
constexpr StatementClassInfo() = default;

NS_DECL_ISUPPORTS_INHERITED

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static const ClassificationStruct classificationArray[] = {
namespace {
class ChannelListHolder : public LinkedList<ChannelWrapper> {
public:
ChannelListHolder() {}
ChannelListHolder() = default;

~ChannelListHolder();
};
Expand Down
Loading

0 comments on commit 1e77675

Please sign in to comment.