Skip to content

Commit 222e45b

Browse files
committed
allow builds with DEBUG macro defined
1 parent bb0bfea commit 222e45b

File tree

8 files changed

+32
-32
lines changed

8 files changed

+32
-32
lines changed

external/libdxfrw/drw_base.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ namespace DRW
9393

9494
enum DBG_LEVEL
9595
{
96-
NONE,
97-
DEBUG
96+
none,
97+
debug
9898
};
9999

100100
//! Special codes for colors

external/libdxfrw/intern/drw_dbg.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ DRW_dbg *DRW_dbg::getInstance()
6767

6868
DRW_dbg::DRW_dbg()
6969
{
70-
level = NONE;
70+
level = none;
7171
prClass = new print_none;
7272
}
7373

@@ -77,7 +77,7 @@ void DRW_dbg::setLevel( LEVEL lvl )
7777
delete prClass;
7878
switch ( level )
7979
{
80-
case DEBUG:
80+
case debug:
8181
prClass = new print_debug;
8282
break;
8383
default:

external/libdxfrw/intern/drw_dbg.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class DRW_dbg
3232
public:
3333
enum LEVEL
3434
{
35-
NONE,
36-
DEBUG
35+
none,
36+
debug
3737
};
3838
void setLevel( LEVEL lvl );
3939
LEVEL getLevel();

external/libdxfrw/libdwgr.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ dwgR::dwgR( const char *name )
5353
, writer( nullptr )
5454
#endif
5555
{
56-
DRW_DBGSL( DRW_dbg::NONE );
56+
DRW_DBGSL( DRW_dbg::none );
5757
}
5858

5959
dwgR::~dwgR()
@@ -65,11 +65,11 @@ void dwgR::setDebug( DRW::DBG_LEVEL lvl )
6565
{
6666
switch ( lvl )
6767
{
68-
case DRW::DEBUG:
69-
DRW_DBGSL( DRW_dbg::DEBUG );
68+
case DRW::debug:
69+
DRW_DBGSL( DRW_dbg::debug );
7070
break;
7171
default:
72-
DRW_DBGSL( DRW_dbg::NONE );
72+
DRW_DBGSL( DRW_dbg::none );
7373
}
7474
}
7575

external/libdxfrw/libdxfrw.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ dxfRW::dxfRW( const char *name )
6262
, elParts( 128 ) //parts number when convert ellipse to polyline
6363
, currHandle( 0 )
6464
{
65-
DRW_DBGSL( DRW_dbg::NONE );
65+
DRW_DBGSL( DRW_dbg::none );
6666
}
6767

6868
dxfRW::~dxfRW()
@@ -79,11 +79,11 @@ void dxfRW::setDebug( DRW::DBG_LEVEL lvl )
7979
{
8080
switch ( lvl )
8181
{
82-
case DRW::DEBUG:
83-
DRW_DBGSL( DRW_dbg::DEBUG );
82+
case DRW::debug:
83+
DRW_DBGSL( DRW_dbg::debug );
8484
break;
8585
default:
86-
DRW_DBGSL( DRW_dbg::NONE );
86+
DRW_DBGSL( DRW_dbg::none );
8787
}
8888
}
8989

@@ -3398,7 +3398,8 @@ bool dxfRW::processImageDef()
33983398
return true;
33993399
}
34003400

3401-
/** Utility function
3401+
/**
3402+
* Utility function
34023403
* convert a int to string in hex
34033404
**/
34043405
std::string dxfRW::toHexStr( int n )

src/core/qgsogrutils.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,28 @@
3131

3232

3333

34-
void gdal::OGRDataSourceDeleter::operator()( void *source )
34+
void gdal::OGRDataSourceDeleter::operator()( OGRDataSourceH source )
3535
{
3636
OGR_DS_Destroy( source );
3737
}
3838

3939

40-
void gdal::OGRGeometryDeleter::operator()( void *geometry )
40+
void gdal::OGRGeometryDeleter::operator()( OGRGeometryH geometry )
4141
{
4242
OGR_G_DestroyGeometry( geometry );
4343
}
4444

45-
void gdal::OGRFldDeleter::operator()( void *definition )
45+
void gdal::OGRFldDeleter::operator()( OGRFieldDefnH definition )
4646
{
4747
OGR_Fld_Destroy( definition );
4848
}
4949

