Skip to content

Commit

Permalink
Merge branch 'OSGeo:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
a0x8o authored Jul 1, 2024
2 parents 8dc6177 + e179609 commit 5b641ea
Show file tree
Hide file tree
Showing 89 changed files with 986 additions and 382 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang_static_analyzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Run
run: docker run --rm -v $PWD:$PWD ubuntu:22.04 sh -c "cd $PWD && apt update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends sudo software-properties-common && DEBIAN_FRONTEND=noninteractive sh ./ci/travis/csa_common/before_install.sh && sh ./ci/travis/csa_common/install.sh && sh ./ci/travis/csa_common/script.sh"
12 changes: 6 additions & 6 deletions .github/workflows/cmake_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
cache-name: cmake-ubuntu-focal
steps:
- name: Checkout GDAL
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: cache
Expand Down Expand Up @@ -312,7 +312,7 @@ jobs:
run: |
git config --global core.autocrlf false
- name: Checkout GDAL
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install development packages
uses: msys2/setup-msys2@d0e80f58dffbc64f6a3a1f43527d469b4fc7b6c8 # v2.23.0
with:
Expand Down Expand Up @@ -405,7 +405,7 @@ jobs:
run: |
git config --global core.autocrlf false
- name: Checkout GDAL
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
- name: populate JAVA_HOME
shell: pwsh
Expand Down Expand Up @@ -512,7 +512,7 @@ jobs:
run: |
git config --global core.autocrlf false
- name: Checkout GDAL
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
with:
activate-environment: gdalenv
Expand Down Expand Up @@ -589,7 +589,7 @@ jobs:
with:
xcode-version: 14.3
- name: Checkout GDAL
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: cache
Expand Down Expand Up @@ -669,7 +669,7 @@ jobs:
run: |
git config --global core.autocrlf false
- name: Checkout GDAL
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
with:
activate-environment: gdalenv
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/code_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install Requirements
run: |
Expand All @@ -47,7 +47,7 @@ jobs:
container: ubuntu:24.04
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install Requirements
run: |
Expand All @@ -69,7 +69,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Detect tabulations
run: ./scripts/detect_tabulations.sh
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

Expand All @@ -113,7 +113,7 @@ jobs:
container: ghcr.io/osgeo/proj-docs
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Run doxygen
run: |
Expand All @@ -124,7 +124,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install Requirements
run: |
Expand All @@ -143,7 +143,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
Expand All @@ -159,7 +159,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install requirements
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install dependencies
run: |
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
# We do that after running CMake to avoid CodeQL to trigger during CMake time,
# in particular during HDF5 detection which is terribly slow (https://github.com/OSGeo/gdal/issues/9549)
- name: Initialize CodeQL
uses: github/codeql-action/init@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
uses: github/codeql-action/init@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -127,6 +127,6 @@ jobs:
cmake --build build -j$(nproc)
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
CACHE_NUMBER: 0

steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Support longpaths
run: git config --system core.longpaths true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverity_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Login to GHCR
if: env.CONTAINER_REGISTRY == 'ghcr.io'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
container: ghcr.io/osgeo/proj-docs

steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup environment
shell: bash -l {0}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:
sudo sysctl vm.mmap_rnd_bits=28
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Login to Docker Hub
if: env.CONTAINER_REGISTRY == 'docker.io'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: macos-14
steps:

- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false

