Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layers: Clean up result variable declarations for GetRead<>(), GetWrite<>(), Get<>() and shared_ptr<>.get() #3714

Merged
merged 3 commits into from
Jan 31, 2022

Conversation

jeremyg-lunarg
Copy link
Contributor

For GetRead<>, GetWrite<> and Get<>, adding const to the return value declaration makes the returned pointer object const, which is irrelevant. The pointer held by the object should already have the appropriate constness.

But shared_ptr<>.get() returns a raw pointer that should have 'const' and / or '*' in the declaration for a variable holding its result.

This was raised as a problem in PR #3659

These methods return a LockedSharedPtr<> that holds a pointer
of the appropriate constness. Adding const to the return value
declaration makes the returned object const, which is irrelevant.
These methods return a shared_ptr<> that holds a pointer
of the appropriate constness. Adding const to the return value
declaration makes the returned object const, which is irrelevant.
This method returns a raw pointer that should be marked appropriately.
@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 3288.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 6086 running.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 6086 passed.

Copy link
Contributor

@jzulauf-lunarg jzulauf-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jeremyg-lunarg jeremyg-lunarg merged commit 9d0dda3 into KhronosGroup:master Jan 31, 2022
@jeremyg-lunarg jeremyg-lunarg deleted the jeremyg-const-auto branch January 31, 2022 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants