diff --git a/sysrap/scuda.h b/sysrap/scuda.h index 762883e4ec..d791a6546c 100644 --- a/sysrap/scuda.h +++ b/sysrap/scuda.h @@ -101,6 +101,11 @@ SUTIL_INLINE SUTIL_HOSTDEVICE unsigned long long min(unsigned long long a, unsig return a < b ? a : b; } +// Avoid conflict with C++20 std::lerp (and bringing it into global) + +#if defined(__cpp_lib_interpolate) // && !defined(__CUDA_ARCH__) +using std::lerp; // make std::lerp visible to unqualified calls +#else /** lerp */ SUTIL_INLINE SUTIL_HOSTDEVICE float lerp(const float a, const float b, const float t) @@ -108,8 +113,7 @@ SUTIL_INLINE SUTIL_HOSTDEVICE float lerp(const float a, const float b, const flo return a + t*(b-a); } - - +#endif /** bilerp */ SUTIL_INLINE SUTIL_HOSTDEVICE float bilerp(const float x00, const float x10, const float x01, const float x11, diff --git a/u4/U4SolidMaker.cc b/u4/U4SolidMaker.cc index c14eec8195..ab589a69c5 100644 --- a/u4/U4SolidMaker.cc +++ b/u4/U4SolidMaker.cc @@ -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(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 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] ) ;