allow builds with DEBUG macro defined

This commit is contained in:
Juergen E. Fischer 2018-04-11 22:54:51 +02:00
parent bb0bfea3c4
commit 222e45b838
8 changed files with 32 additions and 32 deletions

View File

@ -93,8 +93,8 @@ namespace DRW
enum DBG_LEVEL
{
NONE,
DEBUG
none,
debug
};
//! Special codes for colors

View File

@ -67,7 +67,7 @@ DRW_dbg *DRW_dbg::getInstance()
DRW_dbg::DRW_dbg()
{
level = NONE;
level = none;
prClass = new print_none;
}
@ -77,7 +77,7 @@ void DRW_dbg::setLevel( LEVEL lvl )
delete prClass;
switch ( level )
{
case DEBUG:
case debug:
prClass = new print_debug;
break;
default:

View File

@ -32,8 +32,8 @@ class DRW_dbg
public:
enum LEVEL
{
NONE,
DEBUG
none,
debug
};
void setLevel( LEVEL lvl );
LEVEL getLevel();

View File

@ -53,7 +53,7 @@ dwgR::dwgR( const char *name )
, writer( nullptr )
#endif
{
DRW_DBGSL( DRW_dbg::NONE );
DRW_DBGSL( DRW_dbg::none );
}
dwgR::~dwgR()
@ -65,11 +65,11 @@ void dwgR::setDebug( DRW::DBG_LEVEL lvl )
{
switch ( lvl )
{
case DRW::DEBUG:
DRW_DBGSL( DRW_dbg::DEBUG );
case DRW::debug:
DRW_DBGSL( DRW_dbg::debug );
break;
default:
DRW_DBGSL( DRW_dbg::NONE );
DRW_DBGSL( DRW_dbg::none );
}
}

View File

@ -62,7 +62,7 @@ dxfRW::dxfRW( const char *name )
, elParts( 128 ) //parts number when convert ellipse to polyline
, currHandle( 0 )
{
DRW_DBGSL( DRW_dbg::NONE );
DRW_DBGSL( DRW_dbg::none );
}
dxfRW::~dxfRW()
@ -79,11 +79,11 @@ void dxfRW::setDebug( DRW::DBG_LEVEL lvl )
{
switch ( lvl )
{
case DRW::DEBUG:
DRW_DBGSL( DRW_dbg::DEBUG );
case DRW::debug:
DRW_DBGSL( DRW_dbg::debug );
break;
default:
DRW_DBGSL( DRW_dbg::NONE );
DRW_DBGSL( DRW_dbg::none );
}
}
@ -3398,7 +3398,8 @@ bool dxfRW::processImageDef()
return true;
}
/** Utility function
/**
* Utility function
* convert a int to string in hex
**/
std::string dxfRW::toHexStr( int n )

View File

@ -31,28 +31,28 @@
void gdal::OGRDataSourceDeleter::operator()( void *source )
void gdal::OGRDataSourceDeleter::operator()( OGRDataSourceH source )
{
OGR_DS_Destroy( source );
}
void gdal::OGRGeometryDeleter::operator()( void *geometry )
void gdal::OGRGeometryDeleter::operator()( OGRGeometryH geometry )
{
OGR_G_DestroyGeometry( geometry );
}
void gdal::OGRFldDeleter::operator()( void *definition )
void gdal::OGRFldDeleter::operator()( OGRFieldDefnH definition )
{
OGR_Fld_Destroy( definition );
}
void gdal::OGRFeatureDeleter::operator()( void *feature )
void gdal::OGRFeatureDeleter::operator()( OGRFeatureH feature )
{
OGR_F_Destroy( feature );
}
void gdal::GDALDatasetCloser::operator()( void *dataset )
void gdal::GDALDatasetCloser::operator()( GDALDatasetH dataset )
{
GDALClose( dataset );
}

View File

@ -39,7 +39,7 @@ namespace gdal
/**
* Destroys an OGR data \a source, using the correct gdal calls.
*/
void CORE_EXPORT operator()( void *source );
void CORE_EXPORT operator()( OGRDataSourceH source );
};
@ -52,7 +52,7 @@ namespace gdal
/**
* Destroys an OGR \a geometry, using the correct gdal calls.
*/
void CORE_EXPORT operator()( void *geometry );
void CORE_EXPORT operator()( OGRGeometryH geometry );
};
@ -65,7 +65,7 @@ namespace gdal
/**
* Destroys an OGR field \a definition, using the correct gdal calls.
*/
void CORE_EXPORT operator()( void *definition );
void CORE_EXPORT operator()( OGRFieldDefnH definition );
};
@ -78,7 +78,7 @@ namespace gdal
/**
* Destroys an OGR \a feature, using the correct gdal calls.
*/
void CORE_EXPORT operator()( void *feature );
void CORE_EXPORT operator()( OGRFeatureH feature );
};
@ -91,7 +91,7 @@ namespace gdal
/**
* Destroys an gdal \a dataset, using the correct gdal calls.
*/
void CORE_EXPORT operator()( void *dataset );
void CORE_EXPORT operator()( GDALDatasetH datasource );
};
@ -111,27 +111,27 @@ namespace gdal
/**
* Scoped OGR data source.
*/
using ogr_datasource_unique_ptr = std::unique_ptr< void, OGRDataSourceDeleter>;
using ogr_datasource_unique_ptr = std::unique_ptr< std::remove_pointer<OGRDataSourceH>::type, OGRDataSourceDeleter >;
/**
* Scoped OGR geometry.
*/
using ogr_geometry_unique_ptr = std::unique_ptr< void, OGRGeometryDeleter>;
using ogr_geometry_unique_ptr = std::unique_ptr< std::remove_pointer<OGRGeometryH>::type, OGRGeometryDeleter >;
/**
* Scoped OGR field definition.
*/
using ogr_field_def_unique_ptr = std::unique_ptr< void, OGRFldDeleter >;
using ogr_field_def_unique_ptr = std::unique_ptr< std::remove_pointer<OGRFieldDefnH>::type, OGRFldDeleter >;
/**
* Scoped OGR feature.
*/
using ogr_feature_unique_ptr = std::unique_ptr< void, OGRFeatureDeleter >;
using ogr_feature_unique_ptr = std::unique_ptr< std::remove_pointer<OGRFeatureH>::type, OGRFeatureDeleter >;
/**
* Scoped GDAL dataset.
*/
using dataset_unique_ptr = std::unique_ptr< void, GDALDatasetCloser >;
using dataset_unique_ptr = std::unique_ptr< std::remove_pointer<GDALDatasetH>::type, GDALDatasetCloser >;
/**
* Performs a fast close of an unwanted GDAL dataset handle by deleting the underlying

View File

@ -2974,9 +2974,8 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri,
{
QgsDebugMsg( QString( "Creating empty vector layer with format: %1" ).arg( format ) );
GDALDriverH driver;
QgsApplication::registerOgrDrivers();
driver = OGRGetDriverByName( format.toLatin1() );
OGRSFDriverH driver = OGRGetDriverByName( format.toLatin1() );
if ( !driver )
{
return false;