chgcentre: fix compilation error by using explicit casting (#39315)

Co-authored-by: Cristian Di Pietrantonio <cdipietrantonio@pawsey.org.au>
This commit is contained in:
Cristian Di Pietrantonio 2023-08-09 14:32:58 +08:00 committed by GitHub
parent 97d632a161
commit 7165e70186
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,11 @@
--- a/main.cpp 2022-05-02 15:00:00 +0800
+++ b/main.cpp 2022-05-02 15:01:00 +0800
@@ -415,7 +415,7 @@
MDirection::Ref(MDirection::J2000))();
std::vector<Muvw> uvws(antennas.size());
MEpoch time(MVEpoch(-1.0));
- for(unsigned row=0; row!=std::min(set.nrow(),50u); ++row)
+ for(unsigned row=0; row!=std::min(static_cast<unsigned int>(set.nrow()),50u); ++row)
{
if(fieldIdCol(row) == fieldIndex)
{

View File

@ -18,3 +18,9 @@ class Chgcentre(CMakePackage):
depends_on("casacore") depends_on("casacore")
depends_on("gsl") depends_on("gsl")
# this patch is required to fix a programming error that is not acceptable by
# latest compilers. In particular, the `std::min` function was given `int` and
# `unsigned int` arguments. The `int` argument is explicitly casted to `unsigned int`.
# This patch was created by the staff at the Pawsey Supercomputing Research Centre.
patch("main.patch")