Conversation
There was a problem hiding this comment.
Cpp-linter Review
Used clang-format v18.1.3
Click here for the full clang-format patch
diff --git a/sysrap/scuda.h b/sysrap/scuda.h
index 707ed11..d791a65 100644
--- a/sysrap/scuda.h
+++ b/sysrap/scuda.h
@@ -104 +103,0 @@ SUTIL_INLINE SUTIL_HOSTDEVICE unsigned long long min(unsigned long long a, unsig
-
@@ -108 +107 @@ SUTIL_INLINE SUTIL_HOSTDEVICE unsigned long long min(unsigned long long a, unsig
-using std::lerp; // make std::lerp visible to unqualified calls
+using std::lerp; // make std::lerp visible to unqualified calls
@@ -119,2 +117,0 @@ SUTIL_INLINE SUTIL_HOSTDEVICE float lerp(const float a, const float b, const flo
-
-
diff --git a/u4/U4SolidMaker.cc b/u4/U4SolidMaker.cc
index c5881de..ab589a6 100644
--- a/u4/U4SolidMaker.cc
+++ b/u4/U4SolidMaker.cc
@@ -2154 +2154 @@ const G4VSolid* U4SolidMaker::BltLocalFastenerAcrylicConstruction(const char* na
- std::vector<G4ThreeVector> tlate(num_column, G4ThreeVector(0,0,0));
+ std::vector<G4ThreeVector> tlate(num_column, G4ThreeVector(0, 0, 0));
@@ -2156 +2156,2 @@ const G4VSolid* U4SolidMaker::BltLocalFastenerAcrylicConstruction(const char* na
- 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);
+ 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);
Have any feedback or feature suggestions? Share it here.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Cpp-linter Review
Used clang-format v18.1.3
Click here for the full clang-format patch
diff --git a/sysrap/scuda.h b/sysrap/scuda.h
index d547473..d791a65 100644
--- a/sysrap/scuda.h
+++ b/sysrap/scuda.h
@@ -104 +103,0 @@ SUTIL_INLINE SUTIL_HOSTDEVICE unsigned long long min(unsigned long long a, unsig
-
@@ -119,2 +117,0 @@ SUTIL_INLINE SUTIL_HOSTDEVICE float lerp(const float a, const float b, const flo
-
-
Have any feedback or feature suggestions? Share it here.
There was a problem hiding this comment.
Pull Request Overview
This PR addresses compatibility issues with C++20 by resolving conflicts and updating code patterns that are incompatible with the newer standard.
- Replaces variable-length arrays with std::vector for C++20 compatibility
- Handles std::lerp conflicts by conditionally using std::lerp when available
- Updates CMake configuration to properly link OpenSSL libraries
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| u4/U4SolidMaker.cc | Converts variable-length array to std::vector and adds proper type casting |
| sysrap/scuda.h | Adds conditional compilation to handle std::lerp availability in C++20 |
| qudarap/CMakeLists.txt | Updates OpenSSL linking to use proper CMake targets |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| 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] ) ; |
There was a problem hiding this comment.
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 on platforms where long and size_t have different sizes. Change the loop variable to size_t i = 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] ) ; | |
| 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] ) ; |
| 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] ) ; |
There was a problem hiding this comment.
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] ) ; |
No description provided.