Repository navigation
[PWGEM] Fix casts - #18387
Draft
vkucera wants to merge 1 commit into
Draft
[PWGEM] Fix casts#18387vkucera wants to merge 1 commit into
vkucera wants to merge 1 commit into
Conversation
|
O2 linter results: ❌ 0 errors, |
vkucera
marked this pull request as ready for review
October 21, 2026 17:24
vkucera
requested review from
alibuild,
amaringarcia,
dsekihat,
feisenhu,
hscheid,
jokonig,
mhemmer-cern,
mikesas,
rbailhac and
reygers
as code owners
October 21, 2026 17:24
This comment was marked as outdated.
This comment was marked as outdated.
vkucera
marked this pull request as draft
October 21, 2026 23:27
vkucera
force-pushed
the
cast-PWGEM
branch
3 times, most recently
from
October 26, 2026 14:33
ae30eb3 to
d828782
Compare
Fixes C-style, redundant, wrong, and dangerous casts (found by Clang-Tidy and cpplint). - Remove redundant casts. (`readability-redundant-casting`) - Remove `const_cast`. (`cppcoreguidelines-pro-type-const-cast`) - Replace C-style casts with `static_cast`. (`google-readability-casting`, cpplint: `readability/casting`) - Replace unsafe C-style casts with `dynamic_cast`. (`cppcoreguidelines-pro-type-cstyle-cast`) - Replace `static_cast` in downcasts with `dynamic_cast`. (`cppcoreguidelines-pro-type-static-cast-downcast`) - Replace `reinterpret_cast` with `static_cast` or `dynamic_cast`. (`cppcoreguidelines-pro-type-reinterpret-cast`) - Replace two-step casting through `void*` with `reinterpret_cast`. (`bugprone-casting-through-void`)
vkucera
marked this pull request as ready for review
November 4, 2026 09:55
Collaborator
Author
|
Dear code owners, the PR is ready for review. |
vkucera
commented
Nov 4, 2026
| fVecResoND.resize(fNCenBins, std::vector<std::vector<std::vector<std::vector<TH3D*>>>>(fNPtBins, std::vector<std::vector<std::vector<TH3D*>>>(fNEtaBins, std::vector<std::vector<TH3D*>>(fNPhiBins, std::vector<TH3D*>(fNChBins))))); | ||
| // fVecResoND.resize(fNPtBins, std::vector<std::vector<std::vector<TH3D*>>>(fNEtaBins, std::vector<std::vector<TH3D*>>(fNPhiBins, std::vector<TH3D*>(fNChBins)))); | ||
| // auto h3 = reinterpret_cast<TH3D*>(hs_reso->Projection(4, 5, 6)); | ||
| // auto h3 = reinterpret_cast<TH3D*>(hs_reso->Projection(4, 5, 6)); // FIXME: invalid cast |
Collaborator
Author
There was a problem hiding this comment.
Oops, this does not look right.
vkucera
marked this pull request as draft
November 4, 2026 10:16
Collaborator
|
Error while checking build/O2Physics/code-check for 5d5dc38 at 2026-11-04 11:33: Full log here. |
jokonig
approved these changes
Nov 4, 2026
Collaborator
|
@vkucera is this ready for review again with the latest commit? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes C-style, redundant, wrong, and dangerous casts (found by Clang-Tidy and cpplint).
readability-redundant-casting)const_cast. (cppcoreguidelines-pro-type-const-cast)static_cast. (google-readability-casting, cpplint:readability/casting)dynamic_cast. (cppcoreguidelines-pro-type-cstyle-cast)static_castin downcasts withdynamic_cast. (cppcoreguidelines-pro-type-static-cast-downcast)reinterpret_castwithstatic_castordynamic_cast. (cppcoreguidelines-pro-type-reinterpret-cast)void*withreinterpret_cast. (bugprone-casting-through-void)