[chromium-style] Fixup a few chromium-style issues.

This CL fixes a few missing overrides and updates some `auto`'s to
have a `*` on them.

Bug: dawn:1405
Change-Id: I621cd35fb10d8308a5831db11c22a3595e52e295
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89120
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
dan sinclair 2022-05-09 16:26:44 +00:00 committed by Dawn LUCI CQ
parent abd1840550
commit d84daed72c
15 changed files with 20 additions and 19 deletions

View File

@ -33,7 +33,7 @@ class DeviceBase;
class AdapterBase : public RefCounted {
public:
AdapterBase(InstanceBase* instance, wgpu::BackendType backend);
virtual ~AdapterBase() = default;
~AdapterBase() override = default;
MaybeError Initialize();

View File

@ -94,7 +94,7 @@ class InstanceBase final : public RefCounted {
private:
InstanceBase() = default;
~InstanceBase() = default;
~InstanceBase() override = default;
InstanceBase(const InstanceBase& other) = delete;
InstanceBase& operator=(const InstanceBase& other) = delete;

View File

@ -154,7 +154,7 @@ SyncScopeResourceUsage SyncScopeUsageTracker::AcquireSyncScopeUsage() {
result.textureUsages.push_back(std::move(usage));
}
for (auto& it : mExternalTextureUsages) {
for (auto* const it : mExternalTextureUsages) {
result.externalTextures.push_back(it);
}

View File

@ -48,7 +48,7 @@ class Device;
class VulkanInstance : public RefCounted {
public:
static ResultOrError<Ref<VulkanInstance>> Create(const InstanceBase* instance, ICD icd);
~VulkanInstance();
~VulkanInstance() override;
const VulkanFunctions& GetFunctions() const;
VkInstance GetVkInstance() const;

View File

@ -45,7 +45,7 @@ class DescriptorSetAllocator : public ObjectBase {
private:
DescriptorSetAllocator(BindGroupLayout* layout,
std::map<VkDescriptorType, uint32_t> descriptorCountPerType);
~DescriptorSetAllocator();
~DescriptorSetAllocator() override;
MaybeError AllocateDescriptorPool();

View File

@ -24,7 +24,7 @@ namespace dawn::native::vulkan {
class ResourceHeap : public ResourceHeapBase {
public:
ResourceHeap(VkDeviceMemory memory, size_t memoryType);
~ResourceHeap() = default;
~ResourceHeap() override = default;
VkDeviceMemory GetMemory() const;
size_t GetMemoryType() const;

View File

@ -790,7 +790,7 @@ extern template class ExpectBetweenColors<RGBA8>;
class CustomTextureExpectation : public Expectation {
public:
virtual ~CustomTextureExpectation() = default;
~CustomTextureExpectation() override = default;
virtual uint32_t DataSize() = 0;
};

View File

@ -21,7 +21,7 @@
class OpArrayLengthTest : public DawnTest {
protected:
void SetUp() {
void SetUp() override {
DawnTest::SetUp();
// Create buffers of various size to check the length() implementation

View File

@ -45,7 +45,7 @@ struct RCTestDerived : public RCTest {
// Test that RCs start with one ref, and removing it destroys the object.
TEST(RefCounted, StartsWithOneRef) {
bool deleted = false;
auto test = new RCTest(&deleted);
auto* test = new RCTest(&deleted);
test->Release();
EXPECT_TRUE(deleted);
@ -54,7 +54,7 @@ TEST(RefCounted, StartsWithOneRef) {
// Test adding refs keep the RC alive.
TEST(RefCounted, AddingRefKeepsAlive) {
bool deleted = false;
auto test = new RCTest(&deleted);
auto* test = new RCTest(&deleted);
test->Reference();
test->Release();

View File

@ -19,7 +19,7 @@ class Placeholder : public RefCounted {
explicit Placeholder(int* alive) : mAlive(alive) { ++*mAlive; }
private:
~Placeholder() { --*mAlive; }
~Placeholder() override { --*mAlive; }
int* const mAlive;
};

View File

@ -41,7 +41,7 @@ TEST(ToBackend, Pointers) {
MyAdapter* adapter = new MyAdapter;
const AdapterBase* base = adapter;
auto backendAdapter = ToBackend(base);
auto* backendAdapter = ToBackend(base);
static_assert(std::is_same<decltype(backendAdapter), const MyAdapter*>::value);
ASSERT_EQ(adapter, backendAdapter);
@ -51,7 +51,7 @@ TEST(ToBackend, Pointers) {
MyAdapter* adapter = new MyAdapter;
AdapterBase* base = adapter;
auto backendAdapter = ToBackend(base);
auto* backendAdapter = ToBackend(base);
static_assert(std::is_same<decltype(backendAdapter), MyAdapter*>::value);
ASSERT_EQ(adapter, backendAdapter);

View File

@ -229,7 +229,7 @@ WGPUDevice ValidationTest::CreateTestDevice() {
// static
void ValidationTest::OnDeviceError(WGPUErrorType type, const char* message, void* userdata) {
ASSERT(type != WGPUErrorType_NoError);
auto self = static_cast<ValidationTest*>(userdata);
auto* self = static_cast<ValidationTest*>(userdata);
self->mDeviceErrorMessage = message;
ASSERT_TRUE(self->mExpectError) << "Got unexpected device error: " << message;
@ -243,7 +243,7 @@ void ValidationTest::OnDeviceError(WGPUErrorType type, const char* message, void
void ValidationTest::OnDeviceLost(WGPUDeviceLostReason reason,
const char* message,
void* userdata) {
auto self = static_cast<ValidationTest*>(userdata);
auto* self = static_cast<ValidationTest*>(userdata);
if (self->mExpectDestruction) {
EXPECT_EQ(reason, WGPUDeviceLostReason_Destroyed);
return;

View File

@ -48,7 +48,7 @@ void* WireDeserializeAllocator::GetSpace(size_t size) {
}
void WireDeserializeAllocator::Reset() {
for (auto allocation : mAllocations) {
for (auto* allocation : mAllocations) {
free(allocation);
}
mAllocations.clear();

View File

@ -28,7 +28,7 @@ class NoopCommandSerializer final : public CommandSerializer {
return &gNoopCommandSerializer;
}
~NoopCommandSerializer() = default;
~NoopCommandSerializer() override = default;
size_t GetMaximumAllocationSize() const final { return 0; }
void* GetCmdSpace(size_t size) final { return nullptr; }

View File

@ -254,7 +254,7 @@ bool Device::OnCreateComputePipelineAsyncCallback(uint64_t requestSerial,
return false;
}
auto pipelineAllocation =
auto* pipelineAllocation =
client->ComputePipelineAllocator().GetObject(request.pipelineObjectID);
// If the return status is a failure we should give a null pipeline to the callback and
@ -305,7 +305,8 @@ bool Device::OnCreateRenderPipelineAsyncCallback(uint64_t requestSerial,
return false;
}
auto pipelineAllocation = client->RenderPipelineAllocator().GetObject(request.pipelineObjectID);
auto* pipelineAllocation =
client->RenderPipelineAllocator().GetObject(request.pipelineObjectID);
// If the return status is a failure we should give a null pipeline to the callback and
// free the allocation.