Expand Down Expand Up @@ -71,6 +71,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
uses: github/codeql-action/upload-sarif@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/slow_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Login to GHCR
if: env.CONTAINER_REGISTRY == 'ghcr.io'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Set environment
shell: pwsh
Expand Down
7 changes: 2 additions & 5 deletions alg/gdalchecksum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,9 @@ int CPL_STDCALL GDALChecksumImage(GDALRasterBandH hBand, int nXOff, int nYOff,
const auto IntFromDouble = [](double dfVal)
{
int nVal;
if (CPLIsNan(dfVal) || CPLIsInf(dfVal))
if (!std::isfinite(dfVal))
{
// Most compilers seem to cast NaN or Inf to 0x80000000.
// but VC7 is an exception. So we force the result
// of such a cast.
nVal = 0x80000000;
nVal = INT_MIN;
}
else
{
Expand Down
7 changes: 2 additions & 5 deletions alg/gdalrasterize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1559,11 +1559,8 @@ CPLErr GDALRasterizeLayers(GDALDatasetH hDS, int nBandCount, int *panBandList,
if (!(pszYChunkSize && ((nYChunkSize = atoi(pszYChunkSize))) != 0))
{
const GIntBig nYChunkSize64 = GDALGetCacheMax64() / nScanlineBytes;
const int knIntMax = std::numeric_limits<int>::max();
if (nYChunkSize64 > knIntMax)
nYChunkSize = knIntMax;
else
nYChunkSize = static_cast<int>(nYChunkSize64);
nYChunkSize = static_cast<int>(
std::min<GIntBig>(nYChunkSize64, std::numeric_limits<int>::max()));
}

if (nYChunkSize < 1)
Expand Down
5 changes: 4 additions & 1 deletion alg/gdalwarpkernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ static CPLErr GWKRun(GDALWarpKernel *poWK, const char *pszFuncName,
job.pfnFunc = pfnFunc;
}

bool bStopFlag;
{
std::unique_lock<std::mutex> lock(psThreadData->mutex);

Expand Down Expand Up @@ -550,14 +551,16 @@ static CPLErr GWKRun(GDALWarpKernel *poWK, const char *pszFuncName,
}
}
}

bStopFlag = psThreadData->stopFlag;
}

/* -------------------------------------------------------------------- */
/* Wait for all jobs to complete. */
/* -------------------------------------------------------------------- */
psThreadData->poJobQueue->WaitCompletion();

return psThreadData->stopFlag ? CE_Failure : CE_None;
return bStopFlag ? CE_Failure : CE_None;
}

/************************************************************************/
Expand Down
17 changes: 12 additions & 5 deletions alg/internal_libqhull/poly_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -1137,10 +1137,13 @@ ridgeT *qh_newridge(qhT *qh) {
qh_memalloc_(qh, (int)sizeof(ridgeT), freelistp, ridge, ridgeT);
memset((char *)ridge, (size_t)0, sizeof(ridgeT));
zinc_(Ztotridges);
ridge->id= qh->ridge_id;
if (qh->ridge_id == UINT_MAX) {
qh_fprintf(qh, qh->ferr, 7074, "qhull warning: more than 2^32 ridges. Qhull results are OK. Since the ridge ID wraps around to 0, two ridges may have the same identifier.\n");
qh->ridge_id = 0;
} else {
qh->ridge_id++;
}
ridge->id= qh->ridge_id++;
trace4((qh, qh->ferr, 4056, "qh_newridge: created ridge r%d\n", ridge->id));
return(ridge);
} /* newridge */
Expand Down Expand Up @@ -1176,10 +1179,14 @@ int qh_pointid(qhT *qh, pointT *point) {
offset= (ptr_intT)(point - qh->first_point);
/* coverity[divide_arg] */
id= offset / qh->hull_dim;
}else if ((id= qh_setindex(qh->other_points, point)) != -1)
id += qh->num_points;
else
return qh_IDunknown;
} else {
id = qh_setindex(qh->other_points, point);
if (id >= 0) {
id += qh->num_points;
} else {
return qh_IDunknown;
}
}
return (int)id;
} /* pointid */

Expand Down
6 changes: 4 additions & 2 deletions apps/argparse/argparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2041,8 +2041,10 @@ class ArgumentParser {
}

stream << std::setw(2) << " ";
stream << std::setw(static_cast<int>(longest_arg_length - 2))
<< command;
if (longest_arg_length >= 2) {
stream << std::setw(static_cast<int>(longest_arg_length - 2))
<< command;
}
stream << " " << subparser->get().m_description << "\n";
}
}
Expand Down
8 changes: 4 additions & 4 deletions apps/gdalargumentparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ GDALArgumentParser::GDALArgumentParser(const std::string &program_name,
add_argument("-h", "--help")
.flag()
.action(
[this, program_name](const auto &)
[this](const auto &)
{
std::cout << usage() << std::endl << std::endl;
std::cout << _("Note: ") << program_name
std::cout << _("Note: ") << m_program_name
<< _(" --long-usage for full help.") << std::endl;
std::exit(0);
})
Expand All @@ -77,11 +77,11 @@ GDALArgumentParser::GDALArgumentParser(const std::string &program_name,
.flag()
.hidden()
.action(
[program_name](const auto &)
[this](const auto &)
{
printf("%s was compiled against GDAL %s and "
"is running against GDAL %s\n",
program_name.c_str(), GDAL_RELEASE_NAME,
m_program_name.c_str(), GDAL_RELEASE_NAME,
GDALVersionInfo("RELEASE_NAME"));
std::exit(0);
})
Expand Down
2 changes: 2 additions & 0 deletions apps/gdalenhance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,8 @@ static int ComputeEqualizationLUTs(GDALDatasetH hDataset, int nLUTBins,
panLUT[iLUT] = std::max(0, std::min(nLUTBins - 1, nValue));
}

CPLFree(panCumHist);

(*ppapanLUTs)[iBand] = panLUT;
}

Expand Down
Loading

0 comments on commit 5b641ea

Please sign in to comment.