-
Notifications
You must be signed in to change notification settings - Fork 4
fixes for c++20 #147
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
fixes for c++20 #147
Changes from all commits
ebfd6c8
53db2c1
7d9905e
129c53a
61c1fff
297197e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2138,7 +2138,7 @@ const G4VSolid* U4SolidMaker::BltLocalFastenerAcrylicConstruction(const char* na | |||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||
| [[maybe_unused]] const char* PREFIX = "BltLocalFastenerAcrylicConstruction" ; | ||||||||||||||||||||||||||||||||||||||||||
| assert( sstr::StartsWith(name,PREFIX )); | ||||||||||||||||||||||||||||||||||||||||||
| long num_column = sstr::ExtractLong(name, 1) ; | ||||||||||||||||||||||||||||||||||||||||||
| const size_t num_column = static_cast<size_t>(sstr::ExtractLong(name, 1)); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| LOG(info) | ||||||||||||||||||||||||||||||||||||||||||
| << " name " << ( name ? name : "-" ) | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -2151,8 +2151,10 @@ const G4VSolid* U4SolidMaker::BltLocalFastenerAcrylicConstruction(const char* na | |||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| G4Tubs* screw = new G4Tubs("screw",0,13*mm,50.*mm,0.0*deg,360.0*deg); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| G4ThreeVector tlate[num_column] = {} ; | ||||||||||||||||||||||||||||||||||||||||||
| for(long i=0;i<num_column;i++) tlate[i] = G4ThreeVector(164.*cos(i*pi/4)*mm, 164.*sin(i*pi/4)*mm,-65.0*mm); | ||||||||||||||||||||||||||||||||||||||||||
| std::vector<G4ThreeVector> tlate(num_column, G4ThreeVector(0, 0, 0)); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| for (long i = 0; i < num_column; i++) | ||||||||||||||||||||||||||||||||||||||||||
| tlate[i] = G4ThreeVector(164. * cos(i * pi / 4) * mm, 164. * sin(i * pi / 4) * mm, -65.0 * mm); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| G4VSolid* muni = screw ; | ||||||||||||||||||||||||||||||||||||||||||
| for(long i=1 ; i < num_column ; i++) muni = new G4UnionSolid( name, muni, screw, 0, tlate[i] ) ; | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+2156
to
2160
|
||||||||||||||||||||||||||||||||||||||||||
| for (long i = 0; i < num_column; i++) | |
| tlate[i] = G4ThreeVector(164. * cos(i * pi / 4) * mm, 164. * sin(i * pi / 4) * mm, -65.0 * mm); | |
| G4VSolid* muni = screw ; | |
| for(long i=1 ; i < num_column ; i++) muni = new G4UnionSolid( name, muni, screw, 0, tlate[i] ) ; | |
| for (size_t i = 0; i < num_column; i++) | |
| tlate[i] = G4ThreeVector(164. * cos(i * pi / 4) * mm, 164. * sin(i * pi / 4) * mm, -65.0 * mm); | |
| G4VSolid* muni = screw ; | |
| for(size_t i=1 ; i < num_column ; i++) muni = new G4UnionSolid( name, muni, screw, 0, tlate[i] ) ; |
Copilot
AI
Sep 3, 2025
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.
Loop variable type mismatch: i is declared as long but num_column is size_t. This can cause signed/unsigned comparison warnings and potential issues. Change the loop variable to size_t i = 1.
| for (long i = 0; i < num_column; i++) | |
| tlate[i] = G4ThreeVector(164. * cos(i * pi / 4) * mm, 164. * sin(i * pi / 4) * mm, -65.0 * mm); | |
| G4VSolid* muni = screw ; | |
| for(long i=1 ; i < num_column ; i++) muni = new G4UnionSolid( name, muni, screw, 0, tlate[i] ) ; | |
| for (size_t i = 0; i < num_column; i++) | |
| tlate[i] = G4ThreeVector(164. * cos(i * pi / 4) * mm, 164. * sin(i * pi / 4) * mm, -65.0 * mm); | |
| G4VSolid* muni = screw ; | |
| for(size_t i=1 ; i < num_column ; i++) muni = new G4UnionSolid( name, muni, screw, 0, tlate[i] ) ; |
Uh oh!
There was an error while loading. Please reload this page.