Skip to content

Commit

Permalink
Merge pull request #10701 from rouault/sqlite_STRONG_CXX_WFLAGS
Browse files Browse the repository at this point in the history
SQLite driver: fix warnings related to STRONG_CXX_WFLAGS
  • Loading branch information
rouault authored Sep 7, 2024
2 parents 99651ea + 1455171 commit 33189b3
Show file tree
Hide file tree
Showing 14 changed files with 460 additions and 386 deletions.
1 change: 1 addition & 0 deletions ogr/ogrsf_frmts/sqlite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ add_gdal_driver(
rasterlite2_header.h
rasterlite2.cpp
sqlite_rtree_bulk_load/wrapper.cpp
STRONG_CXX_WFLAGS
)
gdal_standard_includes(ogr_SQLite)

Expand Down
25 changes: 17 additions & 8 deletions ogr/ogrsf_frmts/sqlite/ogr_sqlite.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ class OGRSQLiteLayer CPL_NON_FINAL : public OGRLayer,
bool bUseComprGeom,
GByte *pabyData);

CPL_DISALLOW_COPY_ASSIGN(OGRSQLiteLayer)

protected:
OGRSQLiteFeatureDefn *m_poFeatureDefn = nullptr;

Expand Down Expand Up @@ -355,6 +357,8 @@ class OGRSQLiteTableLayer final : public OGRSQLiteLayer
OGRErr RunAddGeometryColumn(const OGRSQLiteGeomFieldDefn *poGeomField,
bool bAddColumnsForNonSpatialite);

CPL_DISALLOW_COPY_ASSIGN(OGRSQLiteTableLayer)

public:
explicit OGRSQLiteTableLayer(OGRSQLiteDataSource *);
virtual ~OGRSQLiteTableLayer();
Expand Down Expand Up @@ -489,6 +493,8 @@ class OGRSQLiteViewLayer final : public OGRSQLiteLayer

CPLErr EstablishFeatureDefn();

CPL_DISALLOW_COPY_ASSIGN(OGRSQLiteViewLayer)

public:
explicit OGRSQLiteViewLayer(OGRSQLiteDataSource *);
virtual ~OGRSQLiteViewLayer();
Expand Down Expand Up @@ -675,8 +681,7 @@ class OGR2SQLITEModule;

class OGRSQLiteDataSource final : public OGRSQLiteBaseDataSource
{
OGRSQLiteLayer **m_papoLayers = nullptr;
int m_nLayers = 0;
std::vector<std::unique_ptr<OGRSQLiteLayer>> m_apoLayers{};

// We maintain a list of known SRID to reduce the number of trips to
// the database to get SRSes.
Expand Down Expand Up @@ -710,7 +715,7 @@ class OGRSQLiteDataSource final : public OGRSQLiteBaseDataSource

void SaveStatistics();

std::vector<OGRLayer *> m_apoInvisibleLayers{};
std::vector<std::unique_ptr<OGRLayer>> m_apoInvisibleLayers{};

#ifdef HAVE_RASTERLITE2
void *m_hRL2Ctxt = nullptr;
Expand Down Expand Up @@ -745,6 +750,8 @@ class OGRSQLiteDataSource final : public OGRSQLiteBaseDataSource

void PostInitSpatialite();

CPL_DISALLOW_COPY_ASSIGN(OGRSQLiteDataSource)

public:
OGRSQLiteDataSource();
virtual ~OGRSQLiteDataSource();
Expand All @@ -760,7 +767,7 @@ class OGRSQLiteDataSource final : public OGRSQLiteBaseDataSource

virtual int GetLayerCount() override
{
return m_nLayers;
return static_cast<int>(m_apoLayers.size());
}

virtual OGRLayer *GetLayer(int) override;
Expand Down Expand Up @@ -895,10 +902,12 @@ class OGRSQLiteDataSource final : public OGRSQLiteBaseDataSource

class RL2RasterBand final : public GDALPamRasterBand
{
bool m_bHasNoData;
double m_dfNoDataValue;
GDALColorInterp m_eColorInterp;
GDALColorTable *m_poCT;
bool m_bHasNoData = false;
double m_dfNoDataValue = 0;
GDALColorInterp m_eColorInterp = GCI_Undefined;
GDALColorTable *m_poCT = nullptr;

CPL_DISALLOW_COPY_ASSIGN(RL2RasterBand)

public:
RL2RasterBand(int nBandIn, int nPixelType, GDALDataType eDT, int nBits,
Expand Down
Loading

0 comments on commit 33189b3

Please sign in to comment.