50-
void gdal::OGRFeatureDeleter::operator()( void *feature )
50+
void gdal::OGRFeatureDeleter::operator()( OGRFeatureH feature )
5151
{
5252
OGR_F_Destroy( feature );
5353
}
5454

55-
void gdal::GDALDatasetCloser::operator()( void *dataset )
55+
void gdal::GDALDatasetCloser::operator()( GDALDatasetH dataset )
5656
{
5757
GDALClose( dataset );
5858
}

src/core/qgsogrutils.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace gdal
3939
/**
4040
* Destroys an OGR data \a source, using the correct gdal calls.
4141
*/
42-
void CORE_EXPORT operator()( void *source );
42+
void CORE_EXPORT operator()( OGRDataSourceH source );
4343

4444
};
4545

@@ -52,7 +52,7 @@ namespace gdal
5252
/**
5353
* Destroys an OGR \a geometry, using the correct gdal calls.
5454
*/
55-
void CORE_EXPORT operator()( void *geometry );
55+
void CORE_EXPORT operator()( OGRGeometryH geometry );
5656

5757
};
5858

@@ -65,7 +65,7 @@ namespace gdal
6565
/**
6666
* Destroys an OGR field \a definition, using the correct gdal calls.
6767
*/
68-
void CORE_EXPORT operator()( void *definition );
68+
void CORE_EXPORT operator()( OGRFieldDefnH definition );
6969

7070
};
7171

@@ -78,7 +78,7 @@ namespace gdal
7878
/**
7979
* Destroys an OGR \a feature, using the correct gdal calls.
8080
*/
81-
void CORE_EXPORT operator()( void *feature );
81+
void CORE_EXPORT operator()( OGRFeatureH feature );
8282

8383
};
8484

@@ -91,7 +91,7 @@ namespace gdal
9191
/**
9292
* Destroys an gdal \a dataset, using the correct gdal calls.
9393
*/
94-
void CORE_EXPORT operator()( void *dataset );
94+
void CORE_EXPORT operator()( GDALDatasetH datasource );
9595

9696
};
9797

@@ -111,27 +111,27 @@ namespace gdal
111111
/**
112112
* Scoped OGR data source.
113113
*/
114-
using ogr_datasource_unique_ptr = std::unique_ptr< void, OGRDataSourceDeleter>;
114+
using ogr_datasource_unique_ptr = std::unique_ptr< std::remove_pointer<OGRDataSourceH>::type, OGRDataSourceDeleter >;
115115

116116
/**
117117
* Scoped OGR geometry.
118118
*/
119-
using ogr_geometry_unique_ptr = std::unique_ptr< void, OGRGeometryDeleter>;
119+
using ogr_geometry_unique_ptr = std::unique_ptr< std::remove_pointer<OGRGeometryH>::type, OGRGeometryDeleter >;
120120

121121
/**
122122
* Scoped OGR field definition.
123123
*/
124-
using ogr_field_def_unique_ptr = std::unique_ptr< void, OGRFldDeleter >;
124+
using ogr_field_def_unique_ptr = std::unique_ptr< std::remove_pointer<OGRFieldDefnH>::type, OGRFldDeleter >;
125125

126126
/**
127127
* Scoped OGR feature.
128128
*/
129-
using ogr_feature_unique_ptr = std::unique_ptr< void, OGRFeatureDeleter >;
129+
using ogr_feature_unique_ptr = std::unique_ptr< std::remove_pointer<OGRFeatureH>::type, OGRFeatureDeleter >;
130130

131131
/**
132132
* Scoped GDAL dataset.
133133
*/
134-
using dataset_unique_ptr = std::unique_ptr< void, GDALDatasetCloser >;
134+
using dataset_unique_ptr = std::unique_ptr< std::remove_pointer<GDALDatasetH>::type, GDALDatasetCloser >;
135135

136136
/**
137137
* Performs a fast close of an unwanted GDAL dataset handle by deleting the underlying

src/providers/ogr/qgsogrprovider.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -2974,9 +2974,8 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri,
29742974
{
29752975
QgsDebugMsg( QString( "Creating empty vector layer with format: %1" ).arg( format ) );
29762976

2977-
GDALDriverH driver;
29782977
QgsApplication::registerOgrDrivers();
2979-
driver = OGRGetDriverByName( format.toLatin1() );
2978+
OGRSFDriverH driver = OGRGetDriverByName( format.toLatin1() );
29802979
if ( !driver )
29812980
{
29822981
return false;

0 commit comments

Comments
 (0)