-
Notifications
You must be signed in to change notification settings - Fork 32
clang-tidy: readability-redundant-casting #2119
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (1/2)
|
||
t_fEMC_towers_cellE[iCell] = (float)input_tower_recSav.at(iCell).energy; | ||
t_fEMC_towers_cellT[iCell] = (float)input_tower_recSav.at(iCell).time; | ||
t_fEMC_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wut?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see what's going on there...
t_fEMC_towers_cellE[iCell] = (float)input_tower_recSav.at(iCell).energy; | ||
t_fEMC_towers_cellT[iCell] = (float)input_tower_recSav.at(iCell).time; | ||
t_fEMC_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy; | ||
t_fEMC_towers_cellT[iCell] = input_tower_recSav.at(iCell).time; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
t_fEMC_towers_cellT[iCell] = (float)input_tower_recSav.at(iCell).time; | ||
t_fEMC_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy; | ||
t_fEMC_towers_cellT[iCell] = input_tower_recSav.at(iCell).time; | ||
t_fEMC_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
t_fEMC_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy; | ||
t_fEMC_towers_cellT[iCell] = input_tower_recSav.at(iCell).time; | ||
t_fEMC_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx; | ||
t_fEMC_towers_cellIDy[iCell] = (short)input_tower_recSav.at(iCell).cellIDy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
t_fEMC_towers_cellT[iCell] = input_tower_recSav.at(iCell).time; | ||
t_fEMC_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx; | ||
t_fEMC_towers_cellIDy[iCell] = (short)input_tower_recSav.at(iCell).cellIDy; | ||
t_fEMC_towers_clusterIDA[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDA; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
t_fEMC_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx; | ||
t_fEMC_towers_cellIDy[iCell] = (short)input_tower_recSav.at(iCell).cellIDy; | ||
t_fEMC_towers_clusterIDA[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDA; | ||
t_fEMC_towers_clusterIDB[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDB; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
t_fEMC_towers_clusterIDA[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDA; | ||
t_fEMC_towers_clusterIDB[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDB; | ||
t_fEMC_towers_cellTrueID[iCell] = (int)input_tower_recSav.at(iCell).tower_trueID; | ||
t_fEMC_towers_cellTrueID[iCell] = input_tower_recSav.at(iCell).tower_trueID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
for (const auto cluster : fEMCClustersF) { | ||
if (iECl < maxNCluster && enableTreeCluster) { | ||
t_fEMC_cluster_E[iECl] = (float)cluster.getEnergy(); | ||
t_fEMC_cluster_E[iECl] = cluster.getEnergy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
if (iECl < maxNCluster && enableTreeCluster) { | ||
t_fEMC_cluster_E[iECl] = (float)cluster.getEnergy(); | ||
t_fEMC_cluster_E[iECl] = cluster.getEnergy(); | ||
t_fEMC_cluster_NCells[iECl] = (int)cluster.getNhits(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
t_fEMC_cluster_Eta[iECl] = | ||
(-1.) * std::log(std::tan((float)cluster.getIntrinsicTheta() / 2.)); | ||
t_fEMC_cluster_Phi[iECl] = (float)cluster.getIntrinsicPhi(); | ||
t_fEMC_cluster_Eta[iECl] = (-1.) * std::log(std::tan(cluster.getIntrinsicTheta() / 2.)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (2/2)
(-1.) * std::log(std::tan((float)cluster.getIntrinsicTheta() / 2.)); | ||
t_fEMC_cluster_Phi[iECl] = (float)cluster.getIntrinsicPhi(); | ||
t_fEMC_cluster_Eta[iECl] = (-1.) * std::log(std::tan(cluster.getIntrinsicTheta() / 2.)); | ||
t_fEMC_cluster_Phi[iECl] = cluster.getIntrinsicPhi(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
|
||
t_lFHCal_towers_cellE[iCell] = (float)input_tower_recSav.at(iCell).energy; | ||
t_lFHCal_towers_cellT[iCell] = (float)input_tower_recSav.at(iCell).time; | ||
t_lFHCal_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
t_lFHCal_towers_cellE[iCell] = (float)input_tower_recSav.at(iCell).energy; | ||
t_lFHCal_towers_cellT[iCell] = (float)input_tower_recSav.at(iCell).time; | ||
t_lFHCal_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy; | ||
t_lFHCal_towers_cellT[iCell] = input_tower_recSav.at(iCell).time; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
t_lFHCal_towers_cellT[iCell] = (float)input_tower_recSav.at(iCell).time; | ||
t_lFHCal_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy; | ||
t_lFHCal_towers_cellT[iCell] = input_tower_recSav.at(iCell).time; | ||
t_lFHCal_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
t_lFHCal_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy; | ||
t_lFHCal_towers_cellT[iCell] = input_tower_recSav.at(iCell).time; | ||
t_lFHCal_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx; | ||
t_lFHCal_towers_cellIDy[iCell] = (short)input_tower_recSav.at(iCell).cellIDy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
t_lFHCal_towers_cellT[iCell] = input_tower_recSav.at(iCell).time; | ||
t_lFHCal_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx; | ||
t_lFHCal_towers_cellIDy[iCell] = (short)input_tower_recSav.at(iCell).cellIDy; | ||
t_lFHCal_towers_cellIDz[iCell] = (short)input_tower_recSav.at(iCell).cellIDz; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
t_lFHCal_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx; | ||
t_lFHCal_towers_cellIDy[iCell] = (short)input_tower_recSav.at(iCell).cellIDy; | ||
t_lFHCal_towers_cellIDz[iCell] = (short)input_tower_recSav.at(iCell).cellIDz; | ||
t_lFHCal_towers_clusterIDA[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDA; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
t_lFHCal_towers_cellIDy[iCell] = (short)input_tower_recSav.at(iCell).cellIDy; | ||
t_lFHCal_towers_cellIDz[iCell] = (short)input_tower_recSav.at(iCell).cellIDz; | ||
t_lFHCal_towers_clusterIDA[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDA; | ||
t_lFHCal_towers_clusterIDB[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDB; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
t_lFHCal_towers_clusterIDA[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDA; | ||
t_lFHCal_towers_clusterIDB[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDB; | ||
t_lFHCal_towers_cellTrueID[iCell] = (int)input_tower_recSav.at(iCell).tower_trueID; | ||
t_lFHCal_towers_cellTrueID[iCell] = input_tower_recSav.at(iCell).tower_trueID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use pointer arithmetic
Briefly, what does this PR introduce?
This PR applies clang-tidy readability-redundant-casting check fixes from main.
What kind of change does this PR introduce?
Please check if this PR fulfills the following:
Does this PR introduce breaking changes? What changes might users need to make to their code?
No.
Does this PR change default behavior?
No.