Skip to content

Commit

Permalink
Run clang-tidy modernize-use-equals-{delete,default} on //dbus
Browse files Browse the repository at this point in the history
See the bugs and cxx post for justification and details:
https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8

This change was done using clang-tidy as described here:
https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md

In some cases the the tool leaves behind a string of commas where it
replaced a member initializer list
(https://bugs.llvm.org/show_bug.cgi?id=35051). They were cleaned up with:
  git diff --name-only | \
    xargs sed -E -i 's/(^\s*|\)\s*):[ ,]*= default/\1 = default/'

BUG=778959,778957

Change-Id: I3435f847095ac0fbe5532f7859a67acdb4b23e8c
Reviewed-on: https://chromium-review.googlesource.com/789741
Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org>
Commit-Queue: Chris Watkins <watk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520038}
  • Loading branch information
Chris Watkins authored and Commit Bot committed Nov 29, 2017
1 parent 306963b commit 3740aae
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 32 deletions.
3 changes: 1 addition & 2 deletions dbus/bus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ Bus::Options::Options()
connection_type(PRIVATE) {
}

Bus::Options::~Options() {
}
Bus::Options::~Options() = default;

Bus::Bus(const Options& options)
: bus_type_(options.bus_type),
Expand Down
2 changes: 1 addition & 1 deletion dbus/bus_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace {
class RunLoopWithExpectedCount {
public:
RunLoopWithExpectedCount() : expected_quit_calls_(0), actual_quit_calls_(0) {}
~RunLoopWithExpectedCount() {}
~RunLoopWithExpectedCount() = default;

void Run(int expected_quit_calls) {
DCHECK_EQ(0, expected_quit_calls_);
Expand Down
3 changes: 1 addition & 2 deletions dbus/dbus_statistics_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ namespace dbus {

class DBusStatisticsTest : public testing::Test {
public:
DBusStatisticsTest() {
}
DBusStatisticsTest() = default;

void SetUp() override { statistics::Initialize(); }

Expand Down
3 changes: 1 addition & 2 deletions dbus/end_to_end_async_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,7 @@ TEST_F(EndToEndAsyncTest, TestHugeSignal) {

class SignalMultipleHandlerTest : public EndToEndAsyncTest {
public:
SignalMultipleHandlerTest() {
}
SignalMultipleHandlerTest() = default;

void SetUp() override {
// Set up base class.
Expand Down
3 changes: 1 addition & 2 deletions dbus/end_to_end_sync_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ namespace dbus {
// operations (i.e. ExportedObject side).
class EndToEndSyncTest : public testing::Test {
public:
EndToEndSyncTest() {
}
EndToEndSyncTest() = default;

void SetUp() override {
// Start the test service;
Expand Down
7 changes: 2 additions & 5 deletions dbus/message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,7 @@ MessageWriter::MessageWriter(Message* message)
dbus_message_iter_init_append(message_->raw_message(), &raw_message_iter_);
}

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

void MessageWriter::AppendByte(uint8_t value) {
AppendBasic(DBUS_TYPE_BYTE, &value);
Expand Down Expand Up @@ -716,9 +715,7 @@ MessageReader::MessageReader(Message* message)
dbus_message_iter_init(message_->raw_message(), &raw_message_iter_);
}


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

bool MessageReader::HasMoreData() {
const int dbus_type = dbus_message_iter_get_arg_type(&raw_message_iter_);
Expand Down
3 changes: 1 addition & 2 deletions dbus/mock_bus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace dbus {
MockBus::MockBus(const Bus::Options& options) : Bus(options) {
}

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

} // namespace dbus
3 changes: 1 addition & 2 deletions dbus/mock_exported_object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ MockExportedObject::MockExportedObject(Bus* bus,
: ExportedObject(bus, object_path) {
}

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

} // namespace dbus
3 changes: 1 addition & 2 deletions dbus/mock_object_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ MockObjectManager::MockObjectManager(Bus* bus,
: ObjectManager(bus, service_name, object_path) {
}

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

} // namespace dbus
3 changes: 1 addition & 2 deletions dbus/mock_object_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ MockObjectProxy::MockObjectProxy(Bus* bus,
: ObjectProxy(bus, service_name, object_path, DEFAULT_OPTIONS) {
}

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

void MockObjectProxy::CallMethod(MethodCall* method_call,
int timeout_ms,
Expand Down
3 changes: 1 addition & 2 deletions dbus/mock_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ namespace dbus {

class MockTest : public testing::Test {
public:
MockTest() {
}
MockTest() = default;

void SetUp() override {
// Create a mock bus.
Expand Down
3 changes: 1 addition & 2 deletions dbus/object_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ ObjectManager::Object::Object()
: object_proxy(nullptr) {
}

ObjectManager::Object::~Object() {
}
ObjectManager::Object::~Object() = default;

ObjectManager::ObjectManager(Bus* bus,
const std::string& service_name,
Expand Down
5 changes: 2 additions & 3 deletions dbus/property.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace dbus {

PropertyBase::PropertyBase() : property_set_(nullptr), is_valid_(false) {}

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

void PropertyBase::Init(PropertySet* property_set, const std::string& name) {
DCHECK(!property_set_);
Expand All @@ -45,8 +45,7 @@ PropertySet::PropertySet(
property_changed_callback_(property_changed_callback),
weak_ptr_factory_(this) {}

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

void PropertySet::RegisterProperty(const std::string& name,
PropertyBase* property) {
Expand Down
2 changes: 1 addition & 1 deletion dbus/property_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace dbus {
// Property<>.
class PropertyTest : public testing::Test {
public:
PropertyTest() {}
PropertyTest() = default;

struct Properties : public PropertySet {
Property<std::string> name;
Expand Down
3 changes: 1 addition & 2 deletions dbus/test_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ TestService::Options::Options()
: request_ownership_options(Bus::REQUIRE_PRIMARY) {
}

TestService::Options::~Options() {
}
TestService::Options::~Options() = default;

TestService::TestService(const Options& options)
: base::Thread("TestService"),
Expand Down

0 comments on commit 3740aae

Please sign in to comment.