From 6d3e9d1bab80807e511df083d9aa277a08c7de5e Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 14 Jun 2022 01:25:52 +0200 Subject: [PATCH] MSVC 2015 compilation fixes --- ogr/ogrsf_frmts/generic/ograrrowarrayhelper.cpp | 2 +- ogr/ogrsf_frmts/generic/ograrrowarrayhelper.h | 2 ++ ogr/ogrsf_frmts/generic/ogrlayer.cpp | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ogr/ogrsf_frmts/generic/ograrrowarrayhelper.cpp b/ogr/ogrsf_frmts/generic/ograrrowarrayhelper.cpp index 75388089e8a7..3b13da6e2cf7 100644 --- a/ogr/ogrsf_frmts/generic/ograrrowarrayhelper.cpp +++ b/ogr/ogrsf_frmts/generic/ograrrowarrayhelper.cpp @@ -64,7 +64,7 @@ OGRArrowArrayHelper::OGRArrowArrayHelper(GDALDataset* poDS, for(int i = 0; i < nFieldCount; i++ ) { const auto poFieldDefn = poFeatureDefn->GetFieldDefn(i); - abNullableFields[i] = poFieldDefn->IsNullable(); + abNullableFields[i] = CPL_TO_BOOL(poFieldDefn->IsNullable()); if( !poFieldDefn->IsIgnored() ) { mapOGRFieldToArrowField[i] = nChildren; diff --git a/ogr/ogrsf_frmts/generic/ograrrowarrayhelper.h b/ogr/ogrsf_frmts/generic/ograrrowarrayhelper.h index d93eb0ef370b..af58cdbf6bf8 100644 --- a/ogr/ogrsf_frmts/generic/ograrrowarrayhelper.h +++ b/ogr/ogrsf_frmts/generic/ograrrowarrayhelper.h @@ -30,6 +30,8 @@ //! @cond Doxygen_Suppress +#include + #include "cpl_time.h" #include "ogrsf_frmts.h" diff --git a/ogr/ogrsf_frmts/generic/ogrlayer.cpp b/ogr/ogrsf_frmts/generic/ogrlayer.cpp index 6848e32801e7..acf453a4ffbd 100644 --- a/ogr/ogrsf_frmts/generic/ogrlayer.cpp +++ b/ogr/ogrsf_frmts/generic/ogrlayer.cpp @@ -5480,7 +5480,7 @@ static bool FillWKBGeometryArray(struct ArrowArray* psChild, const OGRGeomFieldDefn* poFieldDefn, const int i) { - const bool bIsNullable = poFieldDefn->IsNullable(); + const bool bIsNullable = CPL_TO_BOOL(poFieldDefn->IsNullable()); psChild->n_buffers = 3; psChild->buffers = static_cast(CPLCalloc(3, sizeof(void*))); uint8_t* pabyNull = nullptr; @@ -5814,7 +5814,7 @@ int OGRLayer::GetNextArrowArray(struct ArrowArrayStream*, ++iSchemaChild; psChild->release = OGRLayerDefaultReleaseArray; psChild->length = apoFeatures.size(); - const bool bIsNullable = poFieldDefn->IsNullable(); + const bool bIsNullable = CPL_TO_BOOL(poFieldDefn->IsNullable()); const auto eSubType = poFieldDefn->GetSubType(); switch( poFieldDefn->GetType() ) {