From dd3a3c08f689ec7540e985e80cc9b534a4f2930d Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 14 Nov 2023 13:17:44 +0100 Subject: [PATCH] Replace uses of cpl::make_unique<> with std::make_unique<> --- alg/gdalgeoloc.cpp | 4 +- alg/gdaltransformer.cpp | 2 +- apps/gdal_footprint_lib.cpp | 28 ++-- apps/gdalmdimtranslate_lib.cpp | 2 +- apps/gdalwarp_lib.cpp | 12 +- apps/nearblack_lib.cpp | 4 +- apps/ogr2ogr_lib.cpp | 6 +- apps/ogrinfo_bin.cpp | 2 +- apps/ogrinfo_lib.cpp | 4 +- autotest/cpp/test_ogr_swq.cpp | 4 +- frmts/arg/argdataset.cpp | 2 +- frmts/basisu_ktx2/basisudataset.cpp | 4 +- frmts/basisu_ktx2/ktx2dataset.cpp | 4 +- frmts/blx/blxdataset.cpp | 2 +- frmts/ceos2/sar_ceosdataset.cpp | 2 +- frmts/daas/daasdataset.cpp | 4 +- frmts/envisat/envisatdataset.cpp | 2 +- frmts/ers/ersdataset.cpp | 4 +- frmts/exr/exrdataset.cpp | 4 +- frmts/fits/fitsdataset.cpp | 2 +- frmts/grib/gribdataset.cpp | 6 +- frmts/gsg/gsbgdataset.cpp | 2 +- frmts/gtiff/geotiff.cpp | 2 +- frmts/hdf4/hdf4dataset.cpp | 2 +- frmts/hdf5/bagdataset.cpp | 4 +- frmts/hdf5/hdf5dataset.cpp | 2 +- frmts/hdf5/hdf5eosparser.cpp | 6 +- frmts/hdf5/hdf5multidim.cpp | 2 +- frmts/hdf5/s102dataset.cpp | 2 +- frmts/heif/heifdataset.cpp | 4 +- frmts/hfa/hfaopen.cpp | 2 +- frmts/hfa/hfatype.cpp | 2 +- frmts/jdem/jdemdataset.cpp | 2 +- frmts/jpeg/jpgdataset.cpp | 2 +- frmts/jpegxl/jpegxl.cpp | 4 +- frmts/netcdf/netcdfdataset.cpp | 2 +- frmts/netcdf/netcdfsg.cpp | 2 +- frmts/ogcapi/gdalogcapidataset.cpp | 4 +- frmts/pdf/pdfcreatefromcomposition.cpp | 12 +- frmts/pdf/pdfdataset.cpp | 6 +- frmts/pdf/pdfobject.cpp | 8 +- frmts/pds/isis2dataset.cpp | 2 +- frmts/pds/isis3dataset.cpp | 8 +- frmts/pds/pds4dataset.cpp | 10 +- frmts/pds/vicardataset.cpp | 6 +- frmts/postgisraster/postgisrasterdataset.cpp | 2 +- frmts/r/rdataset.cpp | 4 +- frmts/raw/ace2dataset.cpp | 4 +- frmts/raw/byndataset.cpp | 4 +- frmts/raw/cpgdataset.cpp | 2 +- frmts/raw/ctable2dataset.cpp | 2 +- frmts/raw/dipxdataset.cpp | 2 +- frmts/raw/doq1dataset.cpp | 2 +- frmts/raw/doq2dataset.cpp | 2 +- frmts/raw/ehdrdataset.cpp | 4 +- frmts/raw/eirdataset.cpp | 2 +- frmts/raw/envidataset.cpp | 4 +- frmts/raw/fastdataset.cpp | 2 +- frmts/raw/genbindataset.cpp | 2 +- frmts/raw/gscdataset.cpp | 2 +- frmts/raw/gtxdataset.cpp | 4 +- frmts/raw/hkvdataset.cpp | 4 +- frmts/raw/iscedataset.cpp | 4 +- frmts/raw/krodataset.cpp | 2 +- frmts/raw/landataset.cpp | 2 +- frmts/raw/lcpdataset.cpp | 2 +- frmts/raw/loslasdataset.cpp | 2 +- frmts/raw/mffdataset.cpp | 4 +- frmts/raw/ndfdataset.cpp | 2 +- frmts/raw/noaabdataset.cpp | 2 +- frmts/raw/nsidcbindataset.cpp | 4 +- frmts/raw/ntv2dataset.cpp | 2 +- frmts/raw/pauxdataset.cpp | 4 +- frmts/raw/pnmdataset.cpp | 2 +- frmts/raw/roipacdataset.cpp | 2 +- frmts/raw/rrasterdataset.cpp | 4 +- frmts/raw/snodasdataset.cpp | 4 +- frmts/safe/safedataset.cpp | 4 +- frmts/stacit/stacitdataset.cpp | 2 +- frmts/stacta/stactadataset.cpp | 4 +- frmts/tiledb/tiledbdense.cpp | 4 +- frmts/tiledb/tiledbsparse.cpp | 40 +++--- frmts/vrt/vrtmultidim.cpp | 10 +- frmts/webp/webpdataset.cpp | 2 +- frmts/wms/wmsdriver.cpp | 2 +- frmts/zarr/zarr_v3_array.cpp | 2 +- frmts/zarr/zarr_v3_codec.cpp | 20 +-- frmts/zarr/zarr_v3_group.cpp | 2 +- frmts/zarr/zarrdriver.cpp | 4 +- gcore/gdaldataset.cpp | 6 +- gcore/gdalmultidim.cpp | 2 +- gcore/overview.cpp | 2 +- gcore/rawdataset.cpp | 4 +- ogr/gml2ogrgeometry.cpp | 124 +++++++++--------- ogr/ogrfeaturedefn.cpp | 6 +- ogr/ogrpgeogeometry.cpp | 2 +- .../amigocloud/ogramigocloudlayer.cpp | 2 +- .../amigocloud/ogramigocloudtablelayer.cpp | 2 +- ogr/ogrsf_frmts/arrow/ogrfeatherdriver.cpp | 8 +- .../arrow/ogrfeatherwriterdataset.cpp | 2 +- .../arrow_common/ograrrowlayer.hpp | 4 +- ogr/ogrsf_frmts/carto/ogrcartolayer.cpp | 4 +- ogr/ogrsf_frmts/carto/ogrcartotablelayer.cpp | 6 +- ogr/ogrsf_frmts/csv/ogrcsvdatasource.cpp | 8 +- ogr/ogrsf_frmts/dxf/ogrdxflayer.cpp | 52 ++++---- .../elastic/ogrelasticdatasource.cpp | 2 +- ogr/ogrsf_frmts/flatgeobuf/geometryreader.cpp | 22 ++-- .../flatgeobuf/ogrflatgeobuflayer.cpp | 4 +- ogr/ogrsf_frmts/generic/ogr_gensql.cpp | 4 +- ogr/ogrsf_frmts/generic/ogrunionlayer.cpp | 10 +- ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp | 2 +- ogr/ogrsf_frmts/geojson/ogrgeojsonreader.cpp | 4 +- .../geojson/ogrgeojsonseqdriver.cpp | 2 +- ogr/ogrsf_frmts/geojson/ogrtopojsonreader.cpp | 4 +- .../gpkg/ogrgeopackagedatasource.cpp | 4 +- ogr/ogrsf_frmts/gpkg/ogrgeopackagedriver.cpp | 2 +- .../gpkg/ogrgeopackagetablelayer.cpp | 12 +- ogr/ogrsf_frmts/gtfs/ogrgtfsdriver.cpp | 10 +- ogr/ogrsf_frmts/hana/ogrhanadatasource.cpp | 6 +- ogr/ogrsf_frmts/hana/ogrhanadriver.cpp | 6 +- ogr/ogrsf_frmts/hana/ogrhanalayer.cpp | 6 +- ogr/ogrsf_frmts/hana/ogrhanatablelayer.cpp | 2 +- ogr/ogrsf_frmts/jsonfg/ogrjsonfgdataset.cpp | 8 +- ogr/ogrsf_frmts/jsonfg/ogrjsonfgdriver.cpp | 4 +- ogr/ogrsf_frmts/jsonfg/ogrjsonfgreader.cpp | 20 +-- .../jsonfg/ogrjsonfgstreamingparser.cpp | 2 +- ogr/ogrsf_frmts/lvbag/ogrlvbagdriver.cpp | 2 +- ogr/ogrsf_frmts/lvbag/ogrlvbaglayer.cpp | 6 +- ogr/ogrsf_frmts/mitab/mitab_feature.cpp | 2 +- ogr/ogrsf_frmts/mitab/mitab_feature_mif.cpp | 2 +- ogr/ogrsf_frmts/mitab/mitab_mapfile.cpp | 2 +- .../mongodbv3/ogrmongodbv3driver.cpp | 2 +- .../ogrmssqlspatialtablelayer.cpp | 2 +- ogr/ogrsf_frmts/mvt/ogrmvtdataset.cpp | 8 +- ogr/ogrsf_frmts/mysql/ogrmysqlresultlayer.cpp | 2 +- ogr/ogrsf_frmts/mysql/ogrmysqltablelayer.cpp | 2 +- .../openfilegdb/filegdbindex_write.cpp | 2 +- ogr/ogrsf_frmts/openfilegdb/filegdbtable.cpp | 6 +- .../openfilegdb/filegdbtable_write_fields.cpp | 2 +- .../openfilegdb/gdalopenfilegdbrasterband.cpp | 12 +- ogr/ogrsf_frmts/openfilegdb/ogr_openfilegdb.h | 2 +- .../openfilegdb/ogropenfilegdbdatasource.cpp | 14 +- .../ogropenfilegdbdatasource_write.cpp | 122 ++++++++--------- .../openfilegdb/ogropenfilegdbdriver.cpp | 6 +- .../openfilegdb/ogropenfilegdblayer.cpp | 4 +- .../openfilegdb/ogropenfilegdblayer_write.cpp | 6 +- ogr/ogrsf_frmts/parquet/ogrparquetdriver.cpp | 10 +- .../parquet/ogrparquetwriterdataset.cpp | 2 +- ogr/ogrsf_frmts/pg/ogrpglayer.cpp | 4 +- ogr/ogrsf_frmts/pg/ogrpgtablelayer.cpp | 8 +- .../pgdump/ogrpgdumpdatasource.cpp | 4 +- ogr/ogrsf_frmts/pgdump/ogrpgdumplayer.cpp | 2 +- ogr/ogrsf_frmts/pmtiles/ogrpmtilesdataset.cpp | 2 +- ogr/ogrsf_frmts/pmtiles/ogrpmtilesdriver.cpp | 4 +- .../pmtiles/ogrpmtilesvectorlayer.cpp | 2 +- ogr/ogrsf_frmts/pmtiles/vsipmtiles.cpp | 2 +- ogr/ogrsf_frmts/shape/ogrshapelayer.cpp | 2 +- ogr/ogrsf_frmts/sosi/ogrsosilayer.cpp | 4 +- ogr/ogrsf_frmts/sqlite/ogrsqlitelayer.cpp | 18 +-- .../sqlite/ogrsqlitetablelayer.cpp | 4 +- ogr/ogrsf_frmts/sqlite/ogrsqliteutility.cpp | 2 +- .../sqlite/ogrsqlitevirtualogr.cpp | 2 +- ogr/ogrsf_frmts/sxf/ogrsxfdatasource.cpp | 10 +- ogr/ogrsf_frmts/wasp/ogrwaspdriver.cpp | 2 +- ogr/ogrsf_frmts/wasp/ogrwasplayer.cpp | 6 +- ogr/ogrsf_frmts/wfs/ogroapifdriver.cpp | 8 +- perftests/bench_ogr_batch.cpp | 2 +- perftests/bench_ogr_c_api.cpp | 2 +- port/cpl_vsil_adls.cpp | 2 +- port/cpl_vsil_az.cpp | 2 +- port/cpl_vsil_curl.cpp | 4 +- port/cpl_vsil_gs.cpp | 2 +- port/cpl_vsil_oss.cpp | 2 +- port/cpl_vsil_s3.cpp | 2 +- port/cpl_vsil_swift.cpp | 2 +- port/cpl_vsil_webhdfs.cpp | 2 +- 176 files changed, 542 insertions(+), 542 deletions(-) diff --git a/alg/gdalgeoloc.cpp b/alg/gdalgeoloc.cpp index 5d6ba389e9e8..334f24f6bb7b 100644 --- a/alg/gdalgeoloc.cpp +++ b/alg/gdalgeoloc.cpp @@ -260,7 +260,7 @@ void GDALGeoLoc::LoadGeolocFinish( poRing->addPoint(x1 > 0 ? x1 : x1 + 360, y1); poRing->addPoint(x0 > 0 ? x0 : x0 + 360, y0); poPoly->addRingDirectly(poRing); - auto poFeature = cpl::make_unique(poLayerDefn); + auto poFeature = std::make_unique(poLayerDefn); poFeature->SetField(0, static_cast(iX)); poFeature->SetField(1, static_cast(iY)); poFeature->SetGeometryDirectly(poPoly); @@ -283,7 +283,7 @@ void GDALGeoLoc::LoadGeolocFinish( poRing->addPoint(x1, y1); poRing->addPoint(x0, y0); poPoly->addRingDirectly(poRing); - auto poFeature = cpl::make_unique(poLayerDefn); + auto poFeature = std::make_unique(poLayerDefn); poFeature->SetField(0, static_cast(iX)); poFeature->SetField(1, static_cast(iY)); poFeature->SetGeometryDirectly(poPoly); diff --git a/alg/gdaltransformer.cpp b/alg/gdaltransformer.cpp index 5e59858eff62..aba93fc19781 100644 --- a/alg/gdaltransformer.cpp +++ b/alg/gdaltransformer.cpp @@ -958,7 +958,7 @@ CPLErr CPL_STDCALL GDALSuggestedWarpOutput2(GDALDatasetH hSrcDS, { // CHECK_WITH_INVERT_PROJ=YES prevent reliable // transformation of poles. - poSetter = cpl::make_unique( + poSetter = std::make_unique( "CHECK_WITH_INVERT_PROJ", "NO", false); GDALRefreshGenImgProjTransformer(pTransformArg); // GDALRefreshGenImgProjTransformer() has invalidated psRTI diff --git a/apps/gdal_footprint_lib.cpp b/apps/gdal_footprint_lib.cpp index da03f7f37439..dd02f0b911e8 100644 --- a/apps/gdal_footprint_lib.cpp +++ b/apps/gdal_footprint_lib.cpp @@ -694,7 +694,7 @@ static bool GDALFootprintProcess(GDALDataset *poSrcDS, OGRLayer *poDstLayer, { bGlobalMask = false; apoTmpNoDataMaskBands.emplace_back( - cpl::make_unique( + std::make_unique( poBand, adfSrcNoData.size() == 1 ? adfSrcNoData[0] : adfSrcNoData[i])); apoSrcMaskBands.push_back(apoTmpNoDataMaskBands.back().get()); @@ -798,7 +798,7 @@ static bool GDALFootprintProcess(GDALDataset *poSrcDS, OGRLayer *poDstLayer, double(poSrcDS->GetRasterXSize()) / poMaskBand->GetXSize(); adfGeoTransform[5] *= double(poSrcDS->GetRasterYSize()) / poMaskBand->GetYSize(); - poCT_GT = cpl::make_unique( + poCT_GT = std::make_unique( adfGeoTransform); } else if (psOptions->bOutCSGeorefRequested) @@ -819,7 +819,7 @@ static bool GDALFootprintProcess(GDALDataset *poSrcDS, OGRLayer *poDstLayer, adfGeoTransform[4] = 0; adfGeoTransform[5] = double(poSrcDS->GetRasterYSize()) / poMaskBand->GetYSize(); - poCT_GT = cpl::make_unique( + poCT_GT = std::make_unique( adfGeoTransform); } @@ -827,16 +827,16 @@ static bool GDALFootprintProcess(GDALDataset *poSrcDS, OGRLayer *poDstLayer, if (bGlobalMask || anBands.size() == 1) { poMaskForRasterize = - cpl::make_unique(apoSrcMaskBands[0]); + std::make_unique(apoSrcMaskBands[0]); } else { - poMaskForRasterize = cpl::make_unique( + poMaskForRasterize = std::make_unique( apoSrcMaskBands, psOptions->bCombineBandsUnion); } auto hBand = GDALRasterBand::ToHandle(poMaskForRasterize.get()); - auto poMemLayer = cpl::make_unique("", nullptr, wkbUnknown); + auto poMemLayer = std::make_unique("", nullptr, wkbUnknown); const CPLErr eErr = GDALPolygonize(hBand, hBand, OGRLayer::ToHandle(poMemLayer.get()), /* iPixValField = */ -1, @@ -849,7 +849,7 @@ static bool GDALFootprintProcess(GDALDataset *poSrcDS, OGRLayer *poDstLayer, if (!psOptions->bSplitPolys) { - auto poMP = cpl::make_unique(); + auto poMP = std::make_unique(); for (auto &&poFeature : poMemLayer.get()) { auto poGeom = @@ -860,9 +860,9 @@ static bool GDALFootprintProcess(GDALDataset *poSrcDS, OGRLayer *poDstLayer, poMP->addGeometryDirectly(poGeom.release()); } } - poMemLayer = cpl::make_unique("", nullptr, wkbUnknown); + poMemLayer = std::make_unique("", nullptr, wkbUnknown); auto poFeature = - cpl::make_unique(poMemLayer->GetLayerDefn()); + std::make_unique(poMemLayer->GetLayerDefn()); poFeature->SetGeometryDirectly(poMP.release()); CPL_IGNORE_RET_VAL(poMemLayer->CreateFeature(poFeature.get())); } @@ -875,7 +875,7 @@ static bool GDALFootprintProcess(GDALDataset *poSrcDS, OGRLayer *poDstLayer, continue; auto poDstFeature = - cpl::make_unique(poDstLayer->GetLayerDefn()); + std::make_unique(poDstLayer->GetLayerDefn()); poDstFeature->SetFrom(poFeature.get()); if (poCT_GT) @@ -912,10 +912,10 @@ static bool GDALFootprintProcess(GDALDataset *poSrcDS, OGRLayer *poDstLayer, { if (poGeom->getGeometryType() == wkbMultiPolygon) { - auto poMP = cpl::make_unique(); + auto poMP = std::make_unique(); for (auto *poPoly : poGeom->toMultiPolygon()) { - auto poNewPoly = cpl::make_unique(); + auto poNewPoly = std::make_unique(); for (auto *poRing : poPoly) { if (poRing->get_Area() >= psOptions->dfMinRingArea) @@ -930,7 +930,7 @@ static bool GDALFootprintProcess(GDALDataset *poSrcDS, OGRLayer *poDstLayer, } else if (poGeom->getGeometryType() == wkbPolygon) { - auto poNewPoly = cpl::make_unique(); + auto poNewPoly = std::make_unique(); for (auto *poRing : poGeom->toPolygon()) { if (poRing->get_Area() >= psOptions->dfMinRingArea) @@ -1145,7 +1145,7 @@ GDALFootprintOptions * GDALFootprintOptionsNew(char **papszArgv, GDALFootprintOptionsForBinary *psOptionsForBinary) { - auto psOptions = cpl::make_unique(); + auto psOptions = std::make_unique(); bool bGotSourceFilename = false; bool bGotDestFilename = false; diff --git a/apps/gdalmdimtranslate_lib.cpp b/apps/gdalmdimtranslate_lib.cpp index 413b75bdbf96..c7257e1a011e 100644 --- a/apps/gdalmdimtranslate_lib.cpp +++ b/apps/gdalmdimtranslate_lib.cpp @@ -1176,7 +1176,7 @@ static bool TranslateArray( if (!bSrcArrayAccessibleThroughSrcGroup && tmpArray->IsRegularlySpaced(dfStart, dfIncrement)) { - auto poSource = cpl::make_unique( + auto poSource = std::make_unique( dfStart, dfIncrement); dstArrayVRT->AddSource(std::move(poSource)); } diff --git a/apps/gdalwarp_lib.cpp b/apps/gdalwarp_lib.cpp index e49c35d91e14..6fa13e45feac 100644 --- a/apps/gdalwarp_lib.cpp +++ b/apps/gdalwarp_lib.cpp @@ -461,7 +461,7 @@ static CPLErr CropToCutline(const OGRGeometry *poCutline, CSLConstList papszTO, GetSrcDSProjection(nSrcCount > 0 ? pahSrcDS[0] : nullptr, papszTO); if (!osThisSourceSRS.empty()) { - poSrcSRS = cpl::make_unique(); + poSrcSRS = std::make_unique(); poSrcSRS->SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); if (poSrcSRS->SetFromUserInput(osThisSourceSRS) != OGRERR_NONE) { @@ -492,7 +492,7 @@ static CPLErr CropToCutline(const OGRGeometry *poCutline, CSLConstList papszTO, if (pszThisTargetSRS) { - poDstSRS = cpl::make_unique(); + poDstSRS = std::make_unique(); poDstSRS->SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); if (poDstSRS->SetFromUserInput(pszThisTargetSRS) != OGRERR_NONE) { @@ -3336,7 +3336,7 @@ static CPLErr LoadCutline(const std::string &osCutlineDSName, /* Collect the geometries from this layer, and build list of */ /* burn values. */ /* -------------------------------------------------------------------- */ - auto poMultiPolygon = cpl::make_unique(); + auto poMultiPolygon = std::make_unique(); for (auto &&poFeature : poLayer) { @@ -4776,7 +4776,7 @@ static CPLErr TransformCutlineToSource(GDALDataset *poSrcDS, GetSrcDSProjection(GDALDataset::ToHandle(poSrcDS), papszTO_In); if (!osProjection.empty()) { - poRasterSRS = cpl::make_unique(); + poRasterSRS = std::make_unique(); poRasterSRS->SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); if (poRasterSRS->SetFromUserInput(osProjection) != OGRERR_NONE) { @@ -4788,7 +4788,7 @@ static CPLErr TransformCutlineToSource(GDALDataset *poSrcDS, const char *pszThisTargetSRS = CSLFetchNameValue(papszTO_In, "DST_SRS"); if (pszThisTargetSRS) { - poDstSRS = cpl::make_unique(); + poDstSRS = std::make_unique(); poDstSRS->SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); if (poDstSRS->SetFromUserInput(pszThisTargetSRS) != OGRERR_NONE) { @@ -5204,7 +5204,7 @@ GDALWarpAppOptions * GDALWarpAppOptionsNew(char **papszArgv, GDALWarpAppOptionsForBinary *psOptionsForBinary) { - auto psOptions = cpl::make_unique(); + auto psOptions = std::make_unique(); /* -------------------------------------------------------------------- */ /* Parse arguments. */ diff --git a/apps/nearblack_lib.cpp b/apps/nearblack_lib.cpp index f29da2e0928b..7450c6df6751 100644 --- a/apps/nearblack_lib.cpp +++ b/apps/nearblack_lib.cpp @@ -117,7 +117,7 @@ GDALDatasetH CPL_DLL GDALNearblack(const char *pszDest, GDALDatasetH hDstDS, const GDALNearblackOptions *psOptions = psOptionsIn; if (!psOptionsIn) { - psTmpOptions = cpl::make_unique(); + psTmpOptions = std::make_unique(); psOptions = psTmpOptions.get(); } @@ -769,7 +769,7 @@ GDALNearblackOptions * GDALNearblackOptionsNew(char **papszArgv, GDALNearblackOptionsForBinary *psOptionsForBinary) { - auto psOptions = cpl::make_unique(); + auto psOptions = std::make_unique(); /* -------------------------------------------------------------------- */ /* Handle command line arguments. */ diff --git a/apps/ogr2ogr_lib.cpp b/apps/ogr2ogr_lib.cpp index 8373818f74ca..7d9bd96444b1 100644 --- a/apps/ogr2ogr_lib.cpp +++ b/apps/ogr2ogr_lib.cpp @@ -2166,8 +2166,8 @@ GDALDatasetH GDALVectorTranslate(const char *pszDest, GDALDatasetH hDstDS, } auto psOptions = - psOptionsIn ? cpl::make_unique(*psOptionsIn) - : cpl::make_unique(); + psOptionsIn ? std::make_unique(*psOptionsIn) + : std::make_unique(); bool bAppend = false; bool bUpdate = false; @@ -6466,7 +6466,7 @@ static bool CheckHasEnoughAdditionalArgs(CSLConstList papszArgv, int i, GDALVectorTranslateOptions *GDALVectorTranslateOptionsNew( char **papszArgv, GDALVectorTranslateOptionsForBinary *psOptionsForBinary) { - auto psOptions = cpl::make_unique(); + auto psOptions = std::make_unique(); int nArgc = CSLCount(papszArgv); for (int i = 0; papszArgv != nullptr && i < nArgc; i++) diff --git a/apps/ogrinfo_bin.cpp b/apps/ogrinfo_bin.cpp index c637db890724..c78809c901fa 100644 --- a/apps/ogrinfo_bin.cpp +++ b/apps/ogrinfo_bin.cpp @@ -104,7 +104,7 @@ MAIN_START(argc, argv) argv = CSLAddString(argv, "-stdout"); auto psOptionsForBinary = - cpl::make_unique(); + std::make_unique(); GDALVectorInfoOptions *psOptions = GDALVectorInfoOptionsNew(argv + 1, psOptionsForBinary.get()); diff --git a/apps/ogrinfo_lib.cpp b/apps/ogrinfo_lib.cpp index f2b8bb305e88..58940651d94c 100644 --- a/apps/ogrinfo_lib.cpp +++ b/apps/ogrinfo_lib.cpp @@ -2030,7 +2030,7 @@ GDALVectorInfoOptions * GDALVectorInfoOptionsNew(char **papszArgv, GDALVectorInfoOptionsForBinary *psOptionsForBinary) { - auto psOptions = cpl::make_unique(); + auto psOptions = std::make_unique(); bool bGotFilename = false; bool bFeatures = false; bool bSummary = false; @@ -2095,7 +2095,7 @@ GDALVectorInfoOptionsNew(char **papszArgv, oRing.addPoint(CPLAtof(papszArgv[iArg + 1]), CPLAtof(papszArgv[iArg + 2])); - auto poPolygon = cpl::make_unique(); + auto poPolygon = std::make_unique(); poPolygon->addRing(&oRing); psOptions->poSpatialFilter.reset(poPolygon.release()); iArg += 4; diff --git a/autotest/cpp/test_ogr_swq.cpp b/autotest/cpp/test_ogr_swq.cpp index ef6b3a23f224..eecfd77600dd 100644 --- a/autotest/cpp/test_ogr_swq.cpp +++ b/autotest/cpp/test_ogr_swq.cpp @@ -59,8 +59,8 @@ TEST_F(test_ogr_swq, basic) swq_expr_node(SWQ_OR), swq_expr_node(SWQ_NOT), swq_expr_node(static_cast(nullptr)), - swq_expr_node(cpl::make_unique(1, 2).get()), - swq_expr_node(cpl::make_unique(1, 3).get()), + swq_expr_node(std::make_unique(1, 2).get()), + swq_expr_node(std::make_unique(1, 3).get()), }; { auto node = swq_expr_node(SWQ_NOT); diff --git a/frmts/arg/argdataset.cpp b/frmts/arg/argdataset.cpp index 800375e05a62..0bd233f92c42 100644 --- a/frmts/arg/argdataset.cpp +++ b/frmts/arg/argdataset.cpp @@ -562,7 +562,7 @@ GDALDataset *ARGDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->pszFilename = CPLStrdup(poOpenInfo->pszFilename); poDS->SetMetadataItem("LAYER", pszLayer, nullptr); diff --git a/frmts/basisu_ktx2/basisudataset.cpp b/frmts/basisu_ktx2/basisudataset.cpp index 08cd85dd6bf4..3dd3b8b3941c 100644 --- a/frmts/basisu_ktx2/basisudataset.cpp +++ b/frmts/basisu_ktx2/basisudataset.cpp @@ -306,7 +306,7 @@ GDALDataset *BASISUDataset::Open(GDALOpenInfo *poOpenInfo) } const uint32_t nSize = static_cast(nSizeLarge); - auto poDS = cpl::make_unique( + auto poDS = std::make_unique( nImageIdx != static_cast(-1) ? nImageIdx : 0, pabyRet, nSize); auto &transcoder = poDS->m_transcoder; basist::basisu_file_info file_info; @@ -376,7 +376,7 @@ GDALDataset *BASISUDataset::Open(GDALOpenInfo *poOpenInfo) poDS->m_iImageIdx, level_index)) { auto poOverviewDS = - cpl::make_unique(poDS.get(), level_index); + std::make_unique(poDS.get(), level_index); for (int i = 1; i <= l_nBands; ++i) { poOverviewDS->SetBand( diff --git a/frmts/basisu_ktx2/ktx2dataset.cpp b/frmts/basisu_ktx2/ktx2dataset.cpp index 72aae06b8345..6a960e72d096 100644 --- a/frmts/basisu_ktx2/ktx2dataset.cpp +++ b/frmts/basisu_ktx2/ktx2dataset.cpp @@ -297,7 +297,7 @@ GDALDataset *KTX2Dataset::Open(GDALOpenInfo *poOpenInfo) } const uint32_t nSize = static_cast(nSizeLarge); - auto poDS = cpl::make_unique( + auto poDS = std::make_unique( nLayer != static_cast(-1) ? nLayer : 0, nFace != static_cast(-1) ? nFace : 0, pabyRet); auto &transcoder = poDS->m_transcoder; @@ -409,7 +409,7 @@ GDALDataset *KTX2Dataset::Open(GDALOpenInfo *poOpenInfo) if (level_index > 0) { auto poOverviewDS = - cpl::make_unique(poDS.get(), level_index); + std::make_unique(poDS.get(), level_index); for (int i = 1; i <= l_nBands; ++i) { poOverviewDS->SetBand( diff --git a/frmts/blx/blxdataset.cpp b/frmts/blx/blxdataset.cpp index d2a25e021908..6e51f519c965 100644 --- a/frmts/blx/blxdataset.cpp +++ b/frmts/blx/blxdataset.cpp @@ -124,7 +124,7 @@ GDALDataset *BLXDataset::Open(GDALOpenInfo *poOpenInfo) // Create overview bands for (int i = 0; i < BLX_OVERVIEWLEVELS; i++) { - poDS->apoOverviewDS.emplace_back(cpl::make_unique()); + poDS->apoOverviewDS.emplace_back(std::make_unique()); poDS->apoOverviewDS[i]->blxcontext = poDS->blxcontext; poDS->apoOverviewDS[i]->bIsOverview = true; poDS->apoOverviewDS[i]->nRasterXSize = poDS->nRasterXSize >> (i + 1); diff --git a/frmts/ceos2/sar_ceosdataset.cpp b/frmts/ceos2/sar_ceosdataset.cpp index e8cca96948fa..67bc9287be57 100644 --- a/frmts/ceos2/sar_ceosdataset.cpp +++ b/frmts/ceos2/sar_ceosdataset.cpp @@ -1813,7 +1813,7 @@ GDALDataset *SAR_CEOSDataset::Open(GDALOpenInfo *poOpenInfo) /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); std::swap(poDS->fpImage, poOpenInfo->fpL); CeosSARVolume_t *psVolume = &(poDS->sVolume); diff --git a/frmts/daas/daasdataset.cpp b/frmts/daas/daasdataset.cpp index da4c126e1aaf..d371067060a4 100644 --- a/frmts/daas/daasdataset.cpp +++ b/frmts/daas/daasdataset.cpp @@ -1323,7 +1323,7 @@ bool GDALDAASDataset::Open(GDALOpenInfo *poOpenInfo) break; } m_apoOverviewDS.push_back( - cpl::make_unique(this, iOvr)); + std::make_unique(this, iOvr)); } return true; @@ -1334,7 +1334,7 @@ GDALDataset *GDALDAASDataset::OpenStatic(GDALOpenInfo *poOpenInfo) if (!Identify(poOpenInfo)) return nullptr; - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); if (!poDS->Open(poOpenInfo)) return nullptr; return poDS.release(); diff --git a/frmts/envisat/envisatdataset.cpp b/frmts/envisat/envisatdataset.cpp index 57826613d78f..eb41b989c6fe 100644 --- a/frmts/envisat/envisatdataset.cpp +++ b/frmts/envisat/envisatdataset.cpp @@ -922,7 +922,7 @@ GDALDataset *EnvisatDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->hEnvisatFile = hEnvisatFile; diff --git a/frmts/ers/ersdataset.cpp b/frmts/ers/ersdataset.cpp index 6cb4a8a1a6e9..e5bd80e779ba 100644 --- a/frmts/ers/ersdataset.cpp +++ b/frmts/ers/ersdataset.cpp @@ -929,7 +929,7 @@ GDALDataset *ERSDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->poHeader = poHeader; poDS->eAccess = poOpenInfo->eAccess; @@ -1092,7 +1092,7 @@ GDALDataset *ERSDataset::Open(GDALOpenInfo *poOpenInfo) for (int iBand = 0; iBand < nBands; iBand++) { // Assume pixel interleaved. - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDS.get(), iBand + 1, poDS->fpImage, nHeaderOffset + iWordSize * iBand * poDS->nRasterXSize, iWordSize, iWordSize * nBands * poDS->nRasterXSize, eType, diff --git a/frmts/exr/exrdataset.cpp b/frmts/exr/exrdataset.cpp index 1ac5d1b3dc5d..56c5da2dc62d 100644 --- a/frmts/exr/exrdataset.cpp +++ b/frmts/exr/exrdataset.cpp @@ -578,7 +578,7 @@ GDALDataset *GDALEXRDataset::Open(GDALOpenInfo *poOpenInfo) try { - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->m_pIStream.reset(new GDALEXRIOStream(fp, osFilename)); poDS->m_pMPIF.reset(new MultiPartInputFile(*poDS->m_pIStream)); if (iPart > 0 && iPart > poDS->m_pMPIF->parts()) @@ -742,7 +742,7 @@ GDALDataset *GDALEXRDataset::Open(GDALOpenInfo *poOpenInfo) { break; } - auto poOvrDS = cpl::make_unique(); + auto poOvrDS = std::make_unique(); // coverity[escape] poOvrDS->m_poParent = poDS.get(); poOvrDS->m_iLevel = iLevel; diff --git a/frmts/fits/fitsdataset.cpp b/frmts/fits/fitsdataset.cpp index aeaeec7557ac..ff88d193224a 100644 --- a/frmts/fits/fitsdataset.cpp +++ b/frmts/fits/fitsdataset.cpp @@ -2425,7 +2425,7 @@ GDALDataset *FITSDataset::Open(GDALOpenInfo *poOpenInfo) return nullptr; } // Create a FITSDataset object - auto dataset = cpl::make_unique(); + auto dataset = std::make_unique(); dataset->m_isExistingFile = true; dataset->m_hFITS = hFITS; dataset->eAccess = poOpenInfo->eAccess; diff --git a/frmts/grib/gribdataset.cpp b/frmts/grib/gribdataset.cpp index f9c5725377af..89ceb21c0743 100644 --- a/frmts/grib/gribdataset.cpp +++ b/frmts/grib/gribdataset.cpp @@ -1340,7 +1340,7 @@ GRIBDataset::Inventory(VSILFILE *fp, GDALOpenInfo *poOpenInfo) CPLDebug("GRIB", "Reading inventories from sidecar file %s", sSideCarFilename.c_str()); // Contains an GRIB2 message inventory of the file. - pInventories = cpl::make_unique(fpSideCar); + pInventories = std::make_unique(fpSideCar); if (pInventories->result() <= 0 || pInventories->length() == 0) pInventories = nullptr; VSIFCloseL(fpSideCar); @@ -1353,7 +1353,7 @@ GRIBDataset::Inventory(VSILFILE *fp, GDALOpenInfo *poOpenInfo) CPLDebug("GRIB", "Reading inventories from GRIB file %s", poOpenInfo->pszFilename); // Contains an GRIB2 message inventory of the file. - pInventories = cpl::make_unique(fp); + pInventories = std::make_unique(fp); } return pInventories; @@ -2224,7 +2224,7 @@ GDALDataset *GRIBDataset::OpenMultiDim(GDALOpenInfo *poOpenInfo) // Contains an GRIB2 message inventory of the file. // We can't use the potential .idx file - auto pInventories = cpl::make_unique(poShared->m_fp); + auto pInventories = std::make_unique(poShared->m_fp); if (pInventories->result() <= 0) { diff --git a/frmts/gsg/gsbgdataset.cpp b/frmts/gsg/gsbgdataset.cpp index 22702fed542f..0ca0f1387d91 100644 --- a/frmts/gsg/gsbgdataset.cpp +++ b/frmts/gsg/gsbgdataset.cpp @@ -506,7 +506,7 @@ GDALDataset *GSBGDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->eAccess = poOpenInfo->eAccess; poDS->fp = poOpenInfo->fpL; diff --git a/frmts/gtiff/geotiff.cpp b/frmts/gtiff/geotiff.cpp index b9e572eef5fa..7e0744268db9 100644 --- a/frmts/gtiff/geotiff.cpp +++ b/frmts/gtiff/geotiff.cpp @@ -1201,7 +1201,7 @@ static GDALSubdatasetInfo *GTiffDriverGetSubdatasetInfo(const char *pszFileName) if (STARTS_WITH_CI(pszFileName, "GTIFF_DIR:")) { std::unique_ptr info = - cpl::make_unique(pszFileName); + std::make_unique(pszFileName); if (!info->GetSubdatasetComponent().empty() && !info->GetPathComponent().empty()) { diff --git a/frmts/hdf4/hdf4dataset.cpp b/frmts/hdf4/hdf4dataset.cpp index 5b87e8a861a5..4304f351380e 100644 --- a/frmts/hdf4/hdf4dataset.cpp +++ b/frmts/hdf4/hdf4dataset.cpp @@ -1392,7 +1392,7 @@ static GDALSubdatasetInfo *HDF4DriverGetSubdatasetInfo(const char *pszFileName) STARTS_WITH_CI(pszFileName, "HDF4_EOS:")) { std::unique_ptr info = - cpl::make_unique(pszFileName); + std::make_unique(pszFileName); if (!info->GetSubdatasetComponent().empty() && !info->GetPathComponent().empty()) { diff --git a/frmts/hdf5/bagdataset.cpp b/frmts/hdf5/bagdataset.cpp index e38170376f96..94945598db0e 100644 --- a/frmts/hdf5/bagdataset.cpp +++ b/frmts/hdf5/bagdataset.cpp @@ -3406,7 +3406,7 @@ bool BAGDataset::OpenRaster(GDALOpenInfo *poOpenInfo, nRasterYSize / nOvrFactor >= nMinOvrSize; nOvrFactor *= 2) { - auto poOvrDS = cpl::make_unique(this, nOvrFactor); + auto poOvrDS = std::make_unique(this, nOvrFactor); for (int i = 1; i <= GetRasterCount(); i++) { @@ -3430,7 +3430,7 @@ bool BAGDataset::OpenRaster(GDALOpenInfo *poOpenInfo, // Use the low resolution grid as the last overview level if (bCanUseLowResAsOvr) { - auto poOvrDS = cpl::make_unique(this, m_nLowResWidth, + auto poOvrDS = std::make_unique(this, m_nLowResWidth, m_nLowResHeight); poElevBand = new BAGRasterBand(poOvrDS.get(), 1); diff --git a/frmts/hdf5/hdf5dataset.cpp b/frmts/hdf5/hdf5dataset.cpp index ab09e1485ca4..8fabc67b7652 100644 --- a/frmts/hdf5/hdf5dataset.cpp +++ b/frmts/hdf5/hdf5dataset.cpp @@ -152,7 +152,7 @@ static GDALSubdatasetInfo *HDF5DriverGetSubdatasetInfo(const char *pszFileName) if (STARTS_WITH_CI(pszFileName, "HDF5:")) { std::unique_ptr info = - cpl::make_unique(pszFileName); + std::make_unique(pszFileName); if (!info->GetSubdatasetComponent().empty() && !info->GetPathComponent().empty()) { diff --git a/frmts/hdf5/hdf5eosparser.cpp b/frmts/hdf5/hdf5eosparser.cpp index 380909cad08d..72ae6c393162 100644 --- a/frmts/hdf5/hdf5eosparser.cpp +++ b/frmts/hdf5/hdf5eosparser.cpp @@ -217,7 +217,7 @@ void HDF5EOSParser::ParseGridStructure(const CPLJSONObject &oGridStructure) const auto oDataFields = oGrid.GetObj("DataField"); const auto oDimensions = oGrid.GetObj("Dimension"); std::map oMapDimensionNameToSize; - auto poGridMetadata = cpl::make_unique(); + auto poGridMetadata = std::make_unique(); poGridMetadata->osGridName = osGridName; for (const auto &oDimension : oDimensions.GetChildren()) { @@ -342,7 +342,7 @@ void HDF5EOSParser::ParseSwathStructure(const CPLJSONObject &oSwathStructure) const auto oDimensions = oSwath.GetObj("Dimension"); std::map oMapDimensionNameToSize; - auto poSwathMetadata = cpl::make_unique(); + auto poSwathMetadata = std::make_unique(); poSwathMetadata->osSwathName = osSwathName; for (const auto &oDimension : oDimensions.GetChildren()) { @@ -667,7 +667,7 @@ std::unique_ptr HDF5EOSParser::GridMetadata::GetSRS() const { std::vector l_adfProjParams = adfProjParams; l_adfProjParams.resize(15); - auto poSRS = cpl::make_unique(); + auto poSRS = std::make_unique(); poSRS->SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); if (poSRS->importFromUSGS(nProjCode, nZone, l_adfProjParams.data(), nSphereCode) == OGRERR_NONE) diff --git a/frmts/hdf5/hdf5multidim.cpp b/frmts/hdf5/hdf5multidim.cpp index 1f759724f9d5..0d2d1ee725e1 100644 --- a/frmts/hdf5/hdf5multidim.cpp +++ b/frmts/hdf5/hdf5multidim.cpp @@ -2601,7 +2601,7 @@ std::shared_ptr HDF5Dataset::OpenGroup( if (HDF5EOSParser::HasHDFEOS(poGroup->GetID())) { poSharedResources->m_poHDF5EOSParser = - cpl::make_unique(); + std::make_unique(); if (poSharedResources->m_poHDF5EOSParser->Parse(poGroup->GetID())) { CPLDebug("HDF5", "Successfully parsed HDFEOS metadata"); diff --git a/frmts/hdf5/s102dataset.cpp b/frmts/hdf5/s102dataset.cpp index a55702c832cb..86fa0a05d606 100644 --- a/frmts/hdf5/s102dataset.cpp +++ b/frmts/hdf5/s102dataset.cpp @@ -277,7 +277,7 @@ GDALDataset *S102Dataset::Open(GDALOpenInfo *poOpenInfo) return nullptr; } - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); const bool bNorthUp = CPLTestBool( CSLFetchNameValueDef(poOpenInfo->papszOpenOptions, "NORTH_UP", "YES")); diff --git a/frmts/heif/heifdataset.cpp b/frmts/heif/heifdataset.cpp index 1e8af4f5fccf..0be13187c157 100644 --- a/frmts/heif/heifdataset.cpp +++ b/frmts/heif/heifdataset.cpp @@ -548,7 +548,7 @@ void GDALHEIFDataset::OpenThumbnails() } #endif - auto poOvrDS = cpl::make_unique(); + auto poOvrDS = std::make_unique(); poOvrDS->m_hImageHandle = hThumbnailHandle; poOvrDS->m_bIsThumbnail = true; poOvrDS->nRasterXSize = heif_image_handle_get_width(hThumbnailHandle); @@ -575,7 +575,7 @@ GDALDataset *GDALHEIFDataset::Open(GDALOpenInfo *poOpenInfo) return nullptr; } - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); if (!poDS->Init(poOpenInfo)) return nullptr; diff --git a/frmts/hfa/hfaopen.cpp b/frmts/hfa/hfaopen.cpp index 745f9e1f46db..eed333689a35 100644 --- a/frmts/hfa/hfaopen.cpp +++ b/frmts/hfa/hfaopen.cpp @@ -4033,7 +4033,7 @@ HFAPCSStructToOSR(const Eprj_Datum *psDatum, const Eprj_ProParameters *psPro, // We make a particular effort to adapt the mapinfo->proname as // the PROJCS[] name per #2422. - auto poSRS = cpl::make_unique(); + auto poSRS = std::make_unique(); poSRS->SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); if (psPro == nullptr && psMapInfo != nullptr) diff --git a/frmts/hfa/hfatype.cpp b/frmts/hfa/hfatype.cpp index 727eacba8eb0..244c4ff0e6ff 100644 --- a/frmts/hfa/hfatype.cpp +++ b/frmts/hfa/hfatype.cpp @@ -89,7 +89,7 @@ const char *HFAType::Initialize(const char *pszInput) // Read the field definitions. while (pszInput != nullptr && *pszInput != '}') { - auto poNewField = cpl::make_unique(); + auto poNewField = std::make_unique(); pszInput = poNewField->Initialize(pszInput); if (pszInput != nullptr) diff --git a/frmts/jdem/jdemdataset.cpp b/frmts/jdem/jdemdataset.cpp index a187c8e213b5..58aec9ad3151 100644 --- a/frmts/jdem/jdemdataset.cpp +++ b/frmts/jdem/jdemdataset.cpp @@ -332,7 +332,7 @@ GDALDataset *JDEMDataset::Open(GDALOpenInfo *poOpenInfo) } // Create a corresponding GDALDataset. - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); // Borrow the file pointer from GDALOpenInfo*. std::swap(poDS->m_fp, poOpenInfo->fpL); diff --git a/frmts/jpeg/jpgdataset.cpp b/frmts/jpeg/jpgdataset.cpp index 833a55f46d1e..e6544efc7df1 100644 --- a/frmts/jpeg/jpgdataset.cpp +++ b/frmts/jpeg/jpgdataset.cpp @@ -2791,7 +2791,7 @@ GDALDataset *JPGDatasetCommon::Open(GDALOpenInfo *poOpenInfo) int nOrientation = atoi(pszOrientation); if (nOrientation >= 2 && nOrientation <= 8) { - auto poOrientedDS = cpl::make_unique( + auto poOrientedDS = std::make_unique( std::move(poDS), static_cast(nOrientation)); poDS = std::move(poOrientedDS); diff --git a/frmts/jpegxl/jpegxl.cpp b/frmts/jpegxl/jpegxl.cpp index de2fb71c865f..0964d22c0759 100644 --- a/frmts/jpegxl/jpegxl.cpp +++ b/frmts/jpegxl/jpegxl.cpp @@ -1694,7 +1694,7 @@ GDALPamDataset *JPEGXLDataset::OpenStaticPAM(GDALOpenInfo *poOpenInfo) if (!Identify(poOpenInfo)) return nullptr; - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); if (!poDS->Open(poOpenInfo)) return nullptr; @@ -1721,7 +1721,7 @@ GDALDataset *JPEGXLDataset::OpenStatic(GDALOpenInfo *poOpenInfo) if (nOrientation >= 2 && nOrientation <= 8) { std::unique_ptr poOriDS(poDS); - auto poOrientedDS = cpl::make_unique( + auto poOrientedDS = std::make_unique( std::move(poOriDS), static_cast(nOrientation)); poDS = poOrientedDS.release(); diff --git a/frmts/netcdf/netcdfdataset.cpp b/frmts/netcdf/netcdfdataset.cpp index c2ec415ee79d..d3f8f14e084c 100644 --- a/frmts/netcdf/netcdfdataset.cpp +++ b/frmts/netcdf/netcdfdataset.cpp @@ -11265,7 +11265,7 @@ static GDALSubdatasetInfo *NCDFDriverGetSubdatasetInfo(const char *pszFileName) if (STARTS_WITH_CI(pszFileName, "NETCDF:")) { std::unique_ptr info = - cpl::make_unique(pszFileName); + std::make_unique(pszFileName); if (!info->GetSubdatasetComponent().empty() && !info->GetPathComponent().empty()) { diff --git a/frmts/netcdf/netcdfsg.cpp b/frmts/netcdf/netcdfsg.cpp index bba540bec526..ccad23cf535f 100644 --- a/frmts/netcdf/netcdfsg.cpp +++ b/frmts/netcdf/netcdfsg.cpp @@ -459,7 +459,7 @@ SGeometry_Reader::SGeometry_Reader(int ncId, int geoVarId) // Set values accordingly this->inst_dimLen = instance_dim_len; - this->pt_buffer = cpl::make_unique(this->touple_order); + this->pt_buffer = std::make_unique(this->touple_order); this->gc_varId = geoVarId; this->ncid = ncId; } diff --git a/frmts/ogcapi/gdalogcapidataset.cpp b/frmts/ogcapi/gdalogcapidataset.cpp index 868c45e37faa..b2f86b086e8f 100644 --- a/frmts/ogcapi/gdalogcapidataset.cpp +++ b/frmts/ogcapi/gdalogcapidataset.cpp @@ -1503,7 +1503,7 @@ ParseXMLSchema(const std::string &osURL, GML_GetOGRFieldType(poProperty->GetType(), eSubType); const char *pszName = poProperty->GetName(); - auto poField = cpl::make_unique(pszName, eFType); + auto poField = std::make_unique(pszName, eFType); poField->SetSubType(eSubType); apoFields.emplace_back(std::move(poField)); } @@ -2737,7 +2737,7 @@ GDALDataset *OGCAPIDataset::Open(GDALOpenInfo *poOpenInfo) { if (!Identify(poOpenInfo)) return nullptr; - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); if (STARTS_WITH_CI(poOpenInfo->pszFilename, "OGCAPI:")) { if (!poDS->InitFromURL(poOpenInfo)) diff --git a/frmts/pdf/pdfcreatefromcomposition.cpp b/frmts/pdf/pdfcreatefromcomposition.cpp index 3f6b57fd738b..fd559019da7f 100644 --- a/frmts/pdf/pdfcreatefromcomposition.cpp +++ b/frmts/pdf/pdfcreatefromcomposition.cpp @@ -284,7 +284,7 @@ bool GDALPDFComposerWriter::CreateLayerTree(const CPLXMLNode *psNode, auto nThisObjId = WriteOCG(pszName, nParentId); m_oMapLayerIdToOCG[pszId] = nThisObjId; - auto newTreeOfOCG = cpl::make_unique(); + auto newTreeOfOCG = std::make_unique(); newTreeOfOCG->m_nNum = nThisObjId; newTreeOfOCG->m_bInitiallyVisible = bInitiallyVisible; parent->m_children.emplace_back(std::move(newTreeOfOCG)); @@ -319,7 +319,7 @@ bool GDALPDFComposerWriter::ParseActions( if (psIter->eType == CXT_Element && strcmp(psIter->pszValue, "GotoPageAction") == 0) { - auto poAction = cpl::make_unique(); + auto poAction = std::make_unique(); const char *pszPageId = CPLGetXMLValue(psIter, "pageId", nullptr); if (!pszPageId) { @@ -395,7 +395,7 @@ bool GDALPDFComposerWriter::ParseActions( else if (psIter->eType == CXT_Element && strcmp(psIter->pszValue, "JavascriptAction") == 0) { - auto poAction = cpl::make_unique(); + auto poAction = std::make_unique(); poAction->m_osScript = CPLGetXMLValue(psIter, nullptr, ""); actions.push_back(std::move(poAction)); } @@ -403,7 +403,7 @@ bool GDALPDFComposerWriter::ParseActions( if (!anONLayers.empty() || !anOFFLayers.empty()) { - auto poAction = cpl::make_unique(); + auto poAction = std::make_unique(); poAction->m_anONLayers = std::move(anONLayers); poAction->m_anOFFLayers = std::move(anOFFLayers); actions.push_back(std::move(poAction)); @@ -424,7 +424,7 @@ bool GDALPDFComposerWriter::CreateOutlineFirstPass(const CPLXMLNode *psNode, if (psIter->eType == CXT_Element && strcmp(psIter->pszValue, "OutlineItem") == 0) { - auto newItem = cpl::make_unique(); + auto newItem = std::make_unique(); const char *pszName = CPLGetXMLValue(psIter, "name", nullptr); if (!pszName) { @@ -736,7 +736,7 @@ bool GDALPDFComposerWriter::GenerateGeoreferencing( CPLError(CE_Failure, CPLE_NotSupported, "Missing SRS"); return false; } - auto poSRS = cpl::make_unique(); + auto poSRS = std::make_unique(); if (poSRS->SetFromUserInput(pszSRS) != OGRERR_NONE) { return false; diff --git a/frmts/pdf/pdfdataset.cpp b/frmts/pdf/pdfdataset.cpp index 199cd7e6b44b..c5610e549f9f 100644 --- a/frmts/pdf/pdfdataset.cpp +++ b/frmts/pdf/pdfdataset.cpp @@ -648,7 +648,7 @@ void PDFDataset::InitOverviews() nXSize = (nXSize + 1) / 2; nYSize = (nYSize + 1) / 2; - auto poOvrDS = cpl::make_unique(this, nXSize, nYSize); + auto poOvrDS = std::make_unique(this, nXSize, nYSize); for (int i = 0; i < nBands; i++) poOvrDS->SetBand( @@ -4758,7 +4758,7 @@ PDFDataset *PDFDataset::Open(GDALOpenInfo *poOpenInfo) PoDoFo::PdfError::EnableLogging(false); #endif - poDocPodofo = cpl::make_unique(); + poDocPodofo = std::make_unique(); try { poDocPodofo->Load(pszFilename); @@ -4782,7 +4782,7 @@ PDFDataset *PDFDataset::Open(GDALOpenInfo *poOpenInfo) #if PODOFO_VERSION_MAJOR > 0 || \ (PODOFO_VERSION_MAJOR == 0 && PODOFO_VERSION_MINOR >= 10) poDocPodofo = - cpl::make_unique(); + std::make_unique(); poDocPodofo->Load(pszFilename, pszUserPwd); #else poDocPodofo->SetPassword(pszUserPwd); diff --git a/frmts/pdf/pdfobject.cpp b/frmts/pdf/pdfobject.cpp index d5e99308c070..5afa19e63202 100644 --- a/frmts/pdf/pdfobject.cpp +++ b/frmts/pdf/pdfobject.cpp @@ -1441,7 +1441,7 @@ GDALPDFObject *GDALPDFArrayPoppler::Get(int nIndex) Object o2(m_poArray->get(nIndex)); if (!o2.isNull()) { - auto poObj = cpl::make_unique( + auto poObj = std::make_unique( new Object(std::move(o2)), TRUE); poObj->SetRefNumAndGen(nRefNum, nRefGen); m_v[nIndex] = std::move(poObj); @@ -1450,7 +1450,7 @@ GDALPDFObject *GDALPDFArrayPoppler::Get(int nIndex) } else { - auto poObj = cpl::make_unique( + auto poObj = std::make_unique( new Object(o.copy()), TRUE); poObj->SetRefNumAndGen(nRefNum, nRefGen); m_v[nIndex] = std::move(poObj); @@ -1471,7 +1471,7 @@ GDALPDFObject *GDALPDFArrayPoppler::Get(int nIndex) } if (!po->isRef() || (m_poArray->get(nIndex, po))) { - auto poObj = cpl::make_unique(po, TRUE); + auto poObj = std::make_unique(po, TRUE); poObj->SetRefNumAndGen(nRefNum, nRefGen); m_v[nIndex] = std::move(poObj); return m_v[nIndex].get(); @@ -2111,7 +2111,7 @@ GDALPDFObject *GDALPDFArrayPodofo::Get(int nIndex) return m_v[nIndex].get(); const PoDoFo::PdfObject &oVal = (*m_poArray)[nIndex]; - m_v[nIndex] = cpl::make_unique(&oVal, m_poObjects); + m_v[nIndex] = std::make_unique(&oVal, m_poObjects); return m_v[nIndex].get(); } diff --git a/frmts/pds/isis2dataset.cpp b/frmts/pds/isis2dataset.cpp index b793f0e34828..bb855db828d2 100644 --- a/frmts/pds/isis2dataset.cpp +++ b/frmts/pds/isis2dataset.cpp @@ -237,7 +237,7 @@ GDALDataset *ISIS2Dataset::Open(GDALOpenInfo *poOpenInfo) VSILFILE *fpQube = poOpenInfo->fpL; poOpenInfo->fpL = nullptr; - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); if (!poDS->oKeywords.Ingest(fpQube, 0)) { diff --git a/frmts/pds/isis3dataset.cpp b/frmts/pds/isis3dataset.cpp index f49b2599fb6d..5ba5c34858d2 100644 --- a/frmts/pds/isis3dataset.cpp +++ b/frmts/pds/isis3dataset.cpp @@ -1648,7 +1648,7 @@ GDALDataset *ISIS3Dataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Open the file using the large file API. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); if (!poDS->m_oKeywords.Ingest(poOpenInfo->fpL, 0)) { @@ -2418,7 +2418,7 @@ GDALDataset *ISIS3Dataset::Open(GDALOpenInfo *poOpenInfo) if (poDS->m_poExternalDS != nullptr) { - auto poISISBand = cpl::make_unique( + auto poISISBand = std::make_unique( poDS->m_poExternalDS->GetRasterBand(i + 1)); poISISBand->SetMaskBand(new ISISMaskBand(poISISBand.get())); poDS->SetBand(i + 1, std::move(poISISBand)); @@ -2426,7 +2426,7 @@ GDALDataset *ISIS3Dataset::Open(GDALOpenInfo *poOpenInfo) } else if (poDS->m_bIsTiled) { - auto poISISBand = cpl::make_unique( + auto poISISBand = std::make_unique( poDS.get(), poDS->m_fpImage, i + 1, eDataType, tileSizeX, tileSizeY, nSkipBytes, 0, 0, bNativeOrder); if (!poISISBand->IsValid()) @@ -2439,7 +2439,7 @@ GDALDataset *ISIS3Dataset::Open(GDALOpenInfo *poOpenInfo) } else { - auto poISISBand = cpl::make_unique( + auto poISISBand = std::make_unique( poDS.get(), i + 1, poDS->m_fpImage, nSkipBytes + nBandOffset * i, nPixelOffset, nLineOffset, eDataType, bNativeOrder); diff --git a/frmts/pds/pds4dataset.cpp b/frmts/pds/pds4dataset.cpp index bce6f2215be5..02623bf27c42 100644 --- a/frmts/pds/pds4dataset.cpp +++ b/frmts/pds/pds4dataset.cpp @@ -1630,7 +1630,7 @@ PDS4Dataset *PDS4Dataset::OpenInternal(GDALOpenInfo *poOpenInfo) ""); const bool bBottomToTop = EQUAL(pszVertDir, "Bottom to Top"); - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->m_osXMLFilename = osXMLFilename; poDS->eAccess = eAccess; poDS->papszOpenOptions = CSLDuplicate(poOpenInfo->papszOpenOptions); @@ -2045,7 +2045,7 @@ PDS4Dataset *PDS4Dataset::OpenInternal(GDALOpenInfo *poOpenInfo) for (int i = 0; i < l_nBands; i++) { - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDS.get(), i + 1, poDS->m_fpImage, (bBottomToTop) ? nOffset + nBandOffset * i + static_cast(nLines - 1) * @@ -4598,7 +4598,7 @@ PDS4Dataset *PDS4Dataset::CreateInternal(const char *pszFilename, } } - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->SetDescription(pszFilename); poDS->m_bMustInitImageFile = true; poDS->m_fpImage = fpImage; @@ -4632,13 +4632,13 @@ PDS4Dataset *PDS4Dataset::CreateInternal(const char *pszFilename, { if (poDS->m_poExternalDS != nullptr) { - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDS->m_poExternalDS->GetRasterBand(i + 1)); poDS->SetBand(i + 1, std::move(poBand)); } else { - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDS.get(), i + 1, poDS->m_fpImage, poDS->m_nBaseOffset + nBandOffset * i, nPixelOffset, nLineOffset, eType, diff --git a/frmts/pds/vicardataset.cpp b/frmts/pds/vicardataset.cpp index 1b4531bb5b18..c7c59f03278b 100644 --- a/frmts/pds/vicardataset.cpp +++ b/frmts/pds/vicardataset.cpp @@ -2558,7 +2558,7 @@ GDALDataset *VICARDataset::Open(GDALOpenInfo *poOpenInfo) return Open(&oOpenInfo); } - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->fpImage = poOpenInfo->fpL; poOpenInfo->fpL = nullptr; if (!poDS->oKeywords.Ingest(poDS->fpImage, poOpenInfo->pabyHeader)) @@ -2858,12 +2858,12 @@ GDALDataset *VICARDataset::Open(GDALOpenInfo *poOpenInfo) if (poDS->m_eCompress == COMPRESS_BASIC || poDS->m_eCompress == COMPRESS_BASIC2) { - poBand = cpl::make_unique(poDS.get(), i + 1, + poBand = std::make_unique(poDS.get(), i + 1, eDataType); } else { - auto poRawBand = cpl::make_unique( + auto poRawBand = std::make_unique( poDS.get(), i + 1, poDS->fpImage, static_cast(nImageOffsetWithoutNBB + nNBB + nBandOffset * i), diff --git a/frmts/postgisraster/postgisrasterdataset.cpp b/frmts/postgisraster/postgisrasterdataset.cpp index b7851580b496..0294ce15d8e8 100644 --- a/frmts/postgisraster/postgisrasterdataset.cpp +++ b/frmts/postgisraster/postgisrasterdataset.cpp @@ -4161,7 +4161,7 @@ PostGISRasterDriverGetSubdatasetInfo(const char *pszFileName) if (STARTS_WITH_CI(pszFileName, "PG:")) { std::unique_ptr info = - cpl::make_unique(pszFileName); + std::make_unique(pszFileName); if (!info->GetSubdatasetComponent().empty() && !info->GetPathComponent().empty()) { diff --git a/frmts/r/rdataset.cpp b/frmts/r/rdataset.cpp index cff08b6c02db..8eb4ba6eedbe 100644 --- a/frmts/r/rdataset.cpp +++ b/frmts/r/rdataset.cpp @@ -371,7 +371,7 @@ GDALDataset *RDataset::Open(GDALOpenInfo *poOpenInfo) std::string(bCompressed ? "/vsigzip/" : "") + poOpenInfo->pszFilename; // Establish this as a dataset and open the file using VSI*L. - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->fp = VSIFOpenL(osAdjustedFilename, "r"); if (poDS->fp == nullptr) @@ -551,7 +551,7 @@ GDALDataset *RDataset::Open(GDALOpenInfo *poOpenInfo) std::unique_ptr poBand; if (poDS->bASCII) - poBand = cpl::make_unique( + poBand = std::make_unique( poDS.get(), iBand + 1, poDS->padfMatrixValues + iBand * poDS->nRasterXSize * poDS->nRasterYSize); diff --git a/frmts/raw/ace2dataset.cpp b/frmts/raw/ace2dataset.cpp index e3c2b92abfb2..04681d989312 100644 --- a/frmts/raw/ace2dataset.cpp +++ b/frmts/raw/ace2dataset.cpp @@ -330,7 +330,7 @@ GDALDataset *ACE2Dataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create the dataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->nRasterXSize = nXSize; poDS->nRasterYSize = nYSize; @@ -346,7 +346,7 @@ GDALDataset *ACE2Dataset::Open(GDALOpenInfo *poOpenInfo) /* Create band information objects */ /* -------------------------------------------------------------------- */ auto poBand = - cpl::make_unique(fpImage, eDT, nXSize, nYSize); + std::make_unique(fpImage, eDT, nXSize, nYSize); if (!poBand->IsValid()) return nullptr; poDS->SetBand(1, std::move(poBand)); diff --git a/frmts/raw/byndataset.cpp b/frmts/raw/byndataset.cpp index 079002eb2d8f..8bd609050a1c 100644 --- a/frmts/raw/byndataset.cpp +++ b/frmts/raw/byndataset.cpp @@ -276,7 +276,7 @@ GDALDataset *BYNDataset::Open(GDALOpenInfo *poOpenInfo) /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->eAccess = poOpenInfo->eAccess; std::swap(poDS->fpImage, poOpenInfo->fpL); @@ -370,7 +370,7 @@ GDALDataset *BYNDataset::Open(GDALOpenInfo *poOpenInfo) int bIsLSB = poDS->hHeader.nByteOrder == 1 ? 1 : 0; - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDS.get(), 1, poDS->fpImage, BYN_HDR_SZ, nDTSize, poDS->nRasterXSize * nDTSize, eDT, CPL_IS_LSB == bIsLSB); if (!poBand->IsValid()) diff --git a/frmts/raw/cpgdataset.cpp b/frmts/raw/cpgdataset.cpp index 2e308bb7bd29..54a9d41b47d6 100644 --- a/frmts/raw/cpgdataset.cpp +++ b/frmts/raw/cpgdataset.cpp @@ -627,7 +627,7 @@ GDALDataset *CPGDataset::InitializeType1Or2Dataset(const char *pszFilename) /* -------------------------------------------------------------------- */ /* Initialize dataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->nRasterXSize = nSamples; poDS->nRasterYSize = nLines; diff --git a/frmts/raw/ctable2dataset.cpp b/frmts/raw/ctable2dataset.cpp index ebf7fe45cede..b6cc30b2bf80 100644 --- a/frmts/raw/ctable2dataset.cpp +++ b/frmts/raw/ctable2dataset.cpp @@ -156,7 +156,7 @@ GDALDataset *CTable2Dataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->eAccess = poOpenInfo->eAccess; std::swap(poDS->fpImage, poOpenInfo->fpL); diff --git a/frmts/raw/dipxdataset.cpp b/frmts/raw/dipxdataset.cpp index 04f00cc55763..025a3e9f26c5 100644 --- a/frmts/raw/dipxdataset.cpp +++ b/frmts/raw/dipxdataset.cpp @@ -153,7 +153,7 @@ GDALDataset *DIPExDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->eAccess = poOpenInfo->eAccess; poDS->fp = poOpenInfo->fpL; diff --git a/frmts/raw/doq1dataset.cpp b/frmts/raw/doq1dataset.cpp index b00168b86c07..9cfe424b68f2 100644 --- a/frmts/raw/doq1dataset.cpp +++ b/frmts/raw/doq1dataset.cpp @@ -262,7 +262,7 @@ GDALDataset *DOQ1Dataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); /* -------------------------------------------------------------------- */ /* Capture some information from the file that is of interest. */ diff --git a/frmts/raw/doq2dataset.cpp b/frmts/raw/doq2dataset.cpp index 7f24b69c5ff5..daf7678494c6 100644 --- a/frmts/raw/doq2dataset.cpp +++ b/frmts/raw/doq2dataset.cpp @@ -374,7 +374,7 @@ GDALDataset *DOQ2Dataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->nRasterXSize = nWidth; poDS->nRasterYSize = nHeight; diff --git a/frmts/raw/ehdrdataset.cpp b/frmts/raw/ehdrdataset.cpp index cadaff8a7e1c..acb2dec5b2ca 100644 --- a/frmts/raw/ehdrdataset.cpp +++ b/frmts/raw/ehdrdataset.cpp @@ -1186,7 +1186,7 @@ GDALDataset *EHdrDataset::Open(GDALOpenInfo *poOpenInfo, bool bFileSizeCheck) chPixelType = 'S'; } - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->osHeaderExt = pszHeaderExt; @@ -1299,7 +1299,7 @@ GDALDataset *EHdrDataset::Open(GDALOpenInfo *poOpenInfo, bool bFileSizeCheck) // Create band information objects. for (int i = 0; i < l_nBands; i++) { - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDS.get(), i + 1, poDS->fpImage, nSkipBytes + nBandOffset * i, nPixelOffset, nLineOffset, eDataType, chByteOrder == 'I' || chByteOrder == 'L' diff --git a/frmts/raw/eirdataset.cpp b/frmts/raw/eirdataset.cpp index 3f7b0a2db83d..c75835b70741 100644 --- a/frmts/raw/eirdataset.cpp +++ b/frmts/raw/eirdataset.cpp @@ -441,7 +441,7 @@ GDALDataset *EIRDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); /* -------------------------------------------------------------------- */ /* Capture some information from the file that is of interest. */ diff --git a/frmts/raw/envidataset.cpp b/frmts/raw/envidataset.cpp index 44592654ef57..369480034e9f 100644 --- a/frmts/raw/envidataset.cpp +++ b/frmts/raw/envidataset.cpp @@ -2113,7 +2113,7 @@ ENVIDataset *ENVIDataset::Open(GDALOpenInfo *poOpenInfo, bool bFileSizeCheck) } // Create a corresponding GDALDataset. - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->pszHDRFilename = CPLStrdup(osHdrFilename); poDS->fp = fpHeader; @@ -2409,7 +2409,7 @@ ENVIDataset *ENVIDataset::Open(GDALOpenInfo *poOpenInfo, bool bFileSizeCheck) // Create band information objects. for (int i = 0; i < nBands; i++) { - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDS.get(), i + 1, poDS->fpImage, nHeaderSize + nBandOffset * i, nPixelOffset, nLineOffset, eType, eByteOrder); if (!poBand->IsValid()) diff --git a/frmts/raw/fastdataset.cpp b/frmts/raw/fastdataset.cpp index 60561f66ed2d..d5d6bd5c7ac9 100644 --- a/frmts/raw/fastdataset.cpp +++ b/frmts/raw/fastdataset.cpp @@ -582,7 +582,7 @@ GDALDataset *FASTDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); std::swap(poDS->fpHeader, poOpenInfo->fpL); diff --git a/frmts/raw/genbindataset.cpp b/frmts/raw/genbindataset.cpp index 056b3248523f..c8a33d56b58e 100644 --- a/frmts/raw/genbindataset.cpp +++ b/frmts/raw/genbindataset.cpp @@ -557,7 +557,7 @@ GDALDataset *GenBinDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); /* -------------------------------------------------------------------- */ /* Capture some information from the file that is of interest. */ diff --git a/frmts/raw/gscdataset.cpp b/frmts/raw/gscdataset.cpp index a65e61f5a087..6be446b916af 100644 --- a/frmts/raw/gscdataset.cpp +++ b/frmts/raw/gscdataset.cpp @@ -170,7 +170,7 @@ GDALDataset *GSCDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->nRasterXSize = nPixels; poDS->nRasterYSize = nLines; diff --git a/frmts/raw/gtxdataset.cpp b/frmts/raw/gtxdataset.cpp index 5f3511a5e473..b4012b180645 100644 --- a/frmts/raw/gtxdataset.cpp +++ b/frmts/raw/gtxdataset.cpp @@ -238,7 +238,7 @@ GDALDataset *GTXDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->eAccess = poOpenInfo->eAccess; std::swap(poDS->fpImage, poOpenInfo->fpL); @@ -314,7 +314,7 @@ GDALDataset *GTXDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create band information object. */ /* -------------------------------------------------------------------- */ - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDS.get(), 1, poDS->fpImage, static_cast(poDS->nRasterYSize - 1) * poDS->nRasterXSize * nDTSize + diff --git a/frmts/raw/hkvdataset.cpp b/frmts/raw/hkvdataset.cpp index 8993483e7c0c..1048ec9feaee 100644 --- a/frmts/raw/hkvdataset.cpp +++ b/frmts/raw/hkvdataset.cpp @@ -1302,7 +1302,7 @@ GDALDataset *HKVDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->pszPath = CPLStrdup(poOpenInfo->pszFilename); poDS->papszAttrib = papszAttrib; @@ -1469,7 +1469,7 @@ GDALDataset *HKVDataset::Open(GDALOpenInfo *poOpenInfo) for (int iRawBand = 0; iRawBand < nRawBands; iRawBand++) { - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDS.get(), poDS->GetRasterCount() + 1, poDS->fpBlob, nOffset, nPixelOffset, nLineOffset, eType, bNative); if (!poBand->IsValid()) diff --git a/frmts/raw/iscedataset.cpp b/frmts/raw/iscedataset.cpp index eb7e4f37be32..e77d74426d9b 100644 --- a/frmts/raw/iscedataset.cpp +++ b/frmts/raw/iscedataset.cpp @@ -577,7 +577,7 @@ GDALDataset *ISCEDataset::Open(GDALOpenInfo *poOpenInfo, bool bFileSizeCheck) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->nRasterXSize = nWidth; poDS->nRasterYSize = nHeight; poDS->eAccess = poOpenInfo->eAccess; @@ -684,7 +684,7 @@ GDALDataset *ISCEDataset::Open(GDALOpenInfo *poOpenInfo, bool bFileSizeCheck) for (int b = 0; b < nBands; b++) { - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDS.get(), b + 1, poDS->fpImage, nBandOffset * b, nPixelOffset, nLineOffset, eDataType, bNativeOrder); if (!poBand->IsValid()) diff --git a/frmts/raw/krodataset.cpp b/frmts/raw/krodataset.cpp index 69c385e0d1dd..d686db5a6e4f 100644 --- a/frmts/raw/krodataset.cpp +++ b/frmts/raw/krodataset.cpp @@ -133,7 +133,7 @@ GDALDataset *KRODataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->eAccess = poOpenInfo->eAccess; std::swap(poDS->fpImage, poOpenInfo->fpL); diff --git a/frmts/raw/landataset.cpp b/frmts/raw/landataset.cpp index 13f8da297ceb..4aba9f0e8263 100644 --- a/frmts/raw/landataset.cpp +++ b/frmts/raw/landataset.cpp @@ -396,7 +396,7 @@ GDALDataset *LANDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->eAccess = poOpenInfo->eAccess; std::swap(poDS->fpImage, poOpenInfo->fpL); diff --git a/frmts/raw/lcpdataset.cpp b/frmts/raw/lcpdataset.cpp index 7f95d2a438d6..42478227d81c 100644 --- a/frmts/raw/lcpdataset.cpp +++ b/frmts/raw/lcpdataset.cpp @@ -250,7 +250,7 @@ GDALDataset *LCPDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); std::swap(poDS->fpImage, poOpenInfo->fpL); /* -------------------------------------------------------------------- */ diff --git a/frmts/raw/loslasdataset.cpp b/frmts/raw/loslasdataset.cpp index f545a3fe412b..63c7d782801a 100644 --- a/frmts/raw/loslasdataset.cpp +++ b/frmts/raw/loslasdataset.cpp @@ -204,7 +204,7 @@ GDALDataset *LOSLASDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); std::swap(poDS->fpImage, poOpenInfo->fpL); /* -------------------------------------------------------------------- */ diff --git a/frmts/raw/mffdataset.cpp b/frmts/raw/mffdataset.cpp index 7614e4f58c61..06b1a328cf7e 100644 --- a/frmts/raw/mffdataset.cpp +++ b/frmts/raw/mffdataset.cpp @@ -729,7 +729,7 @@ GDALDataset *MFFDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->papszHdrLines = papszHdrLines; @@ -937,7 +937,7 @@ GDALDataset *MFFDataset::Open(GDALOpenInfo *poOpenInfo) if (bTiled) { - poBand = cpl::make_unique(poDS.get(), nBand, fpRaw, + poBand = std::make_unique(poDS.get(), nBand, fpRaw, nTileXSize, nTileYSize, eDataType, eByteOrder); } diff --git a/frmts/raw/ndfdataset.cpp b/frmts/raw/ndfdataset.cpp index fce21d7d51e7..b53abcb108da 100644 --- a/frmts/raw/ndfdataset.cpp +++ b/frmts/raw/ndfdataset.cpp @@ -264,7 +264,7 @@ GDALDataset *NDFDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->papszHeader = papszHeader; poDS->nRasterXSize = atoi(poDS->Get("PIXELS_PER_LINE", "")); diff --git a/frmts/raw/noaabdataset.cpp b/frmts/raw/noaabdataset.cpp index 280f2fcb21b5..f3d4def29976 100644 --- a/frmts/raw/noaabdataset.cpp +++ b/frmts/raw/noaabdataset.cpp @@ -269,7 +269,7 @@ GDALDataset *NOAA_B_Dataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->nRasterXSize = nCols; poDS->nRasterYSize = nRows; diff --git a/frmts/raw/nsidcbindataset.cpp b/frmts/raw/nsidcbindataset.cpp index 5a57312a293f..df9e2dd61f50 100644 --- a/frmts/raw/nsidcbindataset.cpp +++ b/frmts/raw/nsidcbindataset.cpp @@ -260,7 +260,7 @@ GDALDataset *NSIDCbinDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->eAccess = poOpenInfo->eAccess; std::swap(poDS->fp, poOpenInfo->fpL); @@ -329,7 +329,7 @@ GDALDataset *NSIDCbinDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ int nBytesPerSample = 1; - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDS.get(), 1, poDS->fp, 300, nBytesPerSample, poDS->nRasterXSize, GDT_Byte); if (!poBand->IsValid()) diff --git a/frmts/raw/ntv2dataset.cpp b/frmts/raw/ntv2dataset.cpp index a638fddb3d6b..e5206df3c5c8 100644 --- a/frmts/raw/ntv2dataset.cpp +++ b/frmts/raw/ntv2dataset.cpp @@ -431,7 +431,7 @@ GDALDataset *NTv2Dataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->eAccess = poOpenInfo->eAccess; /* -------------------------------------------------------------------- */ diff --git a/frmts/raw/pauxdataset.cpp b/frmts/raw/pauxdataset.cpp index 8398f53021c0..491d822496e9 100644 --- a/frmts/raw/pauxdataset.cpp +++ b/frmts/raw/pauxdataset.cpp @@ -679,7 +679,7 @@ GDALDataset *PAuxDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); /* -------------------------------------------------------------------- */ /* Load the .aux file into a string list suitable to be */ @@ -801,7 +801,7 @@ GDALDataset *PAuxDataset::Open(GDALOpenInfo *poOpenInfo) continue; } - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDS.get(), poDS->nBands + 1, poDS->fpImage, nBandOffset, nPixelOffset, nLineOffset, eType, bNative); if (!poBand->IsValid()) diff --git a/frmts/raw/pnmdataset.cpp b/frmts/raw/pnmdataset.cpp index 6bf2480fbf06..e291e6c62eca 100644 --- a/frmts/raw/pnmdataset.cpp +++ b/frmts/raw/pnmdataset.cpp @@ -230,7 +230,7 @@ GDALDataset *PNMDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); /* -------------------------------------------------------------------- */ /* Capture some information from the file that is of interest. */ diff --git a/frmts/raw/roipacdataset.cpp b/frmts/raw/roipacdataset.cpp index bb35da6ced0b..1112fe372ccb 100644 --- a/frmts/raw/roipacdataset.cpp +++ b/frmts/raw/roipacdataset.cpp @@ -253,7 +253,7 @@ GDALDataset *ROIPACDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->nRasterXSize = nWidth; poDS->nRasterYSize = nFileLength; poDS->eAccess = poOpenInfo->eAccess; diff --git a/frmts/raw/rrasterdataset.cpp b/frmts/raw/rrasterdataset.cpp index da47ddd546da..9296d498b51f 100644 --- a/frmts/raw/rrasterdataset.cpp +++ b/frmts/raw/rrasterdataset.cpp @@ -1229,7 +1229,7 @@ GDALDataset *RRASTERDataset::Open(GDALOpenInfo *poOpenInfo) return nullptr; } - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->eAccess = poOpenInfo->eAccess; poDS->nRasterXSize = nCols; poDS->nRasterYSize = nRows; @@ -1370,7 +1370,7 @@ GDALDataset *RRASTERDataset::Open(GDALOpenInfo *poOpenInfo) CPLStringList aosLayerNames(CSLTokenizeString2(osLayerName, ":", 0)); for (int i = 1; i <= l_nBands; i++) { - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDS.get(), i, fpImage, nBandOffset * (i - 1), nPixelOffset, nLineOffset, eDT, bNativeOrder); if (!poBand->IsValid()) diff --git a/frmts/raw/snodasdataset.cpp b/frmts/raw/snodasdataset.cpp index f2a7e7cab714..4df5e4e858c8 100644 --- a/frmts/raw/snodasdataset.cpp +++ b/frmts/raw/snodasdataset.cpp @@ -456,7 +456,7 @@ GDALDataset *SNODASDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create a corresponding GDALDataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->nRasterXSize = nCols; poDS->nRasterYSize = nRows; @@ -498,7 +498,7 @@ GDALDataset *SNODASDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create band information objects. */ /* -------------------------------------------------------------------- */ - auto poBand = cpl::make_unique(fpRaw, nCols, nRows); + auto poBand = std::make_unique(fpRaw, nCols, nRows); if (!poBand->IsValid()) return nullptr; poDS->SetBand(1, std::move(poBand)); diff --git a/frmts/safe/safedataset.cpp b/frmts/safe/safedataset.cpp index 66c8949e0a4c..b7223027b85d 100644 --- a/frmts/safe/safedataset.cpp +++ b/frmts/safe/safedataset.cpp @@ -1067,7 +1067,7 @@ GDALDataset *SAFEDataset::Open(GDALOpenInfo *poOpenInfo) /* -------------------------------------------------------------------- */ /* Create the dataset. */ /* -------------------------------------------------------------------- */ - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->psManifest = psManifest; @@ -1481,7 +1481,7 @@ GDALDataset *SAFEDataset::Open(GDALOpenInfo *poOpenInfo) else if (bCalibrated && (eRequestType == UNKNOWN || eRequestType == COMPLEX)) { - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDS.get(), eDataType, osSwath, osPolarization, std::move(poBandFile), osCalibrationFilePath, eCalibrationType); diff --git a/frmts/stacit/stacitdataset.cpp b/frmts/stacit/stacitdataset.cpp index 91ccc95c1aaf..eae8b84faee4 100644 --- a/frmts/stacit/stacitdataset.cpp +++ b/frmts/stacit/stacitdataset.cpp @@ -898,7 +898,7 @@ GDALDataset *STACITDataset::OpenStatic(GDALOpenInfo *poOpenInfo) { if (!Identify(poOpenInfo)) return nullptr; - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); if (!poDS->Open(poOpenInfo)) return nullptr; return poDS.release(); diff --git a/frmts/stacta/stactadataset.cpp b/frmts/stacta/stactadataset.cpp index 36e3dc7a45cf..afabd150234a 100644 --- a/frmts/stacta/stactadataset.cpp +++ b/frmts/stacta/stactadataset.cpp @@ -935,7 +935,7 @@ bool STACTADataset::Open(GDALOpenInfo *poOpenInfo) { continue; } - auto poRawDS = cpl::make_unique(); + auto poRawDS = std::make_unique(); if (!poRawDS->InitRaster(poProtoDS.get(), poTMS.get(), tmsList[i].mId, oTM, oMapLimits)) { @@ -1155,7 +1155,7 @@ GDALDataset *STACTADataset::OpenStatic(GDALOpenInfo *poOpenInfo) { if (!Identify(poOpenInfo)) return nullptr; - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); if (!poDS->Open(poOpenInfo)) return nullptr; return poDS.release(); diff --git a/frmts/tiledb/tiledbdense.cpp b/frmts/tiledb/tiledbdense.cpp index 9284a782f40d..82f6f92f9669 100644 --- a/frmts/tiledb/tiledbdense.cpp +++ b/frmts/tiledb/tiledbdense.cpp @@ -1091,7 +1091,7 @@ char **TileDBRasterDataset::GetMetadata(const char *pszDomain) GDALDataset *TileDBRasterDataset::Open(GDALOpenInfo *poOpenInfo) { - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); const char *pszConfig = CSLFetchNameValue(poOpenInfo->papszOpenOptions, "TILEDB_CONFIG"); @@ -1777,7 +1777,7 @@ TileDBRasterDataset *TileDBRasterDataset::CreateLL(const char *pszFilename, return nullptr; } - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->nRasterXSize = nXSize; poDS->nRasterYSize = nYSize; poDS->eDataType = eType; diff --git a/frmts/tiledb/tiledbsparse.cpp b/frmts/tiledb/tiledbsparse.cpp index d8c5bb4aabee..becbfe7ba086 100644 --- a/frmts/tiledb/tiledbsparse.cpp +++ b/frmts/tiledb/tiledbsparse.cpp @@ -216,7 +216,7 @@ GDALDataset *OGRTileDBDataset::Open(GDALOpenInfo *poOpenInfo, tiledb::Object::Type objectType) { - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->eAccess = poOpenInfo->eAccess; const char *pszConfig = CSLFetchNameValue(poOpenInfo->papszOpenOptions, "TILEDB_CONFIG"); @@ -247,7 +247,7 @@ GDALDataset *OGRTileDBDataset::Open(GDALOpenInfo *poOpenInfo, const std::optional &osLayerName = std::optional()) { - auto poLayer = cpl::make_unique( + auto poLayer = std::make_unique( osLayerFilename.c_str(), osLayerName.has_value() ? (*osLayerName).c_str() : CPLGetBasename(osLayerFilename.c_str()), @@ -382,7 +382,7 @@ OGRTileDBDataset::ICreateLayer(const char *pszName, } osFilename = CPLFormFilename(osFilename.c_str(), pszName, nullptr); } - auto poLayer = cpl::make_unique(osFilename.c_str(), pszName, + auto poLayer = std::make_unique(osFilename.c_str(), pszName, eGType, poSpatialRef); poLayer->m_bUpdatable = true; poLayer->m_ctx.reset(new tiledb::Context(*m_ctx)); @@ -533,7 +533,7 @@ OGRTileDBDataset::ICreateLayer(const char *pszName, GDALDataset *OGRTileDBDataset::Create(const char *pszFilename, CSLConstList papszOptions) { - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); poDS->SetDescription(TileDBDataset::VSI_to_tiledb_uri(pszFilename)); poDS->eAccess = GA_Update; @@ -1602,7 +1602,7 @@ bool OGRTileDBLayer::SetupQuery(tiledb::QueryCondition *queryCondition) { if (!m_query) { - m_query = cpl::make_unique(*m_ctx, *m_array); + m_query = std::make_unique(*m_ctx, *m_array); m_query->set_layout(TILEDB_UNORDERED); if (queryCondition) m_query->set_condition(*queryCondition); @@ -2320,7 +2320,7 @@ CreateQueryConditionForIntType(tiledb::Context &ctx, if (nVal >= static_cast(std::numeric_limits::min()) && nVal <= static_cast(std::numeric_limits::max())) { - return cpl::make_unique( + return std::make_unique( tiledb::QueryCondition::create(ctx, poFieldDefn->GetNameRef(), static_cast(nVal), tiledb_op)); } @@ -2437,7 +2437,7 @@ std::unique_ptr OGRTileDBLayer::CreateQueryCondition( { if (nVal == 0 || nVal == 1) { - return cpl::make_unique( + return std::make_unique( tiledb::QueryCondition::create( *(m_ctx.get()), poFieldDefn->GetNameRef(), static_cast(nVal), tiledb_op)); @@ -2475,7 +2475,7 @@ std::unique_ptr OGRTileDBLayer::CreateQueryCondition( } else { - return cpl::make_unique( + return std::make_unique( tiledb::QueryCondition::create( *(m_ctx.get()), poFieldDefn->GetNameRef(), nVal, tiledb_op)); @@ -2497,7 +2497,7 @@ std::unique_ptr OGRTileDBLayer::CreateQueryCondition( CPLAssert(false); return nullptr; } - return cpl::make_unique( + return std::make_unique( tiledb::QueryCondition::create(*(m_ctx.get()), poFieldDefn->GetNameRef(), nVal, tiledb_op)); @@ -2514,13 +2514,13 @@ std::unique_ptr OGRTileDBLayer::CreateQueryCondition( } if (poFieldDefn->GetSubType() == OFSTFloat32) { - return cpl::make_unique( + return std::make_unique( tiledb::QueryCondition::create( *(m_ctx.get()), poFieldDefn->GetNameRef(), static_cast(poValue->float_value), tiledb_op)); } - return cpl::make_unique( + return std::make_unique( tiledb::QueryCondition::create( *(m_ctx.get()), poFieldDefn->GetNameRef(), poValue->float_value, tiledb_op)); @@ -2540,7 +2540,7 @@ std::unique_ptr OGRTileDBLayer::CreateQueryCondition( TILEDB_STRING_ASCII) return nullptr; #endif - return cpl::make_unique( + return std::make_unique( tiledb::QueryCondition::create( *(m_ctx.get()), poFieldDefn->GetNameRef(), std::string(poValue->string_value), tiledb_op)); @@ -2555,7 +2555,7 @@ std::unique_ptr OGRTileDBLayer::CreateQueryCondition( OGRField sField; if (OGRParseDate(poValue->string_value, &sField, 0)) { - return cpl::make_unique( + return std::make_unique( tiledb::QueryCondition::create( *(m_ctx.get()), poFieldDefn->GetNameRef(), OGRFieldToDateTimeMS(sField), tiledb_op)); @@ -2579,7 +2579,7 @@ std::unique_ptr OGRTileDBLayer::CreateQueryCondition( OGRField sField; if (OGRParseDate(poValue->string_value, &sField, 0)) { - return cpl::make_unique( + return std::make_unique( tiledb::QueryCondition::create( *(m_ctx.get()), poFieldDefn->GetNameRef(), OGRFieldToDateDay(sField), tiledb_op)); @@ -2606,7 +2606,7 @@ std::unique_ptr OGRTileDBLayer::CreateQueryCondition( OGRField sField; if (OGRParseDate(poValue->string_value, &sField, 0)) { - return cpl::make_unique( + return std::make_unique( tiledb::QueryCondition::create( *(m_ctx.get()), poFieldDefn->GetNameRef(), OGRFieldToTimeMS(sField), tiledb_op)); @@ -2664,7 +2664,7 @@ OGRTileDBLayer::CreateQueryCondition(const swq_expr_node *poNode, } if (left && right) { - return cpl::make_unique( + return std::make_unique( left->combine(*(right.get()), TILEDB_AND)); } // Returning only left or right member is OK for a AND @@ -2705,7 +2705,7 @@ OGRTileDBLayer::CreateQueryCondition(const swq_expr_node *poNode, } if (left && right) { - return cpl::make_unique( + return std::make_unique( left->combine(*(right.get()), TILEDB_OR)); } m_bAttributeFilterPartiallyTranslated = true; @@ -2742,7 +2742,7 @@ OGRTileDBLayer::CreateQueryCondition(const swq_expr_node *poNode, } else { - cond = cpl::make_unique( + cond = std::make_unique( cond->combine(*(newCond.get()), TILEDB_OR)); } } @@ -2791,7 +2791,7 @@ OGRTileDBLayer::CreateQueryCondition(const swq_expr_node *poNode, bAlwaysFalse = true; return nullptr; } - auto qc = cpl::make_unique(*(m_ctx.get())); + auto qc = std::make_unique(*(m_ctx.get())); qc->init(poFieldDefn->GetNameRef(), nullptr, 0, TILEDB_EQ); return qc; } @@ -2820,7 +2820,7 @@ OGRTileDBLayer::CreateQueryCondition(const swq_expr_node *poNode, bAlwaysTrue = true; return nullptr; } - auto qc = cpl::make_unique(*(m_ctx.get())); + auto qc = std::make_unique(*(m_ctx.get())); qc->init(poFieldDefn->GetNameRef(), nullptr, 0, TILEDB_NE); return qc; } diff --git a/frmts/vrt/vrtmultidim.cpp b/frmts/vrt/vrtmultidim.cpp index 918d2d7b7652..380af50e4b27 100644 --- a/frmts/vrt/vrtmultidim.cpp +++ b/frmts/vrt/vrtmultidim.cpp @@ -958,7 +958,7 @@ VRTMDArray::Create(const std::shared_ptr &poThisGroup, std::unique_ptr poSRS; if (psSRSNode) { - poSRS = cpl::make_unique(); + poSRS = std::make_unique(); poSRS->SetFromUserInput( CPLGetXMLValue(psSRSNode, nullptr, ""), OGRSpatialReference::SET_FROM_USER_INPUT_LIMITATIONS_get()); @@ -1343,7 +1343,7 @@ VRTMDArraySourceInlinedValues::Create(const VRTMDArray *array, pabyPtr += nDTSize; } - return cpl::make_unique( + return std::make_unique( array, bIsConstantValue, std::move(anOffset), std::move(anCount), std::move(abyValues)); } @@ -1743,7 +1743,7 @@ VRTMDArraySourceFromArray::Create(const VRTMDArray *poDstArray, } } - return cpl::make_unique( + return std::make_unique( poDstArray, bRelativeToVRTSet, bRelativeToVRT, pszFilename, pszArray, pszSourceBand, std::move(anTransposedAxis), pszView, std::move(anSrcOffset), std::move(anCount), std::move(anStep), @@ -2725,7 +2725,7 @@ CPLErr VRTArraySource::XMLInit( if (!m_poDS) return CE_Failure; - m_poSimpleSource = cpl::make_unique(); + m_poSimpleSource = std::make_unique(); auto poBand = m_poDS->GetRasterBand(1); m_poSimpleSource->SetSrcBand(poBand); m_poDS->Reference(); @@ -2862,7 +2862,7 @@ std::shared_ptr VRTDerivedArrayCreate(const char *pszVRTPath, const char *pszSRS = CPLGetXMLValue(psResample, "SRS", nullptr); if (pszSRS) { - poSRS = cpl::make_unique(); + poSRS = std::make_unique(); poSRS->SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); if (poSRS->SetFromUserInput( pszSRS, OGRSpatialReference:: diff --git a/frmts/webp/webpdataset.cpp b/frmts/webp/webpdataset.cpp index 03e492a42b17..03284ae4902f 100644 --- a/frmts/webp/webpdataset.cpp +++ b/frmts/webp/webpdataset.cpp @@ -548,7 +548,7 @@ GDALPamDataset *WEBPDataset::OpenPAM(GDALOpenInfo *poOpenInfo) int nBands = 3; - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); #if WEBP_DECODER_ABI_VERSION >= 0x0002 WebPDecoderConfig config; diff --git a/frmts/wms/wmsdriver.cpp b/frmts/wms/wmsdriver.cpp index 95a1b9589ea1..67565be07c5d 100644 --- a/frmts/wms/wmsdriver.cpp +++ b/frmts/wms/wmsdriver.cpp @@ -1181,7 +1181,7 @@ static GDALSubdatasetInfo *WMSDriverGetSubdatasetInfo(const char *pszFileName) if (STARTS_WITH(pszFileName, "WMS:")) { std::unique_ptr info = - cpl::make_unique(pszFileName); + std::make_unique(pszFileName); if (!info->GetSubdatasetComponent().empty() && !info->GetPathComponent().empty()) { diff --git a/frmts/zarr/zarr_v3_array.cpp b/frmts/zarr/zarr_v3_array.cpp index 23bc60c2a591..01f92d3aefc9 100644 --- a/frmts/zarr/zarr_v3_array.cpp +++ b/frmts/zarr/zarr_v3_array.cpp @@ -1596,7 +1596,7 @@ ZarrV3Group::LoadArray(const std::string &osArrayName, oInputArrayMetadata.anBlockSizes.push_back( static_cast(nSize)); oInputArrayMetadata.oElt = aoDtypeElts.back(); - poCodecs = cpl::make_unique(oInputArrayMetadata); + poCodecs = std::make_unique(oInputArrayMetadata); if (!poCodecs->InitFromJson(oCodecs)) return nullptr; } diff --git a/frmts/zarr/zarr_v3_codec.cpp b/frmts/zarr/zarr_v3_codec.cpp index 82ed6673f40a..e5b671f76ab9 100644 --- a/frmts/zarr/zarr_v3_codec.cpp +++ b/frmts/zarr/zarr_v3_codec.cpp @@ -144,7 +144,7 @@ bool ZarrV3CodecGZip::InitFromConfiguration( std::unique_ptr ZarrV3CodecGZip::Clone() const { - auto psClone = cpl::make_unique(); + auto psClone = std::make_unique(); ZarrArrayMetadata oOutputArrayMetadata; psClone->InitFromConfiguration(m_oConfiguration, m_oInputArrayMetadata, oOutputArrayMetadata); @@ -363,7 +363,7 @@ bool ZarrV3CodecBlosc::InitFromConfiguration( std::unique_ptr ZarrV3CodecBlosc::Clone() const { - auto psClone = cpl::make_unique(); + auto psClone = std::make_unique(); ZarrArrayMetadata oOutputArrayMetadata; psClone->InitFromConfiguration(m_oConfiguration, m_oInputArrayMetadata, oOutputArrayMetadata); @@ -511,7 +511,7 @@ bool ZarrV3CodecEndian::InitFromConfiguration( std::unique_ptr ZarrV3CodecEndian::Clone() const { - auto psClone = cpl::make_unique(); + auto psClone = std::make_unique(); ZarrArrayMetadata oOutputArrayMetadata; psClone->InitFromConfiguration(m_oConfiguration, m_oInputArrayMetadata, oOutputArrayMetadata); @@ -760,7 +760,7 @@ bool ZarrV3CodecTranspose::InitFromConfiguration( std::unique_ptr ZarrV3CodecTranspose::Clone() const { - auto psClone = cpl::make_unique(); + auto psClone = std::make_unique(); ZarrArrayMetadata oOutputArrayMetadata; psClone->InitFromConfiguration(m_oConfiguration, m_oInputArrayMetadata, oOutputArrayMetadata); @@ -922,7 +922,7 @@ bool ZarrV3CodecTranspose::Decode(const ZarrByteVectorQuickResize &abySrc, std::unique_ptr ZarrV3CodecSequence::Clone() const { - auto poClone = cpl::make_unique(m_oInputArrayMetadata); + auto poClone = std::make_unique(m_oInputArrayMetadata); for (const auto &poCodec : m_apoCodecs) poClone->m_apoCodecs.emplace_back(poCodec->Clone()); poClone->m_oCodecArray = m_oCodecArray.Clone(); @@ -954,7 +954,7 @@ bool ZarrV3CodecSequence::InitFromJson(const CPLJSONObject &oCodecs) if (eLastType == ZarrV3Codec::IOType::ARRAY && oInputArrayMetadata.oElt.nativeSize > 1) { - auto poEndianCodec = cpl::make_unique(); + auto poEndianCodec = std::make_unique(); ZarrArrayMetadata oOutputArrayMetadata; poEndianCodec->InitFromConfiguration( ZarrV3CodecEndian::GetConfiguration(true), oInputArrayMetadata, @@ -977,13 +977,13 @@ bool ZarrV3CodecSequence::InitFromJson(const CPLJSONObject &oCodecs) const auto osName = oCodec["name"].ToString(); std::unique_ptr poCodec; if (osName == "gzip") - poCodec = cpl::make_unique(); + poCodec = std::make_unique(); else if (osName == "blosc") - poCodec = cpl::make_unique(); + poCodec = std::make_unique(); else if (osName == "endian") - poCodec = cpl::make_unique(); + poCodec = std::make_unique(); else if (osName == "transpose") - poCodec = cpl::make_unique(); + poCodec = std::make_unique(); else { CPLError(CE_Failure, CPLE_NotSupported, "Unsupported codec: %s", diff --git a/frmts/zarr/zarr_v3_group.cpp b/frmts/zarr/zarr_v3_group.cpp index d5a42a6f933c..ae00443685f2 100644 --- a/frmts/zarr/zarr_v3_group.cpp +++ b/frmts/zarr/zarr_v3_group.cpp @@ -678,7 +678,7 @@ std::shared_ptr ZarrV3Group::CreateMDArray( oInputArrayMetadata.anBlockSizes.push_back( static_cast(nSize)); oInputArrayMetadata.oElt = aoDtypeElts.back(); - poCodecs = cpl::make_unique(oInputArrayMetadata); + poCodecs = std::make_unique(oInputArrayMetadata); if (!poCodecs->InitFromJson(oCodecs)) return nullptr; } diff --git a/frmts/zarr/zarrdriver.cpp b/frmts/zarr/zarrdriver.cpp index 564c0623925c..c9473e4f62b3 100644 --- a/frmts/zarr/zarrdriver.cpp +++ b/frmts/zarr/zarrdriver.cpp @@ -345,7 +345,7 @@ GDALDataset *ZarrDataset::Open(GDALOpenInfo *poOpenInfo) auto poRG = poDSMultiDim->GetRootGroup(); - auto poDS = cpl::make_unique(nullptr); + auto poDS = std::make_unique(nullptr); std::shared_ptr poMainArray; std::vector aosArrays; std::string osMainArray; @@ -1113,7 +1113,7 @@ GDALDataset *ZarrDataset::Create(const char *pszName, int nXSize, int nYSize, if (!poRG) return nullptr; - auto poDS = cpl::make_unique(poRG); + auto poDS = std::make_unique(poRG); poDS->SetDescription(pszName); poDS->nRasterYSize = nYSize; poDS->nRasterXSize = nXSize; diff --git a/gcore/gdaldataset.cpp b/gcore/gdaldataset.cpp index 5838095c8f3d..3c0b64a33446 100644 --- a/gcore/gdaldataset.cpp +++ b/gcore/gdaldataset.cpp @@ -2048,7 +2048,7 @@ CPLErr GDALDataset::BuildOverviews(const char *pszResampling, int nOverviews, if (pszKey && pszValue) { apoConfigOptionSetter.emplace_back( - cpl::make_unique(pszKey, pszValue, + std::make_unique(pszKey, pszValue, false)); } CPLFree(pszKey); @@ -5401,7 +5401,7 @@ OGRLayer *GDALDataset::CopyLayer(OGRLayer *poSrcLayer, const char *pszNewName, CPLErrorReset(); auto poDstFeature = - cpl::make_unique(poDstLayer->GetLayerDefn()); + std::make_unique(poDstLayer->GetLayerDefn()); if (poDstFeature->SetFrom(poFeature.get(), anMap.data(), TRUE) != OGRERR_NONE) @@ -5477,7 +5477,7 @@ OGRLayer *GDALDataset::CopyLayer(OGRLayer *poSrcLayer, const char *pszNewName, CPLErrorReset(); apoDstFeatures[nFeatCount] = - cpl::make_unique(poDstLayer->GetLayerDefn()); + std::make_unique(poDstLayer->GetLayerDefn()); if (apoDstFeatures[nFeatCount]->SetFrom( poFeature.get(), anMap.data(), TRUE) != OGRERR_NONE) diff --git a/gcore/gdalmultidim.cpp b/gcore/gdalmultidim.cpp index 6220759eaac6..febb74a51d9f 100644 --- a/gcore/gdalmultidim.cpp +++ b/gcore/gdalmultidim.cpp @@ -9169,7 +9169,7 @@ GDALDatasetFromArray *GDALDatasetFromArray::Create( } } - auto poDS = cpl::make_unique(array, iXDim, iYDim); + auto poDS = std::make_unique(array, iXDim, iYDim); poDS->eAccess = array->IsWritable() ? GA_Update : GA_ReadOnly; diff --git a/gcore/overview.cpp b/gcore/overview.cpp index 0c89b7d6691b..9ec9343431cb 100644 --- a/gcore/overview.cpp +++ b/gcore/overview.cpp @@ -4595,7 +4595,7 @@ CPLErr GDALRegenerateOverviewsEx(GDALRasterBandH hSrcBand, int nOverviewCount, } poJob->oDstBufferHolder = - cpl::make_unique(poJob->pDstBuffer); + std::make_unique(poJob->pDstBuffer); { std::lock_guard guard(poJob->mutex); diff --git a/gcore/rawdataset.cpp b/gcore/rawdataset.cpp index 3df6d452f999..27a1b09e589d 100644 --- a/gcore/rawdataset.cpp +++ b/gcore/rawdataset.cpp @@ -120,7 +120,7 @@ RawRasterBand::Create(GDALDataset *poDSIn, int nBandIn, VSILFILE *fpRawLIn, int nLineOffsetIn, GDALDataType eDataTypeIn, ByteOrder eByteOrderIn, OwnFP bOwnsFPIn) { - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( poDSIn, nBandIn, fpRawLIn, nImgOffsetIn, nPixelOffsetIn, nLineOffsetIn, eDataTypeIn, eByteOrderIn, bOwnsFPIn); if (!poBand->IsValid()) @@ -159,7 +159,7 @@ RawRasterBand::Create(VSILFILE *fpRawIn, vsi_l_offset nImgOffsetIn, GDALDataType eDataTypeIn, ByteOrder eByteOrderIn, int nXSizeIn, int nYSizeIn, OwnFP bOwnsFPIn) { - auto poBand = cpl::make_unique( + auto poBand = std::make_unique( fpRawIn, nImgOffsetIn, nPixelOffsetIn, nLineOffsetIn, eDataTypeIn, eByteOrderIn, nXSizeIn, nYSizeIn, bOwnsFPIn); if (!poBand->IsValid()) diff --git a/ogr/gml2ogrgeometry.cpp b/ogr/gml2ogrgeometry.cpp index 559ece23fb97..5a95e95121eb 100644 --- a/ogr/gml2ogrgeometry.cpp +++ b/ogr/gml2ogrgeometry.cpp @@ -942,7 +942,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (psChild == nullptr) { // is invalid GML2, but valid GML3, so be tolerant. - return cpl::make_unique(); + return std::make_unique(); } // Translate outer ring and add to polygon. @@ -978,12 +978,12 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( assert(poGeom); // to please cppcheck if (EQUAL(poGeom->getGeometryName(), "LINEARRING")) { - poCP = cpl::make_unique(); + poCP = std::make_unique(); bIsPolygon = true; } else { - poCP = cpl::make_unique(); + poCP = std::make_unique(); bIsPolygon = false; } @@ -1093,7 +1093,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (psChild == nullptr) { CPLError(CE_Failure, CPLE_AppDefined, "Empty Triangle"); - return cpl::make_unique(); + return std::make_unique(); } // Translate outer ring and add to Triangle. @@ -1127,7 +1127,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( return nullptr; } - auto poTriangle = cpl::make_unique(); + auto poTriangle = std::make_unique(); auto poCurve = std::unique_ptr(poGeom.release()->toCurve()); if (poTriangle->addRing(std::move(poCurve)) != OGRERR_NONE) { @@ -1142,7 +1142,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( /* -------------------------------------------------------------------- */ if (EQUAL(pszBaseGeometry, "LinearRing")) { - auto poLinearRing = cpl::make_unique(); + auto poLinearRing = std::make_unique(); if (!ParseGMLCoordinates(psNode, poLinearRing.get(), nSRSDimension)) { @@ -1376,7 +1376,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( { if (poCC == nullptr) { - poCC = cpl::make_unique(); + poCC = std::make_unique(); bool bIgnored = false; if (!GML2OGRGeometry_AddToCompositeCurve( poCC.get(), std::move(poRing), bIgnored)) @@ -1559,7 +1559,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( EQUAL(pszBaseGeometry, "LineStringSegment") || EQUAL(pszBaseGeometry, "GeodesicString")) { - auto poLine = cpl::make_unique(); + auto poLine = std::make_unique(); if (!ParseGMLCoordinates(psNode, poLine.get(), nSRSDimension)) { @@ -1574,7 +1574,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( /* -------------------------------------------------------------------- */ if (EQUAL(pszBaseGeometry, "Arc")) { - auto poCC = cpl::make_unique(); + auto poCC = std::make_unique(); if (!ParseGMLCoordinates(psNode, poCC.get(), nSRSDimension)) { @@ -1599,7 +1599,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( /* -------------------------------------------------------------------- */ if (EQUAL(pszBaseGeometry, "ArcString")) { - auto poCC = cpl::make_unique(); + auto poCC = std::make_unique(); if (!ParseGMLCoordinates(psNode, poCC.get(), nSRSDimension)) { @@ -1621,7 +1621,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( /* -------------------------------------------------------------------- */ if (EQUAL(pszBaseGeometry, "Circle")) { - auto poLine = cpl::make_unique(); + auto poLine = std::make_unique(); if (!ParseGMLCoordinates(psNode, poLine.get(), nSRSDimension)) { @@ -1649,7 +1649,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( return nullptr; } - auto poCC = cpl::make_unique(); + auto poCC = std::make_unique(); OGRPoint p; poLine->getPoint(0, &p); poCC->addPoint(&p); @@ -1693,7 +1693,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( } double dfNormal = CPLAtof(psChild->psChild->pszValue); - auto poLS = cpl::make_unique(); + auto poLS = std::make_unique(); if (!ParseGMLCoordinates(psNode, poLS.get(), nSRSDimension)) { return nullptr; @@ -1706,7 +1706,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( return nullptr; } - auto poCC = cpl::make_unique(); + auto poCC = std::make_unique(); OGRPoint p; poLS->getPoint(0, &p); poCC->addPoint(&p); @@ -1805,7 +1805,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (bSRSUnitIsDegree && pszUnits != nullptr && (dfDistance = GetDistanceInMetre(dfRadius, pszUnits)) > 0) { - auto poLS = cpl::make_unique(); + auto poLS = std::make_unique(); // coverity[tainted_data] const double dfStep = CPLAtof(CPLGetConfigOption("OGR_ARC_STEPSIZE", "4")); @@ -1862,7 +1862,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (bInvertedAxisOrder) std::swap(dfCenterX, dfCenterY); - auto poCC = cpl::make_unique(); + auto poCC = std::make_unique(); p.setX(dfCenterX + dfRadius * cos(dfStartAngle * kdfD2R)); p.setY(dfCenterY + dfRadius * sin(dfStartAngle * kdfD2R)); poCC->addPoint(&p); @@ -1929,7 +1929,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (bSRSUnitIsDegree && pszUnits != nullptr && (dfDistance = GetDistanceInMetre(dfRadius, pszUnits)) > 0) { - auto poLS = cpl::make_unique(); + auto poLS = std::make_unique(); const double dfStep = CPLAtof(CPLGetConfigOption("OGR_ARC_STEPSIZE", "4")); for (double dfAngle = 0; dfAngle < 360; dfAngle += dfStep) @@ -1962,7 +1962,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (bInvertedAxisOrder) std::swap(dfCenterX, dfCenterY); - auto poCC = cpl::make_unique(); + auto poCC = std::make_unique(); p.setX(dfCenterX - dfRadius); p.setY(dfCenterY); poCC->addPoint(&p); @@ -1986,7 +1986,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( EQUAL(pszBaseGeometry, "Point") || EQUAL(pszBaseGeometry, "ConnectionPoint")) { - auto poPoint = cpl::make_unique(); + auto poPoint = std::make_unique(); if (!ParseGMLCoordinates(psNode, poPoint.get(), nSRSDimension)) { @@ -2009,8 +2009,8 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (oPoints.getNumPoints() < 2) return nullptr; - auto poBoxRing = cpl::make_unique(); - auto poBoxPoly = cpl::make_unique(); + auto poBoxRing = std::make_unique(); + auto poBoxPoly = std::make_unique(); poBoxRing->setNumPoints(5); poBoxRing->setPoint(0, oPoints.getX(0), oPoints.getY(0), @@ -2063,8 +2063,8 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( CSLDestroy(papszLowerCorner); CSLDestroy(papszUpperCorner); - auto poEnvelopeRing = cpl::make_unique(); - auto poPoly = cpl::make_unique(); + auto poEnvelopeRing = std::make_unique(); + auto poPoly = std::make_unique(); poEnvelopeRing->setNumPoints(5); poEnvelopeRing->setPoint(0, dfLLX, dfLLY); @@ -2089,8 +2089,8 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( { std::unique_ptr poMS = EQUAL(pszBaseGeometry, "MultiPolygon") - ? cpl::make_unique() - : cpl::make_unique(); + ? std::make_unique() + : std::make_unique(); bool bReconstructTopology = false; bool bChildrenAreAllPolygons = true; @@ -2159,7 +2159,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( } bReconstructTopology = true; - auto poPolygon = cpl::make_unique(); + auto poPolygon = std::make_unique(); auto poLinearRing = std::unique_ptr( poRing.release()->toLinearRing()); @@ -2251,7 +2251,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( /* -------------------------------------------------------------------- */ if (EQUAL(pszBaseGeometry, "MultiPoint")) { - auto poMP = cpl::make_unique(); + auto poMP = std::make_unique(); // Collect points. for (const CPLXMLNode *psChild = psNode->psChild; psChild != nullptr; @@ -2329,7 +2329,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( /* -------------------------------------------------------------------- */ if (EQUAL(pszBaseGeometry, "MultiLineString")) { - auto poMLS = cpl::make_unique(); + auto poMLS = std::make_unique(); // Collect lines. for (const CPLXMLNode *psChild = psNode->psChild; psChild != nullptr; @@ -2368,7 +2368,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( /* -------------------------------------------------------------------- */ if (EQUAL(pszBaseGeometry, "MultiCurve")) { - auto poMC = cpl::make_unique(); + auto poMC = std::make_unique(); bool bChildrenAreAllLineString = true; // Collect curveMembers. @@ -2452,7 +2452,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( /* -------------------------------------------------------------------- */ if (EQUAL(pszBaseGeometry, "CompositeCurve")) { - auto poCC = cpl::make_unique(); + auto poCC = std::make_unique(); bool bChildrenAreAllLineString = true; // Collect curveMembers. @@ -2597,7 +2597,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( { if (poCC == nullptr) { - poCC = cpl::make_unique(); + poCC = std::make_unique(); if (poCC->addCurve(std::move(poCurve)) != OGRERR_NONE) { return nullptr; @@ -2646,7 +2646,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (EQUAL(pszBaseGeometry, "MultiGeometry") || EQUAL(pszBaseGeometry, "GeometryCollection")) { - auto poGC = cpl::make_unique(); + auto poGC = std::make_unique(); // Collect geoms. for (const CPLXMLNode *psChild = psNode->psChild; psChild != nullptr; @@ -2825,7 +2825,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( { // Create a scope so that poMP can be initialized with goto // above and label below. - auto poMP = cpl::make_unique(); + auto poMP = std::make_unique(); poMP->addGeometry(std::move(poNegativeNode)); poMP->addGeometry(std::move(poPositiveNode)); @@ -2876,8 +2876,8 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (bGetSecondaryGeometry) { // Choose a point based on the orientation. - poNegativeNode = cpl::make_unique(); - poPositiveNode = cpl::make_unique(); + poNegativeNode = std::make_unique(); + poPositiveNode = std::make_unique(); if (bEdgeOrientation == bOrientation) { poLineString->StartPoint(poNegativeNode.get()); @@ -2889,7 +2889,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( poLineString->EndPoint(poNegativeNode.get()); } - auto poMP = cpl::make_unique(); + auto poMP = std::make_unique(); poMP->addGeometry(std::move(poNegativeNode)); poMP->addGeometry(std::move(poPositiveNode)); return poMP; @@ -2924,9 +2924,9 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( std::unique_ptr poMP; if (bGetSecondaryGeometry) - poMP = cpl::make_unique(); + poMP = std::make_unique(); else - poMLS = cpl::make_unique(); + poMLS = std::make_unique(); // Collect directedEdges. for (const CPLXMLNode *psChild = psNode->psChild; psChild != nullptr; @@ -3027,7 +3027,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( } return nullptr; #else - auto poTS = cpl::make_unique(); + auto poTS = std::make_unique(); // Collect directed faces. for (const CPLXMLNode *psChild = psNode->psChild; @@ -3049,7 +3049,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( continue; auto poCollectedGeom = - cpl::make_unique(); + std::make_unique(); // Collect directed edges of the face. for (const CPLXMLNode *psDirectedEdgeChild = @@ -3121,7 +3121,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( wkbPolygon) { // Forcing to be a MultiPolygon. - poTS = cpl::make_unique(); + poTS = std::make_unique(); poTS->addGeometry(std::move(poUnion)); } else if (wkbFlatten(poUnion->getGeometryType()) == @@ -3161,7 +3161,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (bGetSecondaryGeometry) return nullptr; bool bFaceOrientation = true; - auto poTS = cpl::make_unique(); + auto poTS = std::make_unique(); // Collect directed faces. for (const CPLXMLNode *psChild = psNode->psChild; psChild != nullptr; @@ -3181,7 +3181,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (psFaceChild == nullptr) continue; - auto poFaceGeom = cpl::make_unique(); + auto poFaceGeom = std::make_unique(); // Collect directed edges of the face. for (const CPLXMLNode *psDirectedEdgeChild = @@ -3310,7 +3310,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( { // and are // valid GML. - return cpl::make_unique(); + return std::make_unique(); } OGRMultiSurface *poMSPtr = nullptr; @@ -3344,9 +3344,9 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (wkbFlatten(poResultPoly->getGeometryType()) == wkbPolygon && eGeomType == wkbPolygon) - poMS = cpl::make_unique(); + poMS = std::make_unique(); else - poMS = cpl::make_unique(); + poMS = std::make_unique(); OGRErr eErr = poMS->addGeometry(std::move(poResultPoly)); CPL_IGNORE_RET_VAL(eErr); @@ -3388,7 +3388,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( { if (poTINPtr == nullptr) { - auto poTIN = cpl::make_unique(); + auto poTIN = std::make_unique(); OGRErr eErr = poTIN->addGeometry(std::move(poResultTri)); CPL_IGNORE_RET_VAL(eErr); @@ -3413,7 +3413,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( return poResultTri; else { - auto poGC = cpl::make_unique(); + auto poGC = std::make_unique(); poGC->addGeometry(std::move(poResultTri)); poGC->addGeometry(std::move(poResultPoly)); return poGC; @@ -3439,7 +3439,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( return nullptr; } - auto poTIN = cpl::make_unique(); + auto poTIN = std::make_unique(); for (; psChild != nullptr; psChild = psChild->psNext) { if (psChild->eType == CXT_Element && @@ -3474,7 +3474,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (GetChildElement(psNode) == nullptr) { // This is empty PolyhedralSurface. - return cpl::make_unique(); + return std::make_unique(); } else { @@ -3488,7 +3488,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (psChild == nullptr) { // This is empty PolyhedralSurface. - return cpl::make_unique(); + return std::make_unique(); } else if (!EQUAL(BareGMLElement(psChild->pszValue), "PolygonPatch")) { @@ -3501,13 +3501,13 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( // Each psChild has the tags corresponding to // Each PolygonPatch has a set of polygons enclosed in a // OGRPolyhedralSurface. - auto poGC = cpl::make_unique(); + auto poGC = std::make_unique(); for (; psParent != nullptr; psParent = psParent->psNext) { psChild = GetChildElement(psParent); if (psChild == nullptr) continue; - auto poPS = cpl::make_unique(); + auto poPS = std::make_unique(); for (; psChild != nullptr; psChild = psChild->psNext) { if (psChild->eType == CXT_Element && @@ -3593,12 +3593,12 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( { // and are valid // GML. - return cpl::make_unique(); + return std::make_unique(); } if (EQUAL(BareGMLElement(psChild->pszValue), "CompositeSurface")) { - auto poPS = cpl::make_unique(); + auto poPS = std::make_unique(); // Iterate over children. for (psChild = psChild->psChild; psChild != nullptr; @@ -3670,7 +3670,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( if (EQUAL(pszBaseGeometry, "SimplePolygon") || EQUAL(pszBaseGeometry, "SimpleRectangle")) { - auto poRing = cpl::make_unique(); + auto poRing = std::make_unique(); if (!ParseGMLCoordinates(psNode, poRing.get(), nSRSDimension)) { @@ -3679,14 +3679,14 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( poRing->closeRings(); - auto poPolygon = cpl::make_unique(); + auto poPolygon = std::make_unique(); poPolygon->addRing(std::move(poRing)); return poPolygon; } if (EQUAL(pszBaseGeometry, "SimpleTriangle")) { - auto poRing = cpl::make_unique(); + auto poRing = std::make_unique(); if (!ParseGMLCoordinates(psNode, poRing.get(), nSRSDimension)) { @@ -3695,7 +3695,7 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( poRing->closeRings(); - auto poTriangle = cpl::make_unique(); + auto poTriangle = std::make_unique(); poTriangle->addRing(std::move(poRing)); return poTriangle; } @@ -3705,18 +3705,18 @@ static std::unique_ptr GML2OGRGeometry_XMLNode_Internal( /* -------------------------------------------------------------------- */ if (EQUAL(pszBaseGeometry, "SimpleMultiPoint")) { - auto poLS = cpl::make_unique(); + auto poLS = std::make_unique(); if (!ParseGMLCoordinates(psNode, poLS.get(), nSRSDimension)) { return nullptr; } - auto poMP = cpl::make_unique(); + auto poMP = std::make_unique(); int nPoints = poLS->getNumPoints(); for (int i = 0; i < nPoints; i++) { - auto poPoint = cpl::make_unique(); + auto poPoint = std::make_unique(); poLS->getPoint(i, poPoint.get()); poMP->addGeometry(std::move(poPoint)); } diff --git a/ogr/ogrfeaturedefn.cpp b/ogr/ogrfeaturedefn.cpp index c2d13571b339..dc12260e35a3 100644 --- a/ogr/ogrfeaturedefn.cpp +++ b/ogr/ogrfeaturedefn.cpp @@ -63,7 +63,7 @@ OGRFeatureDefn::OGRFeatureDefn(const char *pszName) { pszFeatureClassName = CPLStrdup(pszName); apoGeomFieldDefn.emplace_back( - cpl::make_unique("", wkbUnknown)); + std::make_unique("", wkbUnknown)); } /************************************************************************/ @@ -412,7 +412,7 @@ void OGRFeatureDefn::ReserveSpaceForFields(int nFieldCountIn) void OGRFeatureDefn::AddFieldDefn(const OGRFieldDefn *poNewDefn) { - apoFieldDefn.emplace_back(cpl::make_unique(poNewDefn)); + apoFieldDefn.emplace_back(std::make_unique(poNewDefn)); } /************************************************************************/ @@ -737,7 +737,7 @@ OGRGeomFieldDefnH OGR_FD_GetGeomFieldDefn(OGRFeatureDefnH hDefn, int iGeomField) void OGRFeatureDefn::AddGeomFieldDefn(const OGRGeomFieldDefn *poNewDefn) { apoGeomFieldDefn.emplace_back( - cpl::make_unique(poNewDefn)); + std::make_unique(poNewDefn)); } /** diff --git a/ogr/ogrpgeogeometry.cpp b/ogr/ogrpgeogeometry.cpp index 21db8c22da81..1707369c637e 100644 --- a/ogr/ogrpgeogeometry.cpp +++ b/ogr/ogrpgeogeometry.cpp @@ -1710,7 +1710,7 @@ static OGRCurve *OGRShapeCreateCompoundCurve(int nPartStartIdx, int nPartPoints, /* const */ double *padfM, int *pnLastCurveIdx) { - auto poCC = cpl::make_unique(); + auto poCC = std::make_unique(); int nLastPointIdx = nPartStartIdx; bool bHasCircularArcs = false; int i = nFirstCurveIdx; // Used after for. diff --git a/ogr/ogrsf_frmts/amigocloud/ogramigocloudlayer.cpp b/ogr/ogrsf_frmts/amigocloud/ogramigocloudlayer.cpp index c5db2140f1fe..4141bed14240 100644 --- a/ogr/ogrsf_frmts/amigocloud/ogramigocloudlayer.cpp +++ b/ogr/ogrsf_frmts/amigocloud/ogramigocloudlayer.cpp @@ -391,7 +391,7 @@ void OGRAmigoCloudLayer::EstablishLayerDefn(const char *pszLayerName, else if (EQUAL(fieldType.c_str(), "geometry")) { auto poFieldDefn = - cpl::make_unique( + std::make_unique( fieldName.c_str(), wkbUnknown); OGRSpatialReference *poSRS = GetSRS(fieldName.c_str(), &poFieldDefn->nSRID); diff --git a/ogr/ogrsf_frmts/amigocloud/ogramigocloudtablelayer.cpp b/ogr/ogrsf_frmts/amigocloud/ogramigocloudtablelayer.cpp index e9239ff2104f..dc4c596aa5ff 100644 --- a/ogr/ogrsf_frmts/amigocloud/ogramigocloudtablelayer.cpp +++ b/ogr/ogrsf_frmts/amigocloud/ogramigocloudtablelayer.cpp @@ -1056,7 +1056,7 @@ void OGRAmigoCloudTableLayer::SetDeferredCreation(OGRwkbGeometryType eGType, eGType = wkbMultiPolygon25D; if (eGType != wkbNone) { - auto poFieldDefn = cpl::make_unique( + auto poFieldDefn = std::make_unique( "wkb_geometry", eGType); poFieldDefn->SetNullable(bGeomNullable); if (poSRS != nullptr) diff --git a/ogr/ogrsf_frmts/arrow/ogrfeatherdriver.cpp b/ogr/ogrsf_frmts/arrow/ogrfeatherdriver.cpp index 789140b622ad..c9a81c1a9a52 100644 --- a/ogr/ogrsf_frmts/arrow/ogrfeatherdriver.cpp +++ b/ogr/ogrsf_frmts/arrow/ogrfeatherdriver.cpp @@ -223,7 +223,7 @@ static GDALDataset *OGRFeatherDriverOpen(GDALOpenInfo *poOpenInfo) auto options = arrow::ipc::IpcReadOptions::Defaults(); options.memory_pool = poMemoryPool.get(); - auto poDS = cpl::make_unique(poMemoryPool); + auto poDS = std::make_unique(poMemoryPool); if (bIsStreamingFormat) { auto result = @@ -242,7 +242,7 @@ static GDALDataset *OGRFeatherDriverOpen(GDALOpenInfo *poOpenInfo) std::string osLayername = CPLGetBasename(poOpenInfo->pszFilename); if (osLayername.empty()) osLayername = "layer"; - auto poLayer = cpl::make_unique( + auto poLayer = std::make_unique( poDS.get(), osLayername.c_str(), infile, bSeekable, options, poRecordBatchStreamReader); poDS->SetLayer(std::move(poLayer)); @@ -278,7 +278,7 @@ static GDALDataset *OGRFeatherDriverOpen(GDALOpenInfo *poOpenInfo) return nullptr; } auto poRecordBatchReader = *result; - auto poLayer = cpl::make_unique( + auto poLayer = std::make_unique( poDS.get(), CPLGetBasename(poOpenInfo->pszFilename), poRecordBatchReader); poDS->SetLayer(std::move(poLayer)); @@ -462,7 +462,7 @@ void RegisterOGRArrow() if (GDALGetDriverByName("Arrow") != nullptr) return; - auto poDriver = cpl::make_unique(); + auto poDriver = std::make_unique(); poDriver->SetDescription("Arrow"); poDriver->SetMetadataItem(GDAL_DCAP_VECTOR, "YES"); diff --git a/ogr/ogrsf_frmts/arrow/ogrfeatherwriterdataset.cpp b/ogr/ogrsf_frmts/arrow/ogrfeatherwriterdataset.cpp index a1e71c6b40a6..cbb2b86a1d1f 100644 --- a/ogr/ogrsf_frmts/arrow/ogrfeatherwriterdataset.cpp +++ b/ogr/ogrsf_frmts/arrow/ogrfeatherwriterdataset.cpp @@ -88,7 +88,7 @@ OGRLayer *OGRFeatherWriterDataset::ICreateLayer( "Can write only one layer in a Feather file"); return nullptr; } - m_poLayer = cpl::make_unique( + m_poLayer = std::make_unique( m_poMemoryPool.get(), m_poOutputStream, pszName); if (!m_poLayer->SetOptions(m_osFilename, papszOptions, poSpatialRef, eGType)) diff --git a/ogr/ogrsf_frmts/arrow_common/ograrrowlayer.hpp b/ogr/ogrsf_frmts/arrow_common/ograrrowlayer.hpp index c94bda6b3f58..e9b0c251443d 100644 --- a/ogr/ogrsf_frmts/arrow_common/ograrrowlayer.hpp +++ b/ogr/ogrsf_frmts/arrow_common/ograrrowlayer.hpp @@ -105,7 +105,7 @@ OGRArrowLayer::LoadGDALMetadata(const arrow::KeyValueMetadata *kv_metadata) const auto osName = oColumn.GetName(); const auto osType = oColumn.GetString("type"); const auto osSubType = oColumn.GetString("subtype"); - auto poFieldDefn = cpl::make_unique( + auto poFieldDefn = std::make_unique( osName.c_str(), OFTString); for (int iType = 0; iType <= static_cast(OFTMaxType); iType++) @@ -589,7 +589,7 @@ inline std::unique_ptr OGRArrowLayer::BuildDomainFromBatch( asValues.emplace_back(val); } } - return cpl::make_unique( + return std::make_unique( osDomainName, std::string(), eType, OFSTNone, std::move(asValues)); } diff --git a/ogr/ogrsf_frmts/carto/ogrcartolayer.cpp b/ogr/ogrsf_frmts/carto/ogrcartolayer.cpp index 58474f473d8f..b7000743ef4b 100644 --- a/ogr/ogrsf_frmts/carto/ogrcartolayer.cpp +++ b/ogr/ogrsf_frmts/carto/ogrcartolayer.cpp @@ -379,7 +379,7 @@ void OGRCARTOLayer::EstablishLayerDefn(const char *pszLayerName, if (!EQUAL(pszColName, "the_geom_webmercator")) { auto poFieldDefn = - cpl::make_unique(pszColName, + std::make_unique(pszColName, wkbUnknown); OGRSpatialReference *l_poSRS = GetSRS(pszColName, &poFieldDefn->nSRID); @@ -411,7 +411,7 @@ void OGRCARTOLayer::EstablishLayerDefn(const char *pszLayerName, { /* FIXME? manual creations of geometry columns return integer * types */ - auto poFieldDefn = cpl::make_unique( + auto poFieldDefn = std::make_unique( pszColName, wkbUnknown); OGRSpatialReference *l_poSRS = GetSRS(pszColName, &poFieldDefn->nSRID); diff --git a/ogr/ogrsf_frmts/carto/ogrcartotablelayer.cpp b/ogr/ogrsf_frmts/carto/ogrcartotablelayer.cpp index ff10db66683b..abfb139eb2e4 100644 --- a/ogr/ogrsf_frmts/carto/ogrcartotablelayer.cpp +++ b/ogr/ogrsf_frmts/carto/ogrcartotablelayer.cpp @@ -300,7 +300,7 @@ OGRCARTOTableLayer::GetLayerDefnInternal(CPL_UNUSED json_object *poObjIn) if (nDim == 3) eType = wkbSetZ(eType); auto poFieldDefn = - cpl::make_unique(pszAttname, + std::make_unique(pszAttname, eType); if (bNotNull) poFieldDefn->SetNullable(FALSE); @@ -652,7 +652,7 @@ OGRErr OGRCARTOTableLayer::CreateGeomField(OGRGeomFieldDefn *poGeomFieldIn, } auto poGeomField = - cpl::make_unique(pszNameIn, eType); + std::make_unique(pszNameIn, eType); if (EQUAL(poGeomField->GetNameRef(), "")) { if (poFeatureDefn->GetGeomFieldCount() == 0) @@ -1905,7 +1905,7 @@ void OGRCARTOTableLayer::SetDeferredCreation(OGRwkbGeometryType eGType, if (eGType != wkbNone) { auto poFieldDefn = - cpl::make_unique("the_geom", eGType); + std::make_unique("the_geom", eGType); poFieldDefn->SetNullable(bGeomNullable); if (poSRSIn != nullptr) { diff --git a/ogr/ogrsf_frmts/csv/ogrcsvdatasource.cpp b/ogr/ogrsf_frmts/csv/ogrcsvdatasource.cpp index 22e019769cfa..cb806ac91c76 100644 --- a/ogr/ogrsf_frmts/csv/ogrcsvdatasource.cpp +++ b/ogr/ogrsf_frmts/csv/ogrcsvdatasource.cpp @@ -894,14 +894,14 @@ bool OGRCSVDataSource::OpenTable(const char *pszFilename, osLayerName = "layer"; auto poCSVLayer = - cpl::make_unique(osLayerName, fp, nMaxLineSize, + std::make_unique(osLayerName, fp, nMaxLineSize, pszFilename, FALSE, bUpdate, chDelimiter); poCSVLayer->BuildFeatureDefn(pszNfdcRunwaysGeomField, pszGeonamesGeomFieldPrefix, papszOpenOptionsIn); if (bUpdate) { - m_apoLayers.emplace_back(cpl::make_unique( + m_apoLayers.emplace_back(std::make_unique( poCSVLayer.release(), papszOpenOptionsIn)); } else @@ -1009,7 +1009,7 @@ OGRCSVDataSource::ICreateLayer(const char *pszLayerName, // Create a layer. - auto poCSVLayer = cpl::make_unique( + auto poCSVLayer = std::make_unique( pszLayerName, nullptr, -1, osFilename, true, true, chDelimiter); poCSVLayer->BuildFeatureDefn(); @@ -1121,7 +1121,7 @@ OGRCSVDataSource::ICreateLayer(const char *pszLayerName, poCSVLayer->SetWriteBOM(CPLTestBool(pszWriteBOM)); if (osFilename != "/vsistdout/") - m_apoLayers.emplace_back(cpl::make_unique( + m_apoLayers.emplace_back(std::make_unique( poCSVLayer.release(), nullptr)); else m_apoLayers.emplace_back(std::move(poCSVLayer)); diff --git a/ogr/ogrsf_frmts/dxf/ogrdxflayer.cpp b/ogr/ogrsf_frmts/dxf/ogrdxflayer.cpp index 9aaa2c293a91..851cea06cef6 100644 --- a/ogr/ogrsf_frmts/dxf/ogrdxflayer.cpp +++ b/ogr/ogrsf_frmts/dxf/ogrdxflayer.cpp @@ -464,7 +464,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateMTEXT() { char szLineBuf[512]; int nCode = 0; - auto poFeature = cpl::make_unique(poFeatureDefn); + auto poFeature = std::make_unique(poFeatureDefn); double dfX = 0.0; double dfY = 0.0; double dfZ = 0.0; @@ -657,7 +657,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateTEXT(const bool bIsAttribOrAttdef) { char szLineBuf[257]; int nCode = 0; - auto poFeature = cpl::make_unique(poFeatureDefn); + auto poFeature = std::make_unique(poFeatureDefn); double dfX = 0.0; double dfY = 0.0; @@ -923,7 +923,7 @@ OGRDXFFeature *OGRDXFLayer::TranslatePOINT() { char szLineBuf[257]; int nCode = 0; - auto poFeature = cpl::make_unique(poFeatureDefn); + auto poFeature = std::make_unique(poFeatureDefn); double dfX = 0.0; double dfY = 0.0; double dfZ = 0.0; @@ -983,7 +983,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateLINE() { char szLineBuf[257]; int nCode = 0; - auto poFeature = cpl::make_unique(poFeatureDefn); + auto poFeature = std::make_unique(poFeatureDefn); double dfX1 = 0.0; double dfY1 = 0.0; double dfZ1 = 0.0; @@ -1042,7 +1042,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateLINE() /* -------------------------------------------------------------------- */ /* Create geometry */ /* -------------------------------------------------------------------- */ - auto poLS = cpl::make_unique(); + auto poLS = std::make_unique(); if (bHaveZ) { poLS->addPoint(dfX1, dfY1, dfZ1); @@ -1075,7 +1075,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateLWPOLYLINE() int nCode = 0; int nPolylineFlag = 0; - auto poFeature = cpl::make_unique(poFeatureDefn); + auto poFeature = std::make_unique(poFeatureDefn); double dfX = 0.0; double dfY = 0.0; double dfZ = 0.0; @@ -1206,7 +1206,7 @@ OGRDXFFeature *OGRDXFLayer::TranslatePOLYLINE() char szLineBuf[257]; int nCode = 0; int nPolylineFlag = 0; - auto poFeature = cpl::make_unique(poFeatureDefn); + auto poFeature = std::make_unique(poFeatureDefn); /* -------------------------------------------------------------------- */ /* Collect information from the POLYLINE object itself. */ @@ -1250,7 +1250,7 @@ OGRDXFFeature *OGRDXFLayer::TranslatePOLYLINE() unsigned int vertexIndex73 = 0; unsigned int vertexIndex74 = 0; std::vector aoPoints; - auto poPS = cpl::make_unique(); + auto poPS = std::make_unique(); smoothPolyline.setCoordinateDimension(2); @@ -1344,7 +1344,7 @@ OGRDXFFeature *OGRDXFLayer::TranslatePOLYLINE() if (nVertexFlag == 128) { // create a polygon and add it to the Polyhedral Surface - auto poLR = cpl::make_unique(); + auto poLR = std::make_unique(); int iPoint = 0; int startPoint = -1; poLR->set3D(TRUE); @@ -1444,7 +1444,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateMLINE() char szLineBuf[257]; int nCode = 0; - auto poFeature = cpl::make_unique(poFeatureDefn); + auto poFeature = std::make_unique(poFeatureDefn); bool bIsClosed = false; int nNumVertices = 0; @@ -1494,7 +1494,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateMLINE() /* translate these values into line geometries. */ /* -------------------------------------------------------------------- */ - auto poMLS = cpl::make_unique(); + auto poMLS = std::make_unique(); std::vector> apoCurrentLines(nNumElements); // For use when bIsClosed is true @@ -1595,7 +1595,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateMLINE() { // The dfCurrent(X,Y,Z) point is the end of a break apoCurrentLines[iElement] = - cpl::make_unique(); + std::make_unique(); apoCurrentLines[iElement]->addPoint(dfCurrentX, dfCurrentY, dfCurrentZ); } @@ -1648,7 +1648,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateCIRCLE() { char szLineBuf[257]; int nCode = 0; - auto poFeature = cpl::make_unique(poFeatureDefn); + auto poFeature = std::make_unique(poFeatureDefn); double dfX1 = 0.0; double dfY1 = 0.0; double dfZ1 = 0.0; @@ -1735,7 +1735,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateCIRCLE() poSurface->addGeometryDirectly(poBase2); // Add the side of the cylinder as two "semicylindrical" polygons - auto poRect = cpl::make_unique(); + auto poRect = std::make_unique(); OGRPoint oPoint; for (int iPoint = nPoints / 2; iPoint >= 0; iPoint--) @@ -1755,7 +1755,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateCIRCLE() poRectPolygon->addRingDirectly(poRect.release()); poSurface->addGeometryDirectly(poRectPolygon); - poRect = cpl::make_unique(); + poRect = std::make_unique(); for (int iPoint = nPoints - 1; iPoint >= nPoints / 2; iPoint--) { @@ -1801,7 +1801,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateELLIPSE() { char szLineBuf[257]; int nCode = 0; - auto poFeature = cpl::make_unique(poFeatureDefn); + auto poFeature = std::make_unique(poFeatureDefn); double dfX1 = 0.0; double dfY1 = 0.0; double dfZ1 = 0.0; @@ -1950,7 +1950,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateARC() { char szLineBuf[257]; int nCode = 0; - auto poFeature = cpl::make_unique(poFeatureDefn); + auto poFeature = std::make_unique(poFeatureDefn); double dfX1 = 0.0; double dfY1 = 0.0; double dfZ1 = 0.0; @@ -2047,7 +2047,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateSPLINE() { char szLineBuf[257]; int nCode; - auto poFeature = cpl::make_unique(poFeatureDefn); + auto poFeature = std::make_unique(poFeatureDefn); std::vector adfControlPoints(1, 0.0); std::vector adfKnots(1, 0.0); @@ -2259,7 +2259,7 @@ std::unique_ptr OGRDXFLayer::InsertSplineWithChecks( /* -------------------------------------------------------------------- */ /* Turn into OGR geometry. */ /* -------------------------------------------------------------------- */ - auto poLS = cpl::make_unique(); + auto poLS = std::make_unique(); poLS->setNumPoints(p1); for (int i = 0; i < p1; i++) @@ -2277,7 +2277,7 @@ OGRDXFFeature *OGRDXFLayer::Translate3DFACE() { char szLineBuf[257]; int nCode = 0; - auto poFeature = cpl::make_unique(poFeatureDefn); + auto poFeature = std::make_unique(poFeatureDefn); double dfX1 = 0.0; double dfY1 = 0.0; double dfZ1 = 0.0; @@ -2363,7 +2363,7 @@ OGRDXFFeature *OGRDXFLayer::Translate3DFACE() /* -------------------------------------------------------------------- */ /* Create geometry */ /* -------------------------------------------------------------------- */ - auto poPoly = cpl::make_unique(); + auto poPoly = std::make_unique(); OGRLinearRing *poLR = new OGRLinearRing(); poLR->addPoint(dfX1, dfY1, dfZ1); poLR->addPoint(dfX2, dfY2, dfZ2); @@ -2415,7 +2415,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateSOLID() { char szLineBuf[257]; int nCode = 0; - auto poFeature = cpl::make_unique(poFeatureDefn); + auto poFeature = std::make_unique(poFeatureDefn); double dfX1 = 0.0; double dfY1 = 0.0; double dfZ1 = 0.0; @@ -2538,7 +2538,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateSOLID() } else if (nCornerCount == 2) { - auto poLS = cpl::make_unique(); + auto poLS = std::make_unique(); poLS->setPoint(0, &oCorners[0]); poLS->setPoint(1, &oCorners[1]); poFinalGeom.reset(poLS.release()); @@ -2563,7 +2563,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateSOLID() if (!bWantZ) poLinearRing->flattenTo2D(); - auto poPoly = cpl::make_unique(); + auto poPoly = std::make_unique(); poPoly->addRingDirectly(poLinearRing); poFinalGeom.reset(poPoly.release()); @@ -2588,7 +2588,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateASMEntity() { char szLineBuf[257]; int nCode = 0; - auto poFeature = cpl::make_unique(poFeatureDefn); + auto poFeature = std::make_unique(poFeatureDefn); while ((nCode = poDS->ReadValue(szLineBuf, sizeof(szLineBuf))) > 0) { @@ -2623,7 +2623,7 @@ OGRDXFFeature *OGRDXFLayer::TranslateASMEntity() // Set up an affine transformation matrix so the user will be able to // transform the resulting 3D geometry - poFeature->poASMTransform = cpl::make_unique(); + poFeature->poASMTransform = std::make_unique(); poFeature->poASMTransform->SetField(poFeature.get(), "ASMTransform"); diff --git a/ogr/ogrsf_frmts/elastic/ogrelasticdatasource.cpp b/ogr/ogrsf_frmts/elastic/ogrelasticdatasource.cpp index 0370325c352e..6b4ace58f698 100644 --- a/ogr/ogrsf_frmts/elastic/ogrelasticdatasource.cpp +++ b/ogr/ogrsf_frmts/elastic/ogrelasticdatasource.cpp @@ -321,7 +321,7 @@ OGRLayer *OGRElasticDataSource::GetLayerByName(const char *pszName) return nullptr; m_apoLayers.push_back( - cpl::make_unique(pszName, poReferenceLayer)); + std::make_unique(pszName, poReferenceLayer)); return m_apoLayers.back().get(); } diff --git a/ogr/ogrsf_frmts/flatgeobuf/geometryreader.cpp b/ogr/ogrsf_frmts/flatgeobuf/geometryreader.cpp index 0084d83861cd..45d18518adab 100644 --- a/ogr/ogrsf_frmts/flatgeobuf/geometryreader.cpp +++ b/ogr/ogrsf_frmts/flatgeobuf/geometryreader.cpp @@ -101,7 +101,7 @@ OGRMultiPoint *GeometryReader::readMultiPoint() auto length = m_length / 2; if (length >= feature_max_buffer_size) return CPLErrorInvalidLength("MultiPoint"); - auto mp = cpl::make_unique(); + auto mp = std::make_unique(); for (uint32_t i = 0; i < length; i++) { m_offset = i; @@ -118,7 +118,7 @@ OGRMultiLineString *GeometryReader::readMultiLineString() const auto pEnds = m_geometry->ends(); if (pEnds == nullptr) return CPLErrorInvalidPointer("MultiLineString ends data"); - auto mls = cpl::make_unique(); + auto mls = std::make_unique(); m_offset = 0; for (uint32_t i = 0; i < pEnds->size(); i++) { @@ -234,7 +234,7 @@ OGRErr GeometryReader::readSimpleCurve(OGRSimpleCurve *sc) OGRPolygon *GeometryReader::readPolygon() { const auto ends = m_geometry->ends(); - auto p = cpl::make_unique(); + auto p = std::make_unique(); if (ends == nullptr || ends->size() < 2) { m_length = m_length / 2; @@ -268,7 +268,7 @@ OGRMultiPolygon *GeometryReader::readMultiPolygon() auto parts = m_geometry->parts(); if (parts == nullptr) return CPLErrorInvalidPointer("parts data"); - auto mp = cpl::make_unique(); + auto mp = std::make_unique(); for (uoffset_t i = 0; i < parts->size(); i++) { auto g = std::unique_ptr( @@ -285,7 +285,7 @@ OGRGeometryCollection *GeometryReader::readGeometryCollection() auto parts = m_geometry->parts(); if (parts == nullptr) return CPLErrorInvalidPointer("parts data"); - auto gc = cpl::make_unique(); + auto gc = std::make_unique(); for (uoffset_t i = 0; i < parts->size(); i++) { auto g = std::unique_ptr(readPart(parts->Get(i))); @@ -301,7 +301,7 @@ OGRCompoundCurve *GeometryReader::readCompoundCurve() auto parts = m_geometry->parts(); if (parts == nullptr) return CPLErrorInvalidPointer("parts data"); - auto cc = cpl::make_unique(); + auto cc = std::make_unique(); for (uoffset_t i = 0; i < parts->size(); i++) { auto g = std::unique_ptr(readPart(parts->Get(i))); @@ -322,7 +322,7 @@ OGRCurvePolygon *GeometryReader::readCurvePolygon() auto parts = m_geometry->parts(); if (parts == nullptr) return CPLErrorInvalidPointer("parts data"); - auto cp = cpl::make_unique(); + auto cp = std::make_unique(); for (uoffset_t i = 0; i < parts->size(); i++) { auto g = std::unique_ptr(readPart(parts->Get(i))); @@ -343,7 +343,7 @@ OGRMultiCurve *GeometryReader::readMultiCurve() auto parts = m_geometry->parts(); if (parts == nullptr) return CPLErrorInvalidPointer("parts data"); - auto mc = cpl::make_unique(); + auto mc = std::make_unique(); for (uoffset_t i = 0; i < parts->size(); i++) { auto g = std::unique_ptr(readPart(parts->Get(i))); @@ -359,7 +359,7 @@ OGRMultiSurface *GeometryReader::readMultiSurface() auto parts = m_geometry->parts(); if (parts == nullptr) return CPLErrorInvalidPointer("parts data"); - auto ms = cpl::make_unique(); + auto ms = std::make_unique(); for (uoffset_t i = 0; i < parts->size(); i++) { auto g = std::unique_ptr(readPart(parts->Get(i))); @@ -380,7 +380,7 @@ OGRPolyhedralSurface *GeometryReader::readPolyhedralSurface() auto parts = m_geometry->parts(); if (parts == nullptr) return CPLErrorInvalidPointer("parts data"); - auto ps = cpl::make_unique(); + auto ps = std::make_unique(); for (uoffset_t i = 0; i < parts->size(); i++) { auto g = std::unique_ptr(readPart(parts->Get(i))); @@ -399,7 +399,7 @@ OGRPolyhedralSurface *GeometryReader::readPolyhedralSurface() OGRTriangulatedSurface *GeometryReader::readTIN() { const auto ends = m_geometry->ends(); - auto ts = cpl::make_unique(); + auto ts = std::make_unique(); if (ends == nullptr || ends->size() < 2) { m_length = m_length / 2; diff --git a/ogr/ogrsf_frmts/flatgeobuf/ogrflatgeobuflayer.cpp b/ogr/ogrsf_frmts/flatgeobuf/ogrflatgeobuflayer.cpp index 82f439511ff4..fb4baf43fc92 100644 --- a/ogr/ogrsf_frmts/flatgeobuf/ogrflatgeobuflayer.cpp +++ b/ogr/ogrsf_frmts/flatgeobuf/ogrflatgeobuflayer.cpp @@ -160,7 +160,7 @@ OGRFlatGeobufLayer::OGRFlatGeobufLayer(const Header *poHeader, GByte *headerBuf, SetDescription(m_poFeatureDefn->GetName()); m_poFeatureDefn->SetGeomType(wkbNone); auto poGeomFieldDefn = - cpl::make_unique(nullptr, m_eGType); + std::make_unique(nullptr, m_eGType); if (m_poSRS != nullptr) poGeomFieldDefn->SetSpatialRef(m_poSRS); m_poFeatureDefn->AddGeomFieldDefn(std::move(poGeomFieldDefn)); @@ -940,7 +940,7 @@ OGRFeature *OGRFlatGeobufLayer::GetNextFeature() return nullptr; } - auto poFeature = cpl::make_unique(m_poFeatureDefn); + auto poFeature = std::make_unique(m_poFeatureDefn); if (parseFeature(poFeature.get()) != OGRERR_NONE) { CPLError(CE_Failure, CPLE_AppDefined, diff --git a/ogr/ogrsf_frmts/generic/ogr_gensql.cpp b/ogr/ogrsf_frmts/generic/ogr_gensql.cpp index 8e1e6683b365..ec02356c183b 100644 --- a/ogr/ogrsf_frmts/generic/ogr_gensql.cpp +++ b/ogr/ogrsf_frmts/generic/ogr_gensql.cpp @@ -419,7 +419,7 @@ OGRGenSQLResultsLayer::OGRGenSQLResultsLayer(GDALDataset *poSrcDSIn, } auto poMyGeomFieldDefn = - cpl::make_unique(&oGFDefn); + std::make_unique(&oGFDefn); poMyGeomFieldDefn->bForceGeomType = bForceGeomType; poDefn->AddGeomFieldDefn(std::move(poMyGeomFieldDefn)); } @@ -458,7 +458,7 @@ OGRGenSQLResultsLayer::OGRGenSQLResultsLayer(GDALDataset *poSrcDSIn, panGeomFieldToSrcGeomField[poDefn->GetGeomFieldCount()] = 0; - poDefn->AddGeomFieldDefn(cpl::make_unique( + poDefn->AddGeomFieldDefn(std::make_unique( poSrcDefn->GetGeomFieldDefn(0))); /* Hack while drivers haven't been updated so that */ diff --git a/ogr/ogrsf_frmts/generic/ogrunionlayer.cpp b/ogr/ogrsf_frmts/generic/ogrunionlayer.cpp index 1de468f0e1ff..8e9124dcc6e2 100644 --- a/ogr/ogrsf_frmts/generic/ogrunionlayer.cpp +++ b/ogr/ogrsf_frmts/generic/ogrunionlayer.cpp @@ -260,7 +260,7 @@ OGRFeatureDefn *OGRUnionLayer::GetLayerDefn() for (int i = 0; i < nGeomFields; i++) { poFeatureDefn->AddGeomFieldDefn( - cpl::make_unique( + std::make_unique( papoGeomFields[i])); OGRUnionLayerGeomFieldDefn *poGeomFieldDefn = cpl::down_cast( @@ -317,7 +317,7 @@ OGRFeatureDefn *OGRUnionLayer::GetLayerDefn() { OGRGeomFieldDefn *poFldDefn = poSrcFeatureDefn->GetGeomFieldDefn(i); poFeatureDefn->AddGeomFieldDefn( - cpl::make_unique(poFldDefn)); + std::make_unique(poFldDefn)); } } else if (eFieldStrategy == FIELD_UNION_ALL_LAYERS) @@ -325,7 +325,7 @@ OGRFeatureDefn *OGRUnionLayer::GetLayerDefn() if (nGeomFields == 1) { poFeatureDefn->AddGeomFieldDefn( - cpl::make_unique( + std::make_unique( papoGeomFields[0])); } @@ -362,7 +362,7 @@ OGRFeatureDefn *OGRUnionLayer::GetLayerDefn() if (nIndex < 0) { poFeatureDefn->AddGeomFieldDefn( - cpl::make_unique( + std::make_unique( poSrcFieldDefn)); if (poFeatureDefn->GetGeomFieldCount() == 1 && nGeomFields == 0 && GetSpatialRef() != nullptr) @@ -407,7 +407,7 @@ OGRFeatureDefn *OGRUnionLayer::GetLayerDefn() { OGRGeomFieldDefn *poFldDefn = poSrcFeatureDefn->GetGeomFieldDefn(i); poFeatureDefn->AddGeomFieldDefn( - cpl::make_unique(poFldDefn)); + std::make_unique(poFldDefn)); } /* Remove any field that is not found in the source layers */ diff --git a/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp b/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp index a0c0db2b4758..ceb2dea531eb 100644 --- a/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp +++ b/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp @@ -924,7 +924,7 @@ OGRGeometry *OGRESRIJSONReadPolygon(json_object *poObj) } OGRPolygon *poPoly = new OGRPolygon(); - auto poLine = cpl::make_unique(); + auto poLine = std::make_unique(); papoGeoms[iRing] = poPoly; const auto nPoints = json_object_array_length(poObjRing); diff --git a/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.cpp b/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.cpp index 9608ba6edc06..addad2c9c41a 100644 --- a/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.cpp +++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.cpp @@ -1293,7 +1293,7 @@ void OGRGeoJSONReaderAddOrUpdateField( OGRFieldSubType eSubType; const OGRFieldType eType = GeoJSONPropertyToFieldType(poVal, eSubType, bArrayAsString); - auto poFieldDefn = cpl::make_unique(pszKey, eType); + auto poFieldDefn = std::make_unique(pszKey, eType); poFieldDefn->SetSubType(eSubType); if (eSubType == OFSTBoolean) poFieldDefn->SetWidth(1); @@ -1637,7 +1637,7 @@ void OGRGeoJSONGenerateFeatureDefnDealWithID( eType = OFTInteger64; } apoFieldDefn.emplace_back( - cpl::make_unique("id", eType)); + std::make_unique("id", eType)); const int nIdx = static_cast(apoFieldDefn.size()) - 1; oMapFieldNameToIdx["id"] = nIdx; nPrevFieldIdx = nIdx; diff --git a/ogr/ogrsf_frmts/geojson/ogrgeojsonseqdriver.cpp b/ogr/ogrsf_frmts/geojson/ogrgeojsonseqdriver.cpp index 56d0b0801e50..c027ae33b74a 100644 --- a/ogr/ogrsf_frmts/geojson/ogrgeojsonseqdriver.cpp +++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonseqdriver.cpp @@ -216,7 +216,7 @@ OGRLayer *OGRGeoJSONSeqDataSource::ICreateLayer( m_bIsRSSeparated = CPLTestBool(pszRS); } - m_apoLayers.emplace_back(cpl::make_unique( + m_apoLayers.emplace_back(std::make_unique( this, pszNameIn, papszOptions, std::move(poCT))); return m_apoLayers.back().get(); } diff --git a/ogr/ogrsf_frmts/geojson/ogrtopojsonreader.cpp b/ogr/ogrsf_frmts/geojson/ogrtopojsonreader.cpp index 59ac42131cd7..f3a758aadbce 100644 --- a/ogr/ogrsf_frmts/geojson/ogrtopojsonreader.cpp +++ b/ogr/ogrsf_frmts/geojson/ogrtopojsonreader.cpp @@ -524,7 +524,7 @@ ParseObjectMain(const char *pszId, json_object *poObj, std::set aoSetUndeterminedTypeFieldsLocal; apoFieldDefnLocal.emplace_back( - cpl::make_unique("id", OFTString)); + std::make_unique("id", OFTString)); oMapFieldNameToIdxLocal["id"] = 0; dagLocal.addNode(0, "id"); const int nPrevFieldIdx = 0; @@ -582,7 +582,7 @@ ParseObjectMain(const char *pszId, json_object *poObj, *ppoMainLayer = new OGRGeoJSONLayer( "TopoJSON", nullptr, wkbUnknown, poDS, nullptr); apoFieldDefn.emplace_back( - cpl::make_unique("id", OFTString)); + std::make_unique("id", OFTString)); oMapFieldNameToIdx["id"] = 0; dag.addNode(0, "id"); } diff --git a/ogr/ogrsf_frmts/gpkg/ogrgeopackagedatasource.cpp b/ogr/ogrsf_frmts/gpkg/ogrgeopackagedatasource.cpp index 41d07f26d9bb..5cd9561922f8 100644 --- a/ogr/ogrsf_frmts/gpkg/ogrgeopackagedatasource.cpp +++ b/ogr/ogrsf_frmts/gpkg/ogrgeopackagedatasource.cpp @@ -138,7 +138,7 @@ GetTilingScheme(const char *pszName) "width"); return nullptr; } - auto poTilingScheme = cpl::make_unique(); + auto poTilingScheme = std::make_unique(); poTilingScheme->pszName = pszName; OGRSpatialReference oSRS; @@ -4214,7 +4214,7 @@ char **GDALGeoPackageDataset::GetMetadata(const char *pszDomain) { const int nColors = aosTokens.size() / 4; m_poCTFromMetadata = - cpl::make_unique(); + std::make_unique(); for (int iColor = 0; iColor < nColors; ++iColor) { diff --git a/ogr/ogrsf_frmts/gpkg/ogrgeopackagedriver.cpp b/ogr/ogrsf_frmts/gpkg/ogrgeopackagedriver.cpp index 7d5cab81439e..a61ba94a1ae8 100644 --- a/ogr/ogrsf_frmts/gpkg/ogrgeopackagedriver.cpp +++ b/ogr/ogrsf_frmts/gpkg/ogrgeopackagedriver.cpp @@ -312,7 +312,7 @@ OGRGeoPackageDriverGetSubdatasetInfo(const char *pszFileName) if (STARTS_WITH_CI(pszFileName, "GPKG:")) { std::unique_ptr info = - cpl::make_unique(pszFileName); + std::make_unique(pszFileName); if (!info->GetSubdatasetComponent().empty() && !info->GetPathComponent().empty()) { diff --git a/ogr/ogrsf_frmts/gpkg/ogrgeopackagetablelayer.cpp b/ogr/ogrsf_frmts/gpkg/ogrgeopackagetablelayer.cpp index d8b60123403f..e5b5c0d52813 100644 --- a/ogr/ogrsf_frmts/gpkg/ogrgeopackagetablelayer.cpp +++ b/ogr/ogrsf_frmts/gpkg/ogrgeopackagetablelayer.cpp @@ -7962,7 +7962,7 @@ int OGRGeoPackageTableLayer::GetNextArrowArrayAsynchronous( return 0; } - auto psHelper = cpl::make_unique( + auto psHelper = std::make_unique( m_poDS, m_poFeatureDefn, m_aosArrowArrayStreamOptions, out_array); if (out_array->release == nullptr) { @@ -7972,7 +7972,7 @@ int OGRGeoPackageTableLayer::GetNextArrowArrayAsynchronous( if (m_poFillArrowArray == nullptr) { m_poFillArrowArray = - cpl::make_unique(); + std::make_unique(); m_poFillArrowArray->psHelper = std::move(psHelper); m_poFillArrowArray->nCountRows = 0; m_poFillArrowArray->bErrorOccurred = false; @@ -8386,11 +8386,11 @@ int OGRGeoPackageTableLayer::GetNextArrowArray(struct ArrowArrayStream *stream, oOpenInfo.nOpenFlags = GDAL_OF_VECTOR; for (int iTask = 0; iTask < nMaxTasks; ++iTask) { - auto task = cpl::make_unique(); + auto task = std::make_unique(); task->m_iStartShapeId = m_iNextShapeId + static_cast(iTask + 1) * nMaxBatchSize; - task->m_poDS = cpl::make_unique(); + task->m_poDS = std::make_unique(); if (!task->m_poDS->Open(&oOpenInfo, m_poDS->m_osFilenameInZip)) { break; @@ -8412,7 +8412,7 @@ int OGRGeoPackageTableLayer::GetNextArrowArray(struct ArrowArrayStream *stream, } task->m_poLayer = poOtherLayer; - task->m_psArrowArray = cpl::make_unique(); + task->m_psArrowArray = std::make_unique(); memset(task->m_psArrowArray.get(), 0, sizeof(struct ArrowArray)); poOtherLayer->m_nTotalFeatureCount = m_nTotalFeatureCount; @@ -8499,7 +8499,7 @@ int OGRGeoPackageTableLayer::GetNextArrowArrayInternal( return 0; } - auto psHelper = cpl::make_unique( + auto psHelper = std::make_unique( m_poDS, m_poFeatureDefn, m_aosArrowArrayStreamOptions, out_array); if (out_array->release == nullptr) { diff --git a/ogr/ogrsf_frmts/gtfs/ogrgtfsdriver.cpp b/ogr/ogrsf_frmts/gtfs/ogrgtfsdriver.cpp index 4299287a5ac3..848d3eb503ce 100644 --- a/ogr/ogrsf_frmts/gtfs/ogrgtfsdriver.cpp +++ b/ogr/ogrsf_frmts/gtfs/ogrgtfsdriver.cpp @@ -282,7 +282,7 @@ OGRFeature *OGRGTFSLayer::GetNextFeature() if (poSrcFeature == nullptr) return nullptr; - auto poFeature = cpl::make_unique(m_poFeatureDefn); + auto poFeature = std::make_unique(m_poFeatureDefn); const int nFieldCount = poSrcFeature->GetFieldCount(); poFeature->SetFID(poSrcFeature->GetFID()); auto poSrcLayerDefn = m_poUnderlyingLayer->GetLayerDefn(); @@ -482,7 +482,7 @@ void OGRGTFSShapesGeomLayer::Prepare() { const auto &osShapeId = kv.first; const auto &oMapPoints = kv.second; - auto poFeature = cpl::make_unique(m_poFeatureDefn); + auto poFeature = std::make_unique(m_poFeatureDefn); poFeature->SetField(0, osShapeId.c_str()); OGRLineString *poLS = new OGRLineString(); for (const auto &kv2 : oMapPoints) @@ -629,7 +629,7 @@ GDALDataset *OGRGTFSDataset::Open(GDALOpenInfo *poOpenInfo) const std::string osCSVBaseDirPrefix(std::string("CSV:") + osBaseDir); - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); char **papszFilenames = VSIReadDir(osBaseDir.c_str()); size_t nCountFound = 0; @@ -662,7 +662,7 @@ GDALDataset *OGRGTFSDataset::Open(GDALOpenInfo *poOpenInfo) if (poSrcLayerDefn->GetFieldIndex("field_1") < 0) { poDS->m_apoLayers.emplace_back( - cpl::make_unique( + std::make_unique( osCSVBaseDirPrefix, CPLGetBasename(*papszIter), std::move(poCSVDataset))); } @@ -689,7 +689,7 @@ GDALDataset *OGRGTFSDataset::Open(GDALOpenInfo *poOpenInfo) if (poUnderlyingLayer) { poDS->m_apoLayers.emplace_back( - cpl::make_unique( + std::make_unique( std::move(poCSVDataset))); } } diff --git a/ogr/ogrsf_frmts/hana/ogrhanadatasource.cpp b/ogr/ogrsf_frmts/hana/ogrhanadatasource.cpp index 1d83b4310669..61b058e3f293 100644 --- a/ogr/ogrsf_frmts/hana/ogrhanadatasource.cpp +++ b/ogr/ogrsf_frmts/hana/ogrhanadatasource.cpp @@ -1322,7 +1322,7 @@ void OGRHanaDataSource::InitializeLayers(const char *schemaName, if (pos != tablesToFind.end()) tablesToFind.erase(pos); - auto layer = cpl::make_unique( + auto layer = std::make_unique( this, schemaName_.c_str(), tableName->c_str(), updatable); layers_.push_back(std::move(layer)); } @@ -1789,7 +1789,7 @@ OGRLayer *OGRHanaDataSource::ICreateLayer(const char *layerNameIn, } // Create new layer object - auto layer = cpl::make_unique(this, schemaName_.c_str(), + auto layer = std::make_unique(this, schemaName_.c_str(), layerName.c_str(), true); if (geomType != wkbNone && layer->GetLayerDefn()->GetGeomFieldCount() > 0) layer->GetLayerDefn()->GetGeomFieldDefn(0)->SetNullable(FALSE); @@ -1858,7 +1858,7 @@ OGRLayer *OGRHanaDataSource::ExecuteSQL(const char *sqlCommand, if (stmt.isNull()) return nullptr; - auto layer = cpl::make_unique(this, sqlCommand); + auto layer = std::make_unique(this, sqlCommand); if (spatialFilter != nullptr) layer->SetSpatialFilter(spatialFilter); return layer.release(); diff --git a/ogr/ogrsf_frmts/hana/ogrhanadriver.cpp b/ogr/ogrsf_frmts/hana/ogrhanadriver.cpp index 0b8988da1502..d98c61c9cb8c 100644 --- a/ogr/ogrsf_frmts/hana/ogrhanadriver.cpp +++ b/ogr/ogrsf_frmts/hana/ogrhanadriver.cpp @@ -50,7 +50,7 @@ static GDALDataset *OGRHanaDriverOpen(GDALOpenInfo *openInfo) if (!OGRHanaDriverIdentify(openInfo)) return nullptr; - auto ds = cpl::make_unique(); + auto ds = std::make_unique(); if (!ds->Open(openInfo->pszFilename, openInfo->papszOpenOptions, openInfo->eAccess == GA_Update)) return nullptr; @@ -67,7 +67,7 @@ static GDALDataset *OGRHanaDriverCreate(const char *name, CPL_UNUSED int nBands, CPL_UNUSED GDALDataType eDT, CPL_UNUSED char **options) { - auto ds = cpl::make_unique(); + auto ds = std::make_unique(); if (!ds->Open(name, options, TRUE)) { CPLError(CE_Failure, CPLE_AppDefined, @@ -91,7 +91,7 @@ void RegisterOGRHANA() if (GDALGetDriverByName("HANA") != nullptr) return; - auto driver = cpl::make_unique(); + auto driver = std::make_unique(); driver->SetDescription("HANA"); driver->SetMetadataItem(GDAL_DMD_LONGNAME, "SAP HANA"); driver->SetMetadataItem(GDAL_DCAP_VECTOR, "YES"); diff --git a/ogr/ogrsf_frmts/hana/ogrhanalayer.cpp b/ogr/ogrsf_frmts/hana/ogrhanalayer.cpp index 6f9d0af46359..04d2422f6356 100644 --- a/ogr/ogrsf_frmts/hana/ogrhanalayer.cpp +++ b/ogr/ogrsf_frmts/hana/ogrhanalayer.cpp @@ -183,7 +183,7 @@ CreateFieldDefn(const AttributeColumnDescription &columnDesc) columnDesc.typeName.c_str(), columnDesc.name.c_str()); auto field = - cpl::make_unique(columnDesc.name.c_str(), ogrFieldType); + std::make_unique(columnDesc.name.c_str(), ogrFieldType); field->SetSubType(ogrFieldSubType); field->SetNullable(columnDesc.isNullable); if (!columnDesc.isArray) @@ -417,7 +417,7 @@ OGRFeature *OGRHanaLayer::ReadFeature() if (!resultSet_->next()) return nullptr; - auto feature = cpl::make_unique(featureDefn_); + auto feature = std::make_unique(featureDefn_); feature->SetFID(nextFeatureId_++); unsigned short paramIndex = 0; @@ -717,7 +717,7 @@ OGRErr OGRHanaLayer::InitFeatureDefinition(const CPLString &schemaName, const GeometryColumnDescription &geometryColumnDesc = clmDesc.geometryDescription; - auto geomFieldDefn = cpl::make_unique( + auto geomFieldDefn = std::make_unique( geometryColumnDesc.name.c_str(), geometryColumnDesc.type); geomFieldDefn->SetNullable(geometryColumnDesc.isNullable); diff --git a/ogr/ogrsf_frmts/hana/ogrhanatablelayer.cpp b/ogr/ogrsf_frmts/hana/ogrhanatablelayer.cpp index 7fc8f9d3c7b2..b6773ec45d95 100644 --- a/ogr/ogrsf_frmts/hana/ogrhanatablelayer.cpp +++ b/ogr/ogrsf_frmts/hana/ogrhanatablelayer.cpp @@ -1612,7 +1612,7 @@ OGRErr OGRHanaTableLayer::CreateGeomField(OGRGeomFieldDefn *geomField, int) return OGRERR_FAILURE; } - auto newGeomField = cpl::make_unique( + auto newGeomField = std::make_unique( clmName.c_str(), geomField->GetType()); newGeomField->SetNullable(geomField->IsNullable()); newGeomField->SetSpatialRef(geomField->GetSpatialRef()); diff --git a/ogr/ogrsf_frmts/jsonfg/ogrjsonfgdataset.cpp b/ogr/ogrsf_frmts/jsonfg/ogrjsonfgdataset.cpp index 79729f020512..023d280624b5 100644 --- a/ogr/ogrsf_frmts/jsonfg/ogrjsonfgdataset.cpp +++ b/ogr/ogrsf_frmts/jsonfg/ogrjsonfgdataset.cpp @@ -188,7 +188,7 @@ bool OGRJSONFGDataset::Open(GDALOpenInfo *poOpenInfo, if (nSrcType == eGeoJSONSourceFile) { - auto poReader = cpl::make_unique(); + auto poReader = std::make_unique(); SetReaderOptions(*(poReader.get())); // Try to use a streaming parser if the content of the file seems @@ -223,7 +223,7 @@ bool OGRJSONFGDataset::Open(GDALOpenInfo *poOpenInfo, auto poLayer = cpl::down_cast( apoLayers_[0].get()); poLayer->SetFile(std::move(fp)); - auto poParser = cpl::make_unique( + auto poParser = std::make_unique( *(poReader.get()), false); poLayer->SetStreamingParser(std::move(poParser)); } @@ -243,7 +243,7 @@ bool OGRJSONFGDataset::Open(GDALOpenInfo *poOpenInfo, } poLayer->SetFile(std::move(fpNew)); - auto poParser = cpl::make_unique( + auto poParser = std::make_unique( *(poReader.get()), false); poLayer->SetStreamingParser(std::move(poParser)); } @@ -633,7 +633,7 @@ OGRLayer *OGRJSONFGDataset::ICreateLayer(const char *pszNameIn, "ellipsoid"); } - auto poLayer = cpl::make_unique( + auto poLayer = std::make_unique( pszNameIn, poSRS, std::move(poCTToWGS84), osCoordRefSys, eGType, papszOptions, this); apoLayers_.emplace_back(std::move(poLayer)); diff --git a/ogr/ogrsf_frmts/jsonfg/ogrjsonfgdriver.cpp b/ogr/ogrsf_frmts/jsonfg/ogrjsonfgdriver.cpp index ad00f519998b..73d517d386a1 100644 --- a/ogr/ogrsf_frmts/jsonfg/ogrjsonfgdriver.cpp +++ b/ogr/ogrsf_frmts/jsonfg/ogrjsonfgdriver.cpp @@ -58,7 +58,7 @@ static GDALDataset *OGRJSONFGDriverOpen(GDALOpenInfo *poOpenInfo) GeoJSONSourceType nSrcType = JSONFGDriverGetSourceType(poOpenInfo); if (nSrcType == eGeoJSONSourceUnknown) return nullptr; - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); if (!poDS->Open(poOpenInfo, nSrcType)) return nullptr; return poDS.release(); @@ -73,7 +73,7 @@ static GDALDataset *OGRJSONFGDriverCreate(const char *pszName, int /* nBands */, GDALDataType /* eDT */, char **papszOptions) { - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); if (!poDS->Create(pszName, papszOptions)) { return nullptr; diff --git a/ogr/ogrsf_frmts/jsonfg/ogrjsonfgreader.cpp b/ogr/ogrsf_frmts/jsonfg/ogrjsonfgreader.cpp index 1da0fba7561d..21cd41a125ab 100644 --- a/ogr/ogrsf_frmts/jsonfg/ogrjsonfgreader.cpp +++ b/ogr/ogrsf_frmts/jsonfg/ogrjsonfgreader.cpp @@ -129,7 +129,7 @@ OGRJSONFGReadCoordRefSys(json_object *poCoordRefSys, bool bCanRecurse = true) osURL += "/0/"; osURL.append(pszColon + 1, (pszStr + strlen(pszStr) - 1) - (pszColon + 1)); - auto poSRS = cpl::make_unique(); + auto poSRS = std::make_unique(); if (poSRS->importFromCRSURL(osURL.c_str()) != OGRERR_NONE) { return nullptr; @@ -139,7 +139,7 @@ OGRJSONFGReadCoordRefSys(json_object *poCoordRefSys, bool bCanRecurse = true) else if (STARTS_WITH(pszStr, "http://www.opengis.net/def/crs/")) { // OGC URI, e.g. "http://www.opengis.net/def/crs/EPSG/0/4326" - auto poSRS = cpl::make_unique(); + auto poSRS = std::make_unique(); if (poSRS->importFromCRSURL(pszStr) != OGRERR_NONE) { return nullptr; @@ -232,7 +232,7 @@ OGRJSONFGReadCoordRefSys(json_object *poCoordRefSys, bool bCanRecurse = true) /* bCanRecurse = */ false); if (!poSRS2) return nullptr; - auto poSRS = cpl::make_unique(); + auto poSRS = std::make_unique(); std::string osName; const char *pszName1 = poSRS1->GetName(); @@ -476,13 +476,13 @@ void OGRJSONFGReader::FinalizeBuildContext(LayerDefnBuildContext &oBuildContext, OGRLayer *poLayer; if (bStreamedLayer) { - poStreamedLayer = cpl::make_unique( + poStreamedLayer = std::make_unique( pszLayerName, poSRSLayer, oBuildContext.eLayerGeomType); poLayer = poStreamedLayer.get(); } else { - poMemLayer = cpl::make_unique( + poMemLayer = std::make_unique( pszLayerName, poSRSLayer, oBuildContext.eLayerGeomType); poLayer = poMemLayer.get(); } @@ -664,7 +664,7 @@ OGRJSONFGCreateNonGeoJSONGeometry(json_object *poObj, bool bWarn) return nullptr; } auto poJOuterShell = json_object_array_get_idx(poCoordinates, 0); - auto poGeom = cpl::make_unique(); + auto poGeom = std::make_unique(); const auto nPolys = json_object_array_length(poJOuterShell); for (auto i = decltype(nPolys){0}; i < nPolys; ++i) { @@ -702,7 +702,7 @@ OGRJSONFGCreateNonGeoJSONGeometry(json_object *poObj, bool bWarn) if (poBaseGeom->getGeometryType() == wkbPoint) { const auto poPoint = poBaseGeom.get()->toPoint(); - auto poGeom = cpl::make_unique(); + auto poGeom = std::make_unique(); poGeom->addPoint(poPoint->getX(), poPoint->getY(), dfLower); poGeom->addPoint(poPoint->getX(), poPoint->getY(), dfUpper); return poGeom; @@ -710,7 +710,7 @@ OGRJSONFGCreateNonGeoJSONGeometry(json_object *poObj, bool bWarn) else if (poBaseGeom->getGeometryType() == wkbLineString) { const auto poLS = poBaseGeom.get()->toLineString(); - auto poGeom = cpl::make_unique(); + auto poGeom = std::make_unique(); for (int i = 0; i < poLS->getNumPoints() - 1; ++i) { auto poPoly = new OGRPolygon(); @@ -743,7 +743,7 @@ OGRJSONFGCreateNonGeoJSONGeometry(json_object *poObj, bool bWarn) { return nullptr; } - auto poGeom = cpl::make_unique(); + auto poGeom = std::make_unique(); // Build lower face { auto poPoly = new OGRPolygon(); @@ -1029,7 +1029,7 @@ OGRJSONFGReader::ReadFeature(json_object *poObj, const char *pszRequestedLayer, *pOutStreamedLayer = oBuildContext.poStreamedLayer; OGRFeatureDefn *poFDefn = poLayer->GetLayerDefn(); - auto poFeature = cpl::make_unique(poFDefn); + auto poFeature = std::make_unique(poFDefn); /* -------------------------------------------------------------------- */ /* Translate GeoJSON "properties" object to feature attributes. */ diff --git a/ogr/ogrsf_frmts/jsonfg/ogrjsonfgstreamingparser.cpp b/ogr/ogrsf_frmts/jsonfg/ogrjsonfgstreamingparser.cpp index bdeea0a1cf60..8b145fb2a525 100644 --- a/ogr/ogrsf_frmts/jsonfg/ogrjsonfgstreamingparser.cpp +++ b/ogr/ogrsf_frmts/jsonfg/ogrjsonfgstreamingparser.cpp @@ -64,7 +64,7 @@ OGRJSONFGStreamingParser::~OGRJSONFGStreamingParser() = default; std::unique_ptr OGRJSONFGStreamingParser::Clone() { auto poRet = - cpl::make_unique(m_oReader, IsFirstPass()); + std::make_unique(m_oReader, IsFirstPass()); poRet->m_osRequestedLayer = m_osRequestedLayer; return poRet; } diff --git a/ogr/ogrsf_frmts/lvbag/ogrlvbagdriver.cpp b/ogr/ogrsf_frmts/lvbag/ogrlvbagdriver.cpp index ec20d0592ccd..b6e3b5a094de 100644 --- a/ogr/ogrsf_frmts/lvbag/ogrlvbagdriver.cpp +++ b/ogr/ogrsf_frmts/lvbag/ogrlvbagdriver.cpp @@ -146,7 +146,7 @@ void RegisterOGRLVBAG() if (GDALGetDriverByName("LVBAG") != nullptr) return; - auto poDriver = cpl::make_unique(); + auto poDriver = std::make_unique(); poDriver->SetDescription("LVBAG"); poDriver->SetMetadataItem(GDAL_DCAP_VECTOR, "YES"); diff --git a/ogr/ogrsf_frmts/lvbag/ogrlvbaglayer.cpp b/ogr/ogrsf_frmts/lvbag/ogrlvbaglayer.cpp index ec3127472896..3b89486ca4fe 100644 --- a/ogr/ogrsf_frmts/lvbag/ogrlvbaglayer.cpp +++ b/ogr/ogrsf_frmts/lvbag/ogrlvbaglayer.cpp @@ -683,7 +683,7 @@ void OGRLVBAGLayer::EndElementCbk(const char *pszName) case wkbPolygon: case wkbMultiPolygon: { - auto poPoint = cpl::make_unique(); + auto poPoint = std::make_unique(); #ifdef HAVE_GEOS if (poGeom->Centroid(poPoint.get()) == OGRERR_NONE) poGeom.reset(poPoint.release()); @@ -703,7 +703,7 @@ void OGRLVBAGLayer::EndElementCbk(const char *pszName) else if (poGeomField->GetType() == wkbMultiPolygon && poGeom->getGeometryType() == wkbPolygon) { - auto poMultiPolygon = cpl::make_unique(); + auto poMultiPolygon = std::make_unique(); poMultiPolygon->addGeometry(poGeom.get()); poGeom.reset(poMultiPolygon.release()); } @@ -715,7 +715,7 @@ void OGRLVBAGLayer::EndElementCbk(const char *pszName) ->getGeometryRef(0) ->getGeometryType() == wkbPolygon) { - auto poMultiPolygon = cpl::make_unique(); + auto poMultiPolygon = std::make_unique(); for (const auto &poChildGeom : poGeom->toGeometryCollection()) poMultiPolygon->addGeometry(poChildGeom); diff --git a/ogr/ogrsf_frmts/mitab/mitab_feature.cpp b/ogr/ogrsf_frmts/mitab/mitab_feature.cpp index 3ee39b0dcdeb..078048ecd294 100644 --- a/ogr/ogrsf_frmts/mitab/mitab_feature.cpp +++ b/ogr/ogrsf_frmts/mitab/mitab_feature.cpp @@ -6390,7 +6390,7 @@ const char *TABText::GetStyleString() const void TABText::SetLabelFromStyleString(const char *pszStyleString) { // Use the Style Manager to retrieve all the information we need. - auto poStyleMgr = cpl::make_unique(nullptr); + auto poStyleMgr = std::make_unique(nullptr); std::unique_ptr poStylePart; // Init the StyleMgr with the StyleString. diff --git a/ogr/ogrsf_frmts/mitab/mitab_feature_mif.cpp b/ogr/ogrsf_frmts/mitab/mitab_feature_mif.cpp index 49374ca32e4b..8955b427ef6c 100644 --- a/ogr/ogrsf_frmts/mitab/mitab_feature_mif.cpp +++ b/ogr/ogrsf_frmts/mitab/mitab_feature_mif.cpp @@ -1017,7 +1017,7 @@ int TABRegion::ReadGeometryFromMIFFile(MIDDATAFile *fp) return -1; } - auto poRing = cpl::make_unique(); + auto poRing = std::make_unique(); const int MAX_INITIAL_POINTS = 100000; const int nInitialNumPoints = (numSectionVertices < MAX_INITIAL_POINTS) diff --git a/ogr/ogrsf_frmts/mitab/mitab_mapfile.cpp b/ogr/ogrsf_frmts/mitab/mitab_mapfile.cpp index 17d51ed4ad25..1773ad7e7c51 100644 --- a/ogr/ogrsf_frmts/mitab/mitab_mapfile.cpp +++ b/ogr/ogrsf_frmts/mitab/mitab_mapfile.cpp @@ -2007,7 +2007,7 @@ TABMAPObjectBlock *TABMAPFile::SplitObjBlock(TABMAPObjHdr *poObjHdrToAdd, /*----------------------------------------------------------------- * Create new obj and coord block *----------------------------------------------------------------*/ - auto poNewObjBlock = cpl::make_unique(m_eAccessMode); + auto poNewObjBlock = std::make_unique(m_eAccessMode); poNewObjBlock->InitNewBlock(m_fp, m_poHeader->m_nRegularBlockSize, m_oBlockManager.AllocNewBlock("OBJECT")); diff --git a/ogr/ogrsf_frmts/mongodbv3/ogrmongodbv3driver.cpp b/ogr/ogrsf_frmts/mongodbv3/ogrmongodbv3driver.cpp index 8471950b96fc..6031d6d0fb7f 100644 --- a/ogr/ogrsf_frmts/mongodbv3/ogrmongodbv3driver.cpp +++ b/ogr/ogrsf_frmts/mongodbv3/ogrmongodbv3driver.cpp @@ -1242,7 +1242,7 @@ static void OGRMongoDBV3ReaderSetField(OGRFeature *poFeature, std::unique_ptr OGRMongoDBv3Layer::Translate(const bsoncxx::document::view &doc) { - auto poFeature = cpl::make_unique(m_poFeatureDefn); + auto poFeature = std::make_unique(m_poFeatureDefn); for (auto &&field : doc) { std::string fieldName(field.key()); diff --git a/ogr/ogrsf_frmts/mssqlspatial/ogrmssqlspatialtablelayer.cpp b/ogr/ogrsf_frmts/mssqlspatial/ogrmssqlspatialtablelayer.cpp index f765b04983ed..bc31fa669825 100644 --- a/ogr/ogrsf_frmts/mssqlspatial/ogrmssqlspatialtablelayer.cpp +++ b/ogr/ogrsf_frmts/mssqlspatial/ogrmssqlspatialtablelayer.cpp @@ -711,7 +711,7 @@ OGRErr OGRMSSQLSpatialTableLayer::GetExtent(int iGeomField, { // Prepare statement auto poStatement = - cpl::make_unique(poDS->GetSession()); + std::make_unique(poDS->GetSession()); if (poDS->sMSSQLVersion.nMajor >= 11) { diff --git a/ogr/ogrsf_frmts/mvt/ogrmvtdataset.cpp b/ogr/ogrsf_frmts/mvt/ogrmvtdataset.cpp index 0c42c60e675f..daad02600b2a 100644 --- a/ogr/ogrsf_frmts/mvt/ogrmvtdataset.cpp +++ b/ogr/ogrsf_frmts/mvt/ogrmvtdataset.cpp @@ -3739,7 +3739,7 @@ bool OGRMVTWriterDataset::EncodeRepairedOuterRing( const int nLastYOri = nLastY; GUInt32 nLineToCount = 0; const int nPoints = poRing->getNumPoints() - 1; - auto poOutLinearRing = cpl::make_unique(); + auto poOutLinearRing = std::make_unique(); poOutLinearRing->setNumPoints(nPoints); for (int i = 0; i < nPoints; i++) { @@ -3824,7 +3824,7 @@ bool OGRMVTWriterDataset::EncodePolygon(MVTTileLayerFeature *poGPBFeature, #endif dfArea = 0; - auto poOutOuterRing = cpl::make_unique(); + auto poOutOuterRing = std::make_unique(); for (int i = 0; i < 1 + poPoly->getNumInteriorRings(); i++) { const OGRLinearRing *poRing = (i == 0) ? poPoly->getExteriorRing() @@ -3850,7 +3850,7 @@ bool OGRMVTWriterDataset::EncodePolygon(MVTTileLayerFeature *poGPBFeature, const GUInt32 nMinLineTo = 2; std::unique_ptr poOutInnerRing; if (i > 0) - poOutInnerRing = cpl::make_unique(); + poOutInnerRing = std::make_unique(); OGRLinearRing *poOutRing = poOutInnerRing.get() ? poOutInnerRing.get() : poOutOuterRing.get(); @@ -4301,7 +4301,7 @@ OGRErr OGRMVTWriterDataset::PreGenerateForTileReal( { const OGRPolygon *poPoly = poSubGeom->toPolygon(); double dfPartArea = 0.0; - auto poOutPoly = cpl::make_unique(); + auto poOutPoly = std::make_unique(); bGeomOK |= EncodePolygon(poGPBFeature.get(), poPoly, poOutPoly.get(), dfTopX, dfTopY, dfTileDim, bCanRecurse, nLastX, diff --git a/ogr/ogrsf_frmts/mysql/ogrmysqlresultlayer.cpp b/ogr/ogrsf_frmts/mysql/ogrmysqlresultlayer.cpp index eee85546b9fc..f10480ca58c3 100644 --- a/ogr/ogrsf_frmts/mysql/ogrmysqlresultlayer.cpp +++ b/ogr/ogrsf_frmts/mysql/ogrmysqlresultlayer.cpp @@ -225,7 +225,7 @@ OGRFeatureDefn *OGRMySQLResultLayer::ReadResultDefinition() char **papszRow; auto poGeomFieldDefn = - cpl::make_unique(poDS, pszGeomColumn); + std::make_unique(poDS, pszGeomColumn); if (poDS->GetMajorVersion() < 8 || poDS->IsMariaDB()) { diff --git a/ogr/ogrsf_frmts/mysql/ogrmysqltablelayer.cpp b/ogr/ogrsf_frmts/mysql/ogrmysqltablelayer.cpp index 816b77097cb0..219753014f9e 100644 --- a/ogr/ogrsf_frmts/mysql/ogrmysqltablelayer.cpp +++ b/ogr/ogrsf_frmts/mysql/ogrmysqltablelayer.cpp @@ -374,7 +374,7 @@ OGRFeatureDefn *OGRMySQLTableLayer::ReadTableDefinition(const char *pszTable) char *pszType = nullptr; auto poGeomFieldDefn = - cpl::make_unique(poDS, pszGeomColumn); + std::make_unique(poDS, pszGeomColumn); if (poDS->GetMajorVersion() < 8 || poDS->IsMariaDB()) osCommand.Printf("SELECT type, coord_dimension FROM " diff --git a/ogr/ogrsf_frmts/openfilegdb/filegdbindex_write.cpp b/ogr/ogrsf_frmts/openfilegdb/filegdbindex_write.cpp index 1725ecac3ab9..759c725bb85a 100644 --- a/ogr/ogrsf_frmts/openfilegdb/filegdbindex_write.cpp +++ b/ogr/ogrsf_frmts/openfilegdb/filegdbindex_write.cpp @@ -207,7 +207,7 @@ bool FileGDBTable::CreateIndex(const std::string &osIndexName, m_bDirtyGdbIndexesFile = true; - auto poIndex = cpl::make_unique(); + auto poIndex = std::make_unique(); poIndex->m_osIndexName = osIndexName; poIndex->m_osExpression = osExpression; diff --git a/ogr/ogrsf_frmts/openfilegdb/filegdbtable.cpp b/ogr/ogrsf_frmts/openfilegdb/filegdbtable.cpp index 2eef74ee444d..baec21f81111 100644 --- a/ogr/ogrsf_frmts/openfilegdb/filegdbtable.cpp +++ b/ogr/ogrsf_frmts/openfilegdb/filegdbtable.cpp @@ -1009,7 +1009,7 @@ bool FileGDBTable::Open(const char *pszFilename, bool bUpdate, m_iObjectIdField = static_cast(m_apoFields.size()); } - auto poField = cpl::make_unique(this); + auto poField = std::make_unique(this); poField->m_osName = osName; poField->m_osAlias = osAlias; poField->m_eType = eType; @@ -2113,7 +2113,7 @@ int FileGDBTable::GetIndexCount() if (VSIStatExL(osAtxFilename.c_str(), &sStat, VSI_STAT_EXISTS_FLAG) == 0) { - auto poIndex = cpl::make_unique(); + auto poIndex = std::make_unique(); poIndex->m_osIndexName = "blk_key_index"; poIndex->m_osExpression = "block_key"; m_apoFields[iBlockKeyFieldIdx]->m_poIndex = poIndex.get(); @@ -2164,7 +2164,7 @@ int FileGDBTable::GetIndexCount() // Skip magic field pabyCur += 2; - auto poIndex = cpl::make_unique(); + auto poIndex = std::make_unique(); poIndex->m_osIndexName = osIndexName; poIndex->m_osExpression = osExpression; diff --git a/ogr/ogrsf_frmts/openfilegdb/filegdbtable_write_fields.cpp b/ogr/ogrsf_frmts/openfilegdb/filegdbtable_write_fields.cpp index b2889ba6e9f2..836de55fe1b9 100644 --- a/ogr/ogrsf_frmts/openfilegdb/filegdbtable_write_fields.cpp +++ b/ogr/ogrsf_frmts/openfilegdb/filegdbtable_write_fields.cpp @@ -872,7 +872,7 @@ bool FileGDBTable::AlterField(int iField, const std::string &osName, GetIndexCount(); auto poIndex = m_apoFields[iField]->m_poIndex; - m_apoFields[iField] = cpl::make_unique( + m_apoFields[iField] = std::make_unique( osName, osAlias, eType, bNullable, nMaxWidth, sDefault); m_apoFields[iField]->SetParent(this); m_apoFields[iField]->m_poIndex = poIndex; diff --git a/ogr/ogrsf_frmts/openfilegdb/gdalopenfilegdbrasterband.cpp b/ogr/ogrsf_frmts/openfilegdb/gdalopenfilegdbrasterband.cpp index 15c1bd73c046..2eca7548a67d 100644 --- a/ogr/ogrsf_frmts/openfilegdb/gdalopenfilegdbrasterband.cpp +++ b/ogr/ogrsf_frmts/openfilegdb/gdalopenfilegdbrasterband.cpp @@ -694,13 +694,13 @@ bool OGROpenFileGDBDataSource::OpenRaster(const GDALOpenInfo *poOpenInfo, } else { - poMaskBand = cpl::make_unique( + poMaskBand = std::make_unique( this, 1, GDT_Byte, 8, nBlockWidth, nBlockHeight, 0, true); } } else if (EQUAL(pszNoDataOrMask, "MASK")) { - poMaskBand = cpl::make_unique( + poMaskBand = std::make_unique( this, 1, GDT_Byte, 8, nBlockWidth, nBlockHeight, 0, true); } else if (!EQUAL(pszNoDataOrMask, "NONE")) @@ -792,7 +792,7 @@ bool OGROpenFileGDBDataSource::OpenRaster(const GDALOpenInfo *poOpenInfo, // Create overview bands for (int iOvr = 0; iOvr < nOverviewCount; ++iOvr) { - auto poOvrBand = cpl::make_unique( + auto poOvrBand = std::make_unique( this, iBand, eDT, nBitWidth, nBlockWidth, nBlockHeight, iOvr + 1, false); if (poBand->m_bHasNoData) @@ -821,7 +821,7 @@ bool OGROpenFileGDBDataSource::OpenRaster(const GDALOpenInfo *poOpenInfo, { // Make the mask band owned by the first raster band poOvrBand->m_poMaskBandOwned = - cpl::make_unique( + std::make_unique( this, 1, GDT_Byte, 8, nBlockWidth, nBlockHeight, iOvr + 1, true); poMaskBandRef = poOvrBand->m_poMaskBandOwned.get(); @@ -1944,14 +1944,14 @@ GDALRasterAttributeTable *GDALOpenFileGDBRasterBand::GetDefaultRAT() const std::string osVATTableName( std::string("VAT_").append(poGDS->m_osRasterLayerName)); // Instantiate a new dataset, os that the RAT is standalone - auto poDSNew = cpl::make_unique(); + auto poDSNew = std::make_unique(); GDALOpenInfo oOpenInfo(poGDS->m_osDirName.c_str(), GA_ReadOnly); if (!poDSNew->Open(&oOpenInfo)) return nullptr; auto poVatLayer = poDSNew->BuildLayerFromName(osVATTableName.c_str()); if (!poVatLayer) return nullptr; - m_poRAT = cpl::make_unique( + m_poRAT = std::make_unique( std::move(poDSNew), osVATTableName, std::move(poVatLayer)); return m_poRAT.get(); } diff --git a/ogr/ogrsf_frmts/openfilegdb/ogr_openfilegdb.h b/ogr/ogrsf_frmts/openfilegdb/ogr_openfilegdb.h index fd3a45ed588e..bf8f39ce12e7 100644 --- a/ogr/ogrsf_frmts/openfilegdb/ogr_openfilegdb.h +++ b/ogr/ogrsf_frmts/openfilegdb/ogr_openfilegdb.h @@ -715,7 +715,7 @@ class GDALOpenFileGDBRasterAttributeTable final GDALRasterAttributeTable *Clone() const override { - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); GDALOpenInfo oOpenInfo(m_poDS->m_osDirName.c_str(), GA_ReadOnly); if (!poDS->Open(&oOpenInfo)) return nullptr; diff --git a/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdatasource.cpp b/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdatasource.cpp index 8ddbfd3fea4e..8f3437bce6be 100644 --- a/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdatasource.cpp +++ b/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdatasource.cpp @@ -289,7 +289,7 @@ bool OGROpenFileGDBDataSource::Open(const GDALOpenInfo *poOpenInfo) if (nInterestTable > 0 && FileExists(poOpenInfo->pszFilename)) { const char *pszLyrName = CPLSPrintf("a%08x", nInterestTable); - auto poLayer = cpl::make_unique( + auto poLayer = std::make_unique( this, poOpenInfo->pszFilename, pszLyrName, "", "", eAccess == GA_Update); const char *pszTablX = @@ -430,7 +430,7 @@ bool OGROpenFileGDBDataSource::Open(const GDALOpenInfo *poOpenInfo) pszLyrName = aosTableNames[nInterestTable - 1].c_str(); else pszLyrName = CPLSPrintf("a%08x", nInterestTable); - m_apoLayers.push_back(cpl::make_unique( + m_apoLayers.push_back(std::make_unique( this, poOpenInfo->pszFilename, pszLyrName, "", "", eAccess == GA_Update)); } @@ -463,7 +463,7 @@ bool OGROpenFileGDBDataSource::Open(const GDALOpenInfo *poOpenInfo) FileExists(osFilename)) { m_apoLayers.emplace_back( - cpl::make_unique( + std::make_unique( this, osFilename, oIter.first.c_str(), "", "", eAccess == GA_Update)); if (m_poRootGroup) @@ -566,7 +566,7 @@ OGRLayer *OGROpenFileGDBDataSource::AddLayer( } } - m_apoLayers.emplace_back(cpl::make_unique( + m_apoLayers.emplace_back(std::make_unique( this, osFilename, osName, osDefinition, osDocumentation, eAccess == GA_Update, eGeomType, osParentDefinition)); return m_apoLayers.back().get(); @@ -937,7 +937,7 @@ int OGROpenFileGDBDataSource::OpenFileGDBv9( const GDALOpenInfo *poOpenInfo, const std::string &osRasterLayerName, std::set &oSetIgnoredRasterLayerTableNum) { - auto poTable = cpl::make_unique(); + auto poTable = std::make_unique(); CPLDebug("OpenFileGDB", "FileGDB v9"); @@ -995,7 +995,7 @@ int OGROpenFileGDBDataSource::OpenFileGDBv9( } poTable->Close(); - poTable = cpl::make_unique(); + poTable = std::make_unique(); /* Find tables that are spatial layers */ osFilename = CPLFormFilename( @@ -1177,7 +1177,7 @@ OGROpenFileGDBDataSource::BuildLayerFromName(const char *pszName) CPLFormFilename(m_osDirName, CPLSPrintf("a%08x", idx), "gdbtable")); if (FileExists(osFilename)) { - return cpl::make_unique( + return std::make_unique( this, osFilename, pszName, "", "", eAccess == GA_Update); } } diff --git a/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdatasource_write.cpp b/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdatasource_write.cpp index 4a42110f3683..a2a8b19ca96f 100644 --- a/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdatasource_write.cpp +++ b/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdatasource_write.cpp @@ -669,13 +669,13 @@ bool OGROpenFileGDBDataSource::CreateGDBSystemCatalog() FileGDBTable oTable; if (!oTable.Create(m_osGDBSystemCatalogFilename.c_str(), 4, FGTGT_NONE, false, false) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "ID", std::string(), FGFT_OBJECTID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "Name", std::string(), FGFT_STRING, false, 160, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "FileFormat", std::string(), FGFT_INT32, false, 0, FileGDBField::UNSET_FIELD))) { @@ -701,7 +701,7 @@ bool OGROpenFileGDBDataSource::CreateGDBSystemCatalog() return false; } - m_apoHiddenLayers.emplace_back(cpl::make_unique( + m_apoHiddenLayers.emplace_back(std::make_unique( this, m_osGDBSystemCatalogFilename.c_str(), "GDB_SystemCatalog", "", "", true)); @@ -719,13 +719,13 @@ bool OGROpenFileGDBDataSource::CreateGDBDBTune() CPLFormFilename(m_osDirName.c_str(), "a00000002.gdbtable", nullptr)); FileGDBTable oTable; if (!oTable.Create(osFilename.c_str(), 4, FGTGT_NONE, false, false) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "Keyword", std::string(), FGFT_STRING, false, 32, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "ParameterName", std::string(), FGFT_STRING, false, 32, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "ConfigString", std::string(), FGFT_STRING, true, 2048, FileGDBField::UNSET_FIELD))) { @@ -794,7 +794,7 @@ bool OGROpenFileGDBDataSource::CreateGDBDBTune() return false; } - m_apoHiddenLayers.emplace_back(cpl::make_unique( + m_apoHiddenLayers.emplace_back(std::make_unique( this, osFilename.c_str(), "GDB_DBTune", "", "", true)); return oTable.Sync(); @@ -812,47 +812,47 @@ bool OGROpenFileGDBDataSource::CreateGDBSpatialRefs() FileGDBTable oTable; if (!oTable.Create(m_osGDBSpatialRefsFilename.c_str(), 4, FGTGT_NONE, false, false) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "ID", std::string(), FGFT_OBJECTID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "SRTEXT", std::string(), FGFT_STRING, false, 2048, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "FalseX", std::string(), FGFT_FLOAT64, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "FalseY", std::string(), FGFT_FLOAT64, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "XYUnits", std::string(), FGFT_FLOAT64, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "FalseZ", std::string(), FGFT_FLOAT64, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "ZUnits", std::string(), FGFT_FLOAT64, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "FalseM", std::string(), FGFT_FLOAT64, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "MUnits", std::string(), FGFT_FLOAT64, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "XYTolerance", std::string(), FGFT_FLOAT64, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "ZTolerance", std::string(), FGFT_FLOAT64, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "MTolerance", std::string(), FGFT_FLOAT64, true, 0, FileGDBField::UNSET_FIELD))) { return false; } - m_apoHiddenLayers.emplace_back(cpl::make_unique( + m_apoHiddenLayers.emplace_back(std::make_unique( this, m_osGDBSpatialRefsFilename.c_str(), "GDB_SpatialRefs", "", "", true)); @@ -892,52 +892,52 @@ bool OGROpenFileGDBDataSource::CreateGDBItems() FileGDBTable oTable; if (!oTable.Create(m_osGDBItemsFilename.c_str(), 4, FGTGT_POLYGON, false, false) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "ObjectID", std::string(), FGFT_OBJECTID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "UUID", std::string(), FGFT_GLOBALID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "Type", std::string(), FGFT_GUID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "Name", std::string(), FGFT_STRING, true, 160, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "PhysicalName", std::string(), FGFT_STRING, true, 160, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "Path", std::string(), FGFT_STRING, true, 260, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "DatasetSubtype1", std::string(), FGFT_INT32, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "DatasetSubtype2", std::string(), FGFT_INT32, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "DatasetInfo1", std::string(), FGFT_STRING, true, 255, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "DatasetInfo2", std::string(), FGFT_STRING, true, 255, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "URL", std::string(), FGFT_STRING, true, 255, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "Definition", std::string(), FGFT_XML, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "Documentation", std::string(), FGFT_XML, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "ItemInfo", std::string(), FGFT_XML, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "Properties", std::string(), FGFT_INT32, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "Defaults", std::string(), FGFT_BINARY, true, 0, FileGDBField::UNSET_FIELD)) || !oTable.CreateField(std::move(poGeomField))) @@ -985,7 +985,7 @@ bool OGROpenFileGDBDataSource::CreateGDBItems() ""); fields[14].Integer = 0; - m_apoHiddenLayers.emplace_back(cpl::make_unique( + m_apoHiddenLayers.emplace_back(std::make_unique( this, m_osGDBItemsFilename.c_str(), "GDB_Items", "", "", true)); return oTable.CreateFeature(fields, nullptr) && oTable.Sync(); @@ -1002,16 +1002,16 @@ bool OGROpenFileGDBDataSource::CreateGDBItemTypes() CPLFormFilename(m_osDirName.c_str(), "a00000005.gdbtable", nullptr)); FileGDBTable oTable; if (!oTable.Create(osFilename.c_str(), 4, FGTGT_NONE, false, false) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "ObjectID", std::string(), FGFT_OBJECTID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "UUID", std::string(), FGFT_GUID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "ParentTypeID", std::string(), FGFT_GUID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "Name", std::string(), FGFT_STRING, false, 160, FileGDBField::UNSET_FIELD))) { @@ -1099,7 +1099,7 @@ bool OGROpenFileGDBDataSource::CreateGDBItemTypes() return false; } - m_apoHiddenLayers.emplace_back(cpl::make_unique( + m_apoHiddenLayers.emplace_back(std::make_unique( this, osFilename.c_str(), "GDB_ItemTypes", "", "", true)); return oTable.Sync(); @@ -1117,32 +1117,32 @@ bool OGROpenFileGDBDataSource::CreateGDBItemRelationships() FileGDBTable oTable; if (!oTable.Create(m_osGDBItemRelationshipsFilename.c_str(), 4, FGTGT_NONE, false, false) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "ObjectID", std::string(), FGFT_OBJECTID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "UUID", std::string(), FGFT_GLOBALID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "OriginID", std::string(), FGFT_GUID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "DestID", std::string(), FGFT_GUID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "Type", std::string(), FGFT_GUID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "Attributes", std::string(), FGFT_XML, true, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "Properties", std::string(), FGFT_INT32, true, 0, FileGDBField::UNSET_FIELD))) { return false; } - m_apoHiddenLayers.emplace_back(cpl::make_unique( + m_apoHiddenLayers.emplace_back(std::make_unique( this, m_osGDBItemRelationshipsFilename.c_str(), "GDB_ItemRelationships", "", "", true)); @@ -1160,28 +1160,28 @@ bool OGROpenFileGDBDataSource::CreateGDBItemRelationshipTypes() CPLFormFilename(m_osDirName.c_str(), "a00000007.gdbtable", nullptr)); FileGDBTable oTable; if (!oTable.Create(osFilename.c_str(), 4, FGTGT_NONE, false, false) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "ObjectID", std::string(), FGFT_OBJECTID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "UUID", std::string(), FGFT_GUID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "OrigItemTypeID", std::string(), FGFT_GUID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "DestItemTypeID", std::string(), FGFT_GUID, false, 0, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "Name", std::string(), FGFT_STRING, true, 160, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "ForwardLabel", std::string(), FGFT_STRING, true, 255, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "BackwardLabel", std::string(), FGFT_STRING, true, 255, FileGDBField::UNSET_FIELD)) || - !oTable.CreateField(cpl::make_unique( + !oTable.CreateField(std::make_unique( "IsContainment", std::string(), FGFT_INT16, true, 0, FileGDBField::UNSET_FIELD))) { @@ -1274,7 +1274,7 @@ bool OGROpenFileGDBDataSource::CreateGDBItemRelationshipTypes() return false; } - m_apoHiddenLayers.emplace_back(cpl::make_unique( + m_apoHiddenLayers.emplace_back(std::make_unique( this, osFilename.c_str(), "GDB_ItemRelationshipTypes", "", "", true)); return oTable.Sync(); @@ -1378,7 +1378,7 @@ OGRLayer *OGROpenFileGDBDataSource::ICreateLayer( eType = OGR_GT_SetModifier(wkbMultiPolygon, OGR_GT_HasZ(eType), OGR_GT_HasM(eType)); - auto poLayer = cpl::make_unique( + auto poLayer = std::make_unique( this, osFilename.c_str(), pszLayerName, eType, papszOptions); if (!poLayer->Create(poSRS)) return nullptr; diff --git a/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdriver.cpp b/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdriver.cpp index 358f9af379c2..92168e213c39 100644 --- a/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdriver.cpp +++ b/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdriver.cpp @@ -209,7 +209,7 @@ static GDALDataset *OGROpenFileGDBDriverOpen(GDALOpenInfo *poOpenInfo) } #endif - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); if (poDS->Open(poOpenInfo)) { if (poDS->GetSubdatasets().size() == 2) @@ -218,7 +218,7 @@ static GDALDataset *OGROpenFileGDBDriverOpen(GDALOpenInfo *poOpenInfo) GDALOpenInfo oOpenInfo( poDS->GetSubdatasets().FetchNameValue("SUBDATASET_1_NAME"), poOpenInfo->nOpenFlags); - poDS = cpl::make_unique(); + poDS = std::make_unique(); if (poDS->Open(&oOpenInfo)) { poDS->SetDescription(poOpenInfo->pszFilename); @@ -251,7 +251,7 @@ static GDALDataset *OGROpenFileGDBDriverCreate(const char *pszName, int nXSize, return nullptr; } - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); if (!poDS->Create(pszName)) return nullptr; return poDS.release(); diff --git a/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdblayer.cpp b/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdblayer.cpp index 862f6793c820..833217306ecd 100644 --- a/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdblayer.cpp +++ b/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdblayer.cpp @@ -212,7 +212,7 @@ int OGROpenFileGDBLayer::BuildGeometryColumnGDBv10( if (bHasM) m_eGeomType = wkbSetM(m_eGeomType); - auto poGeomFieldDefn = cpl::make_unique( + auto poGeomFieldDefn = std::make_unique( nullptr, pszShapeFieldName, m_eGeomType); CPLXMLNode *psGPFieldInfoExs = CPLGetXMLNode(psInfo, "GPFieldInfoExs"); @@ -507,7 +507,7 @@ int OGROpenFileGDBLayer::BuildLayerDefinition() { auto poGeomFieldDefn = - cpl::make_unique(nullptr, pszName, + std::make_unique(nullptr, pszName, m_eGeomType); poGeomFieldDefn->SetNullable(poGDBGeomField->IsNullable()); diff --git a/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdblayer_write.cpp b/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdblayer_write.cpp index 6ec61b8e45a2..97428c62643d 100644 --- a/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdblayer_write.cpp +++ b/ogr/ogrsf_frmts/openfilegdb/ogropenfilegdblayer_write.cpp @@ -512,7 +512,7 @@ bool OGROpenFileGDBLayer::Create(const OGRSpatialReference *poSRS) m_poFeatureDefn->Reference(); if (m_eGeomType != wkbNone) { - auto poGeomFieldDefn = cpl::make_unique( + auto poGeomFieldDefn = std::make_unique( this, m_aosCreationOptions.FetchNameValueDef("GEOMETRY_NAME", "SHAPE"), m_eGeomType); @@ -616,7 +616,7 @@ bool OGROpenFileGDBLayer::Create(const OGRSpatialReference *poSRS) "OPENFILEGDB_CREATE_FIELD_BEFORE_GEOMETRY", "NO"))) { OGRFieldDefn oField("field_before_geom", OFTString); - m_poLyrTable->CreateField(cpl::make_unique( + m_poLyrTable->CreateField(std::make_unique( oField.GetNameRef(), std::string(), FGFT_STRING, true, 0, FileGDBField::UNSET_FIELD)); m_poFeatureDefn->AddFieldDefn(&oField); @@ -1248,7 +1248,7 @@ OGRErr OGROpenFileGDBLayer::CreateField(OGRFieldDefn *poField, int bApproxOK) } const char *pszAlias = poField->GetAlternativeNameRef(); - if (!m_poLyrTable->CreateField(cpl::make_unique( + if (!m_poLyrTable->CreateField(std::make_unique( poField->GetNameRef(), pszAlias ? std::string(pszAlias) : std::string(), eType, CPL_TO_BOOL(poField->IsNullable()), nWidth, sDefault))) diff --git a/ogr/ogrsf_frmts/parquet/ogrparquetdriver.cpp b/ogr/ogrsf_frmts/parquet/ogrparquetdriver.cpp index 368fd73fb839..27738317a992 100644 --- a/ogr/ogrsf_frmts/parquet/ogrparquetdriver.cpp +++ b/ogr/ogrsf_frmts/parquet/ogrparquetdriver.cpp @@ -306,8 +306,8 @@ static GDALDataset *OpenFromDatasetFactory( std::shared_ptr scanner; PARQUET_ASSIGN_OR_THROW(scanner, scannerBuilder->Finish()); - auto poDS = cpl::make_unique(poMemoryPool); - auto poLayer = cpl::make_unique( + auto poDS = std::make_unique(poMemoryPool); + auto poLayer = std::make_unique( poDS.get(), CPLGetBasename(osBasePath.c_str()), scanner, scannerBuilder->schema(), papszOpenOptions); poDS->SetLayer(std::move(poLayer)); @@ -574,8 +574,8 @@ static GDALDataset *OGRParquetDriverOpen(GDALOpenInfo *poOpenInfo) return nullptr; } - auto poDS = cpl::make_unique(poMemoryPool); - auto poLayer = cpl::make_unique( + auto poDS = std::make_unique(poMemoryPool); + auto poLayer = std::make_unique( poDS.get(), CPLGetBasename(osFilename.c_str()), std::move(arrow_reader), poOpenInfo->papszOpenOptions); poDS->SetLayer(std::move(poLayer)); @@ -797,7 +797,7 @@ void RegisterOGRParquet() if (GDALGetDriverByName("Parquet") != nullptr) return; - auto poDriver = cpl::make_unique(); + auto poDriver = std::make_unique(); poDriver->SetDescription("Parquet"); poDriver->SetMetadataItem(GDAL_DCAP_VECTOR, "YES"); diff --git a/ogr/ogrsf_frmts/parquet/ogrparquetwriterdataset.cpp b/ogr/ogrsf_frmts/parquet/ogrparquetwriterdataset.cpp index fe9020cbc908..63bc554985d1 100644 --- a/ogr/ogrsf_frmts/parquet/ogrparquetwriterdataset.cpp +++ b/ogr/ogrsf_frmts/parquet/ogrparquetwriterdataset.cpp @@ -86,7 +86,7 @@ OGRLayer *OGRParquetWriterDataset::ICreateLayer( "Can write only one layer in a Parquet file"); return nullptr; } - m_poLayer = cpl::make_unique( + m_poLayer = std::make_unique( m_poMemoryPool.get(), m_poOutputStream, pszName); if (!m_poLayer->SetOptions(papszOptions, poSpatialRef, eGType)) { diff --git a/ogr/ogrsf_frmts/pg/ogrpglayer.cpp b/ogr/ogrsf_frmts/pg/ogrpglayer.cpp index c7f11de54039..58690111560c 100644 --- a/ogr/ogrsf_frmts/pg/ogrpglayer.cpp +++ b/ogr/ogrsf_frmts/pg/ogrpglayer.cpp @@ -2085,7 +2085,7 @@ int OGRPGLayer::ReadResultDefinition(PGresult *hInitialResultIn) nTypeOID == poDS->GetGeographyOID()) { auto poGeomFieldDefn = - cpl::make_unique(this, oField.GetNameRef()); + std::make_unique(this, oField.GetNameRef()); if (iGeomFuncPrefix >= 0 && oField.GetNameRef()[strlen( apszKnownGeomFuncPrefixes[iGeomFuncPrefix])] == '_') @@ -2116,7 +2116,7 @@ int OGRPGLayer::ReadResultDefinition(PGresult *hInitialResultIn) if (nTypeOID == OIDOID) bWkbAsOid = TRUE; auto poGeomFieldDefn = - cpl::make_unique(this, oField.GetNameRef()); + std::make_unique(this, oField.GetNameRef()); poGeomFieldDefn->ePostgisType = GEOM_TYPE_WKB; poFeatureDefn->AddGeomFieldDefn(std::move(poGeomFieldDefn)); continue; diff --git a/ogr/ogrsf_frmts/pg/ogrpgtablelayer.cpp b/ogr/ogrsf_frmts/pg/ogrpgtablelayer.cpp index e88a43995d96..417323fba2ca 100644 --- a/ogr/ogrsf_frmts/pg/ogrpgtablelayer.cpp +++ b/ogr/ogrsf_frmts/pg/ogrpgtablelayer.cpp @@ -373,7 +373,7 @@ void OGRPGTableLayer::SetGeometryInformation(PGGeomColumnDesc *pasDesc, for (int i = 0; i < nGeomFieldCount; i++) { auto poGeomFieldDefn = - cpl::make_unique(this, pasDesc[i].pszName); + std::make_unique(this, pasDesc[i].pszName); poGeomFieldDefn->SetNullable(pasDesc[i].bNullable); poGeomFieldDefn->nSRSId = pasDesc[i].nSRID; poGeomFieldDefn->GeometryTypeFlags = pasDesc[i].GeometryTypeFlags; @@ -632,7 +632,7 @@ int OGRPGTableLayer::ReadTableDefinition() if (pszGeomColForced == nullptr || EQUAL(pszGeomColForced, oField.GetNameRef())) { - auto poGeomFieldDefn = cpl::make_unique( + auto poGeomFieldDefn = std::make_unique( this, oField.GetNameRef()); InitGeomField(poGeomFieldDefn.get()); poFeatureDefn->AddGeomFieldDefn(std::move(poGeomFieldDefn)); @@ -810,7 +810,7 @@ void OGRPGTableLayer::SetTableDefinition(const char *pszFIDColumnName, if (eType != wkbNone) { auto poGeomFieldDefn = - cpl::make_unique(this, pszGFldName); + std::make_unique(this, pszGFldName); poGeomFieldDefn->SetType(eType); poGeomFieldDefn->GeometryTypeFlags = GeometryTypeFlags; @@ -2431,7 +2431,7 @@ OGRErr OGRPGTableLayer::CreateGeomField(OGRGeomFieldDefn *poGeomFieldIn, m_osFirstGeometryFieldName = ""; // reset for potential next geom columns auto poGeomField = - cpl::make_unique(this, osGeomFieldName); + std::make_unique(this, osGeomFieldName); if (EQUAL(poGeomField->GetNameRef(), "")) { if (poFeatureDefn->GetGeomFieldCount() == 0) diff --git a/ogr/ogrsf_frmts/pgdump/ogrpgdumpdatasource.cpp b/ogr/ogrsf_frmts/pgdump/ogrpgdumpdatasource.cpp index 77c228dc66d1..ce6c1302690e 100644 --- a/ogr/ogrsf_frmts/pgdump/ogrpgdumpdatasource.cpp +++ b/ogr/ogrsf_frmts/pgdump/ogrpgdumpdatasource.cpp @@ -612,7 +612,7 @@ OGRLayer *OGRPGDumpDataSource::ICreateLayer(const char *pszLayerName, const bool bWriteAsHex = !CPLFetchBool(papszOptions, "WRITE_EWKT_GEOM", false); - auto poLayer = cpl::make_unique( + auto poLayer = std::make_unique( this, osSchema.c_str(), osTable.c_str(), !osFIDColumnName.empty() ? osFIDColumnName.c_str() : nullptr, bWriteAsHex, bCreateTable); @@ -652,7 +652,7 @@ OGRLayer *OGRPGDumpDataSource::ICreateLayer(const char *pszLayerName, if (eType != wkbNone) { OGRGeomFieldDefn oTmp(pszGFldName, eType); - auto poGeomField = cpl::make_unique(&oTmp); + auto poGeomField = std::make_unique(&oTmp); poGeomField->m_nSRSId = nSRSId; poGeomField->m_nGeometryTypeFlags = nGeometryTypeFlags; poLayer->GetLayerDefn()->AddGeomFieldDefn(std::move(poGeomField)); diff --git a/ogr/ogrsf_frmts/pgdump/ogrpgdumplayer.cpp b/ogr/ogrsf_frmts/pgdump/ogrpgdumplayer.cpp index d71f4a49713c..33c5dc549c4d 100644 --- a/ogr/ogrsf_frmts/pgdump/ogrpgdumplayer.cpp +++ b/ogr/ogrsf_frmts/pgdump/ogrpgdumplayer.cpp @@ -1711,7 +1711,7 @@ OGRErr OGRPGDumpLayer::CreateGeomField(OGRGeomFieldDefn *poGeomFieldIn, CPLString osCommand; auto poGeomField = - cpl::make_unique(&oTmpGeomFieldDefn); + std::make_unique(&oTmpGeomFieldDefn); /* -------------------------------------------------------------------- */ /* Do we want to "launder" the column names into Postgres */ diff --git a/ogr/ogrsf_frmts/pmtiles/ogrpmtilesdataset.cpp b/ogr/ogrsf_frmts/pmtiles/ogrpmtilesdataset.cpp index 48b173aea58b..25a632f1a2ee 100644 --- a/ogr/ogrsf_frmts/pmtiles/ogrpmtilesdataset.cpp +++ b/ogr/ogrsf_frmts/pmtiles/ogrpmtilesdataset.cpp @@ -346,7 +346,7 @@ bool OGRPMTilesDataset::Open(GDALOpenInfo *poOpenInfo) OGRMVTFindAttributesFromTileStat(oTileStatLayers, oId.ToString().c_str()); - m_apoLayers.push_back(cpl::make_unique( + m_apoLayers.push_back(std::make_unique( this, oId.ToString().c_str(), oFields, oAttributesFromTileStats, bJsonField, dfMinX, dfMinY, dfMaxX, dfMaxY, eGeomType, nZoomLevel, bZoomLevelFromSpatialFilter)); diff --git a/ogr/ogrsf_frmts/pmtiles/ogrpmtilesdriver.cpp b/ogr/ogrsf_frmts/pmtiles/ogrpmtilesdriver.cpp index 474fa6336285..e1253bd87b8f 100644 --- a/ogr/ogrsf_frmts/pmtiles/ogrpmtilesdriver.cpp +++ b/ogr/ogrsf_frmts/pmtiles/ogrpmtilesdriver.cpp @@ -55,7 +55,7 @@ static GDALDataset *OGRPMTilesDriverOpen(GDALOpenInfo *poOpenInfo) { if (!OGRPMTilesDriverIdentify(poOpenInfo)) return nullptr; - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); if (!poDS->Open(poOpenInfo)) return nullptr; return poDS.release(); @@ -141,7 +141,7 @@ static GDALDataset *OGRPMTilesDriverCreate(const char *pszFilename, int nXSize, { if (nXSize == 0 && nYSize == 0 && nBandsIn == 0 && eDT == GDT_Unknown) { - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); if (!poDS->Create(pszFilename, papszOptions)) return nullptr; return poDS.release(); diff --git a/ogr/ogrsf_frmts/pmtiles/ogrpmtilesvectorlayer.cpp b/ogr/ogrsf_frmts/pmtiles/ogrpmtilesvectorlayer.cpp index c6da854eba50..c6eea3ae3bc3 100644 --- a/ogr/ogrsf_frmts/pmtiles/ogrpmtilesvectorlayer.cpp +++ b/ogr/ogrsf_frmts/pmtiles/ogrpmtilesvectorlayer.cpp @@ -365,7 +365,7 @@ std::unique_ptr OGRPMTilesVectorLayer::GetNextSrcFeature() return nullptr; } - m_poTileIterator = cpl::make_unique( + m_poTileIterator = std::make_unique( m_poDS, m_nZoomLevel, m_nFilterMinX, m_nFilterMinY, m_nFilterMaxX, m_nFilterMaxY); } diff --git a/ogr/ogrsf_frmts/pmtiles/vsipmtiles.cpp b/ogr/ogrsf_frmts/pmtiles/vsipmtiles.cpp index f65a37fa48d5..1018936602fc 100644 --- a/ogr/ogrsf_frmts/pmtiles/vsipmtiles.cpp +++ b/ogr/ogrsf_frmts/pmtiles/vsipmtiles.cpp @@ -198,7 +198,7 @@ VSIPMTilesOpen(const char *pszFilename, std::string &osSubfilename, aosOptions.SetNameValue("DECOMPRESS_TILES", "NO"); aosOptions.SetNameValue("ACCEPT_ANY_TILE_TYPE", "YES"); oOpenInfo.papszOpenOptions = aosOptions.List(); - auto poDS = cpl::make_unique(); + auto poDS = std::make_unique(); { CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler); if (!poDS->Open(&oOpenInfo)) diff --git a/ogr/ogrsf_frmts/shape/ogrshapelayer.cpp b/ogr/ogrsf_frmts/shape/ogrshapelayer.cpp index b3c49aa80f78..50d69cc11e84 100644 --- a/ogr/ogrsf_frmts/shape/ogrshapelayer.cpp +++ b/ogr/ogrsf_frmts/shape/ogrshapelayer.cpp @@ -217,7 +217,7 @@ OGRShapeLayer::OGRShapeLayer(OGRShapeDataSource *poDSIn, { poSRSClone->SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); } - auto poGeomFieldDefn = cpl::make_unique( + auto poGeomFieldDefn = std::make_unique( pszFullName, eType, bSRSSetIn, poSRSClone); if (!osPrjFilename.empty()) poGeomFieldDefn->SetPrjFilename(osPrjFilename); diff --git a/ogr/ogrsf_frmts/sosi/ogrsosilayer.cpp b/ogr/ogrsf_frmts/sosi/ogrsosilayer.cpp index 6fbd22b559d0..6e6e0cad48bd 100644 --- a/ogr/ogrsf_frmts/sosi/ogrsosilayer.cpp +++ b/ogr/ogrsf_frmts/sosi/ogrsosilayer.cpp @@ -260,7 +260,7 @@ OGRFeature *OGRSOSILayer::GetNextFeature() { /* Area */ oGType = wkbPolygon; auto poOuter = - cpl::make_unique(); /* Initialize a new + std::make_unique(); /* Initialize a new closed polygon */ long nRefNr; unsigned char nRefStatus; @@ -319,7 +319,7 @@ OGRFeature *OGRSOSILayer::GetNextFeature() if (correct) { - auto poLy = cpl::make_unique(); + auto poLy = std::make_unique(); poOuter->closeRings(); poLy->addRingDirectly(poOuter.release()); diff --git a/ogr/ogrsf_frmts/sqlite/ogrsqlitelayer.cpp b/ogr/ogrsf_frmts/sqlite/ogrsqlitelayer.cpp index 9fcb6ad881ff..18ddd1769fde 100644 --- a/ogr/ogrsf_frmts/sqlite/ogrsqlitelayer.cpp +++ b/ogr/ogrsf_frmts/sqlite/ogrsqlitelayer.cpp @@ -293,7 +293,7 @@ void OGRSQLiteLayer::BuildFeatureDefn(const char *pszLayerName, bool bIsSelect, paosGeomCols->end()) { m_poFeatureDefn->AddGeomFieldDefn( - cpl::make_unique(pszFieldName, iCol)); + std::make_unique(pszFieldName, iCol)); continue; } @@ -463,7 +463,7 @@ void OGRSQLiteLayer::BuildFeatureDefn(const char *pszLayerName, bool bIsSelect, eGeomType = wkbSetM(wkbSetZ(eGeomType)); OGRSpatialReference *poSRS = m_poDS->FetchSRS(nSRID); auto poGeomFieldDefn = - cpl::make_unique( + std::make_unique( pszFieldName, iCol); poGeomFieldDefn->m_eGeomFormat = OSGF_SpatiaLite; poGeomFieldDefn->SetSpatialRef(poSRS); @@ -546,7 +546,7 @@ void OGRSQLiteLayer::BuildFeatureDefn(const char *pszLayerName, bool bIsSelect, if (OGRIsBinaryGeomCol(hStmtIn, iCol, oField, eGeomFormat)) { auto poGeomFieldDefn = - cpl::make_unique( + std::make_unique( pszFieldName, iCol); poGeomFieldDefn->m_eGeomFormat = eGeomFormat; m_poFeatureDefn->AddGeomFieldDefn( @@ -560,7 +560,7 @@ void OGRSQLiteLayer::BuildFeatureDefn(const char *pszLayerName, bool bIsSelect, /* we'll also try to decode as SpatialLite if */ /* bTriedAsSpatiaLite is not FALSE */ auto poGeomFieldDefn = - cpl::make_unique(pszFieldName, + std::make_unique(pszFieldName, iCol); poGeomFieldDefn->m_eGeomFormat = OSGF_WKB; m_poFeatureDefn->AddGeomFieldDefn( @@ -582,7 +582,7 @@ void OGRSQLiteLayer::BuildFeatureDefn(const char *pszLayerName, bool bIsSelect, { eGeomFormat = OSGF_WKT; auto poGeomFieldDefn = - cpl::make_unique( + std::make_unique( pszFieldName, iCol); poGeomFieldDefn->m_eGeomFormat = eGeomFormat; m_poFeatureDefn->AddGeomFieldDefn( @@ -597,7 +597,7 @@ void OGRSQLiteLayer::BuildFeatureDefn(const char *pszLayerName, bool bIsSelect, else { auto poGeomFieldDefn = - cpl::make_unique(pszFieldName, + std::make_unique(pszFieldName, iCol); poGeomFieldDefn->m_eGeomFormat = OSGF_WKT; m_poFeatureDefn->AddGeomFieldDefn( @@ -613,7 +613,7 @@ void OGRSQLiteLayer::BuildFeatureDefn(const char *pszLayerName, bool bIsSelect, OGRSQLiteIsSpatialFunctionReturningGeometry(pszFieldName)) { auto poGeomFieldDefn = - cpl::make_unique(pszFieldName, iCol); + std::make_unique(pszFieldName, iCol); poGeomFieldDefn->m_eGeomFormat = OSGF_SpatiaLite; m_poFeatureDefn->AddGeomFieldDefn(std::move(poGeomFieldDefn)); continue; @@ -625,7 +625,7 @@ void OGRSQLiteLayer::BuildFeatureDefn(const char *pszLayerName, bool bIsSelect, m_poFeatureDefn->GetGeomFieldCount() == 0)) { auto poGeomFieldDefn = - cpl::make_unique(pszFieldName, iCol); + std::make_unique(pszFieldName, iCol); poGeomFieldDefn->m_eGeomFormat = OSGF_SpatiaLite; m_poFeatureDefn->AddGeomFieldDefn(std::move(poGeomFieldDefn)); continue; @@ -642,7 +642,7 @@ void OGRSQLiteLayer::BuildFeatureDefn(const char *pszLayerName, bool bIsSelect, if (nBytes > 0 && OGRIsBinaryGeomCol(hStmtIn, iCol, oField, eGeomFormat)) { - auto poGeomFieldDefn = cpl::make_unique( + auto poGeomFieldDefn = std::make_unique( pszFieldName, iCol); poGeomFieldDefn->m_eGeomFormat = eGeomFormat; m_poFeatureDefn->AddGeomFieldDefn(std::move(poGeomFieldDefn)); diff --git a/ogr/ogrsf_frmts/sqlite/ogrsqlitetablelayer.cpp b/ogr/ogrsf_frmts/sqlite/ogrsqlitetablelayer.cpp index dc0f2d9445ed..34e20f2db588 100644 --- a/ogr/ogrsf_frmts/sqlite/ogrsqlitetablelayer.cpp +++ b/ogr/ogrsf_frmts/sqlite/ogrsqlitetablelayer.cpp @@ -234,7 +234,7 @@ void OGRSQLiteTableLayer::SetCreationParameters(const char *pszFIDColumnName, nSRSId = m_poDS->GetUndefinedSRID(); OGRSQLiteGeomFormat eGeomFormat = GetGeomFormat(pszGeomFormat); auto poGeomFieldDefn = - cpl::make_unique(pszGeometryName, -1); + std::make_unique(pszGeometryName, -1); poGeomFieldDefn->SetType(eGeomType); poGeomFieldDefn->m_nSRSId = nSRSId; poGeomFieldDefn->m_eGeomFormat = eGeomFormat; @@ -1656,7 +1656,7 @@ OGRErr OGRSQLiteTableLayer::CreateGeomField(OGRGeomFieldDefn *poGeomFieldIn, } } - auto poGeomField = cpl::make_unique( + auto poGeomField = std::make_unique( poGeomFieldIn->GetNameRef(), -1); if (EQUAL(poGeomField->GetNameRef(), "")) { diff --git a/ogr/ogrsf_frmts/sqlite/ogrsqliteutility.cpp b/ogr/ogrsf_frmts/sqlite/ogrsqliteutility.cpp index 06bf99d74dc2..ae0e28ca61fe 100644 --- a/ogr/ogrsf_frmts/sqlite/ogrsqliteutility.cpp +++ b/ogr/ogrsf_frmts/sqlite/ogrsqliteutility.cpp @@ -102,7 +102,7 @@ std::unique_ptr SQLQuery(sqlite3 *poDb, const char *pszSQL) return nullptr; } - return cpl::make_unique(papszResult, nRowCount, nColCount); + return std::make_unique(papszResult, nRowCount, nColCount); } const char *SQLResult::GetValue(int iColNum, int iRowNum) const diff --git a/ogr/ogrsf_frmts/sqlite/ogrsqlitevirtualogr.cpp b/ogr/ogrsf_frmts/sqlite/ogrsqlitevirtualogr.cpp index 79d1b914f3cd..f637360eb663 100644 --- a/ogr/ogrsf_frmts/sqlite/ogrsqlitevirtualogr.cpp +++ b/ogr/ogrsf_frmts/sqlite/ogrsqlitevirtualogr.cpp @@ -1703,7 +1703,7 @@ static OGRFeature *OGR2SQLITE_FeatureFromArgs(OGR2SQLITE_vtab *pMyVTab, return nullptr; } - auto poFeature = cpl::make_unique(poLayerDefn); + auto poFeature = std::make_unique(poLayerDefn); if (pMyVTab->bHasFIDColumn) { diff --git a/ogr/ogrsf_frmts/sxf/ogrsxfdatasource.cpp b/ogr/ogrsf_frmts/sxf/ogrsxfdatasource.cpp index 6763e4798b26..9bcda3af06c6 100644 --- a/ogr/ogrsf_frmts/sxf/ogrsxfdatasource.cpp +++ b/ogr/ogrsf_frmts/sxf/ogrsxfdatasource.cpp @@ -1100,7 +1100,7 @@ OGRSXFLayer *OGRSXFDataSource::GetLayerById(GByte nID) void OGRSXFDataSource::CreateLayers() { // default layers set - m_apoLayers.emplace_back(cpl::make_unique( + m_apoLayers.emplace_back(std::make_unique( fpSXF, &hIOMutex, static_cast(0), CPLString("SYSTEM"), oSXFPassport.version, oSXFPassport.stMapDescription)); auto pLayer = m_apoLayers.back().get(); @@ -1112,7 +1112,7 @@ void OGRSXFDataSource::CreateLayers() } pLayer->AddClassifyCode(91000000); - m_apoLayers.emplace_back(cpl::make_unique( + m_apoLayers.emplace_back(std::make_unique( fpSXF, &hIOMutex, static_cast(255), CPLString("Not_Classified"), oSXFPassport.version, oSXFPassport.stMapDescription)); } @@ -1201,7 +1201,7 @@ void OGRSXFDataSource::CreateLayers(VSILFILE *fpRSC, else pszRecoded = CPLStrdup(LAYER.szName); - m_apoLayers.emplace_back(cpl::make_unique( + m_apoLayers.emplace_back(std::make_unique( fpSXF, &hIOMutex, LAYER.nNo, CPLString(pszRecoded), oSXFPassport.version, oSXFPassport.stMapDescription)); } @@ -1218,7 +1218,7 @@ void OGRSXFDataSource::CreateLayers(VSILFILE *fpRSC, else pszRecoded = CPLStrdup(LAYER.szShortName); - m_apoLayers.emplace_back(cpl::make_unique( + m_apoLayers.emplace_back(std::make_unique( fpSXF, &hIOMutex, LAYER.nNo, CPLString(pszRecoded), oSXFPassport.version, oSXFPassport.stMapDescription)); } @@ -1228,7 +1228,7 @@ void OGRSXFDataSource::CreateLayers(VSILFILE *fpRSC, VSIFSeekL(fpRSC, nOffset, SEEK_SET); } - m_apoLayers.emplace_back(cpl::make_unique( + m_apoLayers.emplace_back(std::make_unique( fpSXF, &hIOMutex, static_cast(255), CPLString("Not_Classified"), oSXFPassport.version, oSXFPassport.stMapDescription)); diff --git a/ogr/ogrsf_frmts/wasp/ogrwaspdriver.cpp b/ogr/ogrsf_frmts/wasp/ogrwaspdriver.cpp index 71a4e821cf7f..7d0e60149bb0 100644 --- a/ogr/ogrsf_frmts/wasp/ogrwaspdriver.cpp +++ b/ogr/ogrsf_frmts/wasp/ogrwaspdriver.cpp @@ -54,7 +54,7 @@ OGRDataSource *OGRWAsPDriver::Open(const char *pszFilename, int bUpdate) * );*/ return nullptr; } - auto pDataSource = cpl::make_unique(pszFilename, fh); + auto pDataSource = std::make_unique(pszFilename, fh); if (pDataSource->Load(true) != OGRERR_NONE) { diff --git a/ogr/ogrsf_frmts/wasp/ogrwasplayer.cpp b/ogr/ogrsf_frmts/wasp/ogrwasplayer.cpp index 30e9a9f4658b..3ae4ad29763c 100644 --- a/ogr/ogrsf_frmts/wasp/ogrwasplayer.cpp +++ b/ogr/ogrsf_frmts/wasp/ogrwasplayer.cpp @@ -282,7 +282,7 @@ OGRLineString *OGRWAsPLayer::Simplify(const OGRLineString &line) const if (pdfAdjacentPointTolerance.get() && *pdfAdjacentPointTolerance > 0) { /* remove consecutive points that are too close */ - auto newLine = cpl::make_unique(); + auto newLine = std::make_unique(); const double dist = *pdfAdjacentPointTolerance; OGRPoint pt; poLine->StartPoint(&pt); @@ -789,7 +789,7 @@ OGRFeature *OGRWAsPLayer::GetNextRawFeature() return nullptr; } - auto poFeature = cpl::make_unique(poLayerDefn); + auto poFeature = std::make_unique(poLayerDefn); poFeature->SetFID(++iFeatureCount); for (int i = 0; i < iNumValues - 1; i++) poFeature->SetField(i, dfValues[i]); @@ -812,7 +812,7 @@ OGRFeature *OGRWAsPLayer::GetNextRawFeature() CPLError(CE_Failure, CPLE_FileIO, "No enough values for linestring"); return nullptr; } - auto poLine = cpl::make_unique(); + auto poLine = std::make_unique(); poLine->setCoordinateDimension(3); poLine->assignSpatialReference(poSpatialReference); for (int i = 0; i < iNumValuesToRead; i += 2) diff --git a/ogr/ogrsf_frmts/wfs/ogroapifdriver.cpp b/ogr/ogrsf_frmts/wfs/ogroapifdriver.cpp index 825a5370fdff..6cf2f72f240d 100644 --- a/ogr/ogrsf_frmts/wfs/ogroapifdriver.cpp +++ b/ogr/ogrsf_frmts/wfs/ogroapifdriver.cpp @@ -762,7 +762,7 @@ bool OGROAPIFDataset::LoadJSONCollection(const CPLJSONObject &oCollection, } const auto oLinks = oCollection.GetArray("links"); - auto poLayer = cpl::make_unique( + auto poLayer = std::make_unique( this, osName, oBBOX, osBBOXCrs, std::move(oCRSList), osActiveCRS, dfCoordinateEpoch, oLinks); if (!osTitle.empty()) @@ -1670,7 +1670,7 @@ void OGROAPIFLayer::GetSchema() const char *pszName = poProperty->GetName() + (bAllPrefixed ? osPropertyNamePrefix.size() : 0); - auto poField = cpl::make_unique(pszName, eFType); + auto poField = std::make_unique(pszName, eFType); poField->SetSubType(eSubType); m_apoFieldsFromSchema.emplace_back(std::move(poField)); } @@ -1749,7 +1749,7 @@ void OGROAPIFLayer::GetSchema() } } - auto poField = cpl::make_unique( + auto poField = std::make_unique( oProp.GetName().c_str(), eType); poField->SetSubType(eSubType); m_apoFieldsFromSchema.emplace_back(std::move(poField)); @@ -3120,7 +3120,7 @@ static GDALDataset *OGROAPIFDriverOpen(GDALOpenInfo *poOpenInfo) { if (!OGROAPIFDriverIdentify(poOpenInfo) || poOpenInfo->eAccess == GA_Update) return nullptr; - auto poDataset = cpl::make_unique(); + auto poDataset = std::make_unique(); if (!poDataset->Open(poOpenInfo)) return nullptr; return poDataset.release(); diff --git a/perftests/bench_ogr_batch.cpp b/perftests/bench_ogr_batch.cpp index c6c6f93bd719..b53d5c2b504c 100644 --- a/perftests/bench_ogr_batch.cpp +++ b/perftests/bench_ogr_batch.cpp @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) oRing.addPoint(CPLAtof(argv[iArg + 3]), CPLAtof(argv[iArg + 2])); oRing.addPoint(CPLAtof(argv[iArg + 1]), CPLAtof(argv[iArg + 2])); - poSpatialFilter = cpl::make_unique(); + poSpatialFilter = std::make_unique(); poSpatialFilter->addRing(&oRing); iArg += 4; diff --git a/perftests/bench_ogr_c_api.cpp b/perftests/bench_ogr_c_api.cpp index 60c426c5a639..ddd02ec12122 100644 --- a/perftests/bench_ogr_c_api.cpp +++ b/perftests/bench_ogr_c_api.cpp @@ -76,7 +76,7 @@ int main(int argc, char *argv[]) oRing.addPoint(CPLAtof(argv[iArg + 3]), CPLAtof(argv[iArg + 2])); oRing.addPoint(CPLAtof(argv[iArg + 1]), CPLAtof(argv[iArg + 2])); - poSpatialFilter = cpl::make_unique(); + poSpatialFilter = std::make_unique(); poSpatialFilter->addRing(&oRing); iArg += 4; diff --git a/port/cpl_vsil_adls.cpp b/port/cpl_vsil_adls.cpp index 0e1eb3377a0d..b10a92ddd366 100644 --- a/port/cpl_vsil_adls.cpp +++ b/port/cpl_vsil_adls.cpp @@ -739,7 +739,7 @@ VSIADLSFSHandler::CreateWriteHandle(const char *pszFilename, if (poHandleHelper == nullptr) return nullptr; auto poHandle = - cpl::make_unique(this, pszFilename, poHandleHelper); + std::make_unique(this, pszFilename, poHandleHelper); if (!poHandle->CreateFile(papszOptions)) { return nullptr; diff --git a/port/cpl_vsil_az.cpp b/port/cpl_vsil_az.cpp index 85eecd6533c6..182289415618 100644 --- a/port/cpl_vsil_az.cpp +++ b/port/cpl_vsil_az.cpp @@ -724,7 +724,7 @@ VSIAzureFSHandler::CreateWriteHandle(const char *pszFilename, pszFilename + GetFSPrefix().size(), GetFSPrefix()); if (poHandleHelper == nullptr) return nullptr; - auto poHandle = cpl::make_unique( + auto poHandle = std::make_unique( this, pszFilename, poHandleHelper, papszOptions); if (!poHandle->IsOK()) { diff --git a/port/cpl_vsil_curl.cpp b/port/cpl_vsil_curl.cpp index 4af93b0fceca..a3d2bde99c06 100644 --- a/port/cpl_vsil_curl.cpp +++ b/port/cpl_vsil_curl.cpp @@ -1712,7 +1712,7 @@ std::string VSICurlFilesystemHandlerBase::NotifyStartDownloadRegion( } else { - auto poRegionInDownload = cpl::make_unique(); + auto poRegionInDownload = std::make_unique(); poRegionInDownload->bDownloadInProgress = true; m_oMapRegionInDownload[osId] = std::move(poRegionInDownload); m_oMutex.unlock(); @@ -3190,7 +3190,7 @@ void VSICurlHandle::AdviseRead(int nRanges, const vsi_l_offset *panOffsets, if (m_aoAdviseReadRanges[iRequest] == nullptr) m_aoAdviseReadRanges[iRequest] = - cpl::make_unique(); + std::make_unique(); // coverity[missing_lock] m_aoAdviseReadRanges[iRequest]->bDone = false; m_aoAdviseReadRanges[iRequest]->nStartOffset = panOffsets[i]; diff --git a/port/cpl_vsil_gs.cpp b/port/cpl_vsil_gs.cpp index 28a171fb73b1..c6133c3d17cf 100644 --- a/port/cpl_vsil_gs.cpp +++ b/port/cpl_vsil_gs.cpp @@ -299,7 +299,7 @@ VSIGSFSHandler::CreateWriteHandle(const char *pszFilename, CreateHandleHelper(pszFilename + GetFSPrefix().size(), false); if (poHandleHelper == nullptr) return nullptr; - auto poHandle = cpl::make_unique( + auto poHandle = std::make_unique( this, pszFilename, poHandleHelper, false, papszOptions); if (!poHandle->IsOK()) { diff --git a/port/cpl_vsil_oss.cpp b/port/cpl_vsil_oss.cpp index fa80cc859db5..71975aab98f5 100644 --- a/port/cpl_vsil_oss.cpp +++ b/port/cpl_vsil_oss.cpp @@ -148,7 +148,7 @@ VSIOSSFSHandler::CreateWriteHandle(const char *pszFilename, CreateHandleHelper(pszFilename + GetFSPrefix().size(), false); if (poHandleHelper == nullptr) return nullptr; - auto poHandle = cpl::make_unique( + auto poHandle = std::make_unique( this, pszFilename, poHandleHelper, false, papszOptions); if (!poHandle->IsOK()) { diff --git a/port/cpl_vsil_s3.cpp b/port/cpl_vsil_s3.cpp index 504bd4fef6e1..81856faca054 100644 --- a/port/cpl_vsil_s3.cpp +++ b/port/cpl_vsil_s3.cpp @@ -2039,7 +2039,7 @@ VSIS3FSHandler::CreateWriteHandle(const char *pszFilename, CreateHandleHelper(pszFilename + GetFSPrefix().size(), false); if (poHandleHelper == nullptr) return nullptr; - auto poHandle = cpl::make_unique( + auto poHandle = std::make_unique( this, pszFilename, poHandleHelper, false, papszOptions); if (!poHandle->IsOK()) { diff --git a/port/cpl_vsil_swift.cpp b/port/cpl_vsil_swift.cpp index 0d6eb7b7095a..615c1a347472 100644 --- a/port/cpl_vsil_swift.cpp +++ b/port/cpl_vsil_swift.cpp @@ -300,7 +300,7 @@ VSISwiftFSHandler::CreateWriteHandle(const char *pszFilename, CreateHandleHelper(pszFilename + GetFSPrefix().size(), false); if (poHandleHelper == nullptr) return nullptr; - auto poHandle = cpl::make_unique( + auto poHandle = std::make_unique( this, pszFilename, poHandleHelper, true, papszOptions); if (!poHandle->IsOK()) { diff --git a/port/cpl_vsil_webhdfs.cpp b/port/cpl_vsil_webhdfs.cpp index cf6c450db740..4f8b00a7a9ea 100644 --- a/port/cpl_vsil_webhdfs.cpp +++ b/port/cpl_vsil_webhdfs.cpp @@ -524,7 +524,7 @@ VSIVirtualHandleUniquePtr VSIWebHDFSFSHandler::CreateWriteHandle(const char *pszFilename, CSLConstList /*papszOptions*/) { - auto poHandle = cpl::make_unique(this, pszFilename); + auto poHandle = std::make_unique(this, pszFilename); if (!poHandle->IsOK()) { return nullptr;