Skip to content

refactor: fix modernize-return-braced-init-list warnings - #44838

Merged
deepak1556 merged 2 commits into
mainfrom
refactor/modernize-return-braced-init-list
Nov 27, 2024
Merged

deepak1556 merged 2 commits into
mainfrom
refactor/modernize-return-braced-init-list

Conversation

@ckerr

@ckerr ckerr commented Nov 26, 2024 •

Copy link
Copy Markdown
Member

Description of Change

Fix a handful of modernize-return-braced-init-list warnings. This avoids duplicating the return type in the function definition.

Checklist

Release Notes

Notes: none.

… braced initializer list instead [modernize-return-braced-init-list]
… braced initializer list instead [modernize-return-braced-init-list]

NB: using the braced-initializer list uncovered an error here:
the float returned by std::floor() can't be implicitly cast to
an int. This is solved by using base::ClampFloor<int>() instead.
std::floor()
@ckerr ckerr added semver/patch backwards-compatible bug fixes target/32-x-y PR should also be added to the "32-x-y" branch. target/33-x-y PR should also be added to the "33-x-y" branch. target/34-x-y PR should also be added to the "34-x-y" branch. labels Nov 26, 2024
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Nov 26, 2024
@ckerr ckerr mentioned this pull request Nov 26, 2024
3 tasks done
@deepak1556
deepak1556 merged commit f595443 into main Nov 27, 2024
@deepak1556
deepak1556 deleted the refactor/modernize-return-braced-init-list branch November 27, 2024 00:41
@release-clerk

release-clerk Bot commented Nov 27, 2024

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Nov 27, 2024

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "32-x-y" cleanly;
you will need to perform this backport manually.

@trop

trop Bot commented Nov 27, 2024

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "34-x-y", please check out #44856

@trop trop Bot added in-flight/34-x-y and removed target/34-x-y PR should also be added to the "34-x-y" branch. labels Nov 27, 2024
@trop

trop Bot commented Nov 27, 2024

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "33-x-y", please check out #44857

@trop trop Bot added in-flight/33-x-y merged/33-x-y PR was merged to the "33-x-y" branch. merged/34-x-y PR was merged to the "34-x-y" branch. and removed target/33-x-y PR should also be added to the "33-x-y" branch. in-flight/33-x-y in-flight/34-x-y labels Nov 27, 2024
@ckerr ckerr mentioned this pull request Nov 27, 2024
3 tasks done
ckerr added a commit that referenced this pull request Feb 13, 2025
* refactor: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list]

* refactor: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list]

NB: using the braced-initializer list uncovered an error here:
the float returned by std::floor() can't be implicitly cast to
an int. This is solved by using base::ClampFloor<int>() instead.
std::floor()
@trop

trop Bot commented Feb 13, 2025

Copy link
Copy Markdown
Contributor

@ckerr has manually backported this PR to "32-x-y", please check out #45608

jkleinsc pushed a commit that referenced this pull request Feb 13, 2025
…5608)

refactor: fix modernize-return-braced-init-list warnings (#44838)

* refactor: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list]

* refactor: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list]

NB: using the braced-initializer list uncovered an error here:
the float returned by std::floor() can't be implicitly cast to
an int. This is solved by using base::ClampFloor<int>() instead.
std::floor()
@trop trop Bot added merged/32-x-y PR was merged to the "32-x-y" branch. and removed in-flight/32-x-y labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/32-x-y PR was merged to the "32-x-y" branch. merged/33-x-y PR was merged to the "33-x-y" branch. merged/34-x-y PR was merged to the "34-x-y" branch. new-pr 🌱 PR opened recently semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants