diff --git a/include/mapnik/text/scrptrun.hpp b/include/mapnik/text/scrptrun.hpp index 7c8063b28..2161c510d 100644 --- a/include/mapnik/text/scrptrun.hpp +++ b/include/mapnik/text/scrptrun.hpp @@ -105,7 +105,7 @@ private: inline ScriptRun::ScriptRun() { - reset(NULL, 0, 0); + reset(nullptr, 0, 0); } inline ScriptRun::ScriptRun(const UChar chars[], int32_t length) diff --git a/plugins/input/gdal/gdal_featureset.cpp b/plugins/input/gdal/gdal_featureset.cpp index fe1fe64a4..2a27d35cb 100644 --- a/plugins/input/gdal/gdal_featureset.cpp +++ b/plugins/input/gdal/gdal_featureset.cpp @@ -403,15 +403,15 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) if( red->GetBand() == 1 && green->GetBand() == 2 && blue->GetBand() == 3 ) { int nBandsToRead = 3; - if( alpha != NULL && alpha->GetBand() == 4 && !raster_has_nodata ) + if( alpha != nullptr && alpha->GetBand() == 4 && !raster_has_nodata ) { nBandsToRead = 4; - alpha = NULL; // to avoid reading it again afterwards + alpha = nullptr; // to avoid reading it again afterwards } raster_io_error = dataset_.RasterIO(GF_Read, x_off, y_off, width, height, image.bytes(), image.width(), image.height(), GDT_Byte, - nBandsToRead, NULL, + nBandsToRead, nullptr, 4, 4 * image.width(), 1); if (raster_io_error == CE_Failure) { throw datasource_exception(CPLGetLastErrorMsg()); diff --git a/plugins/input/ogr/ogr_datasource.cpp b/plugins/input/ogr/ogr_datasource.cpp index 41c0ebbe6..760bceddb 100644 --- a/plugins/input/ogr/ogr_datasource.cpp +++ b/plugins/input/ogr/ogr_datasource.cpp @@ -371,7 +371,7 @@ void ogr_datasource::init(mapnik::parameters const& params) } mapnik::parameters & extra_params = desc_.get_extra_parameters(); OGRSpatialReference * srs_ref = layer->GetSpatialRef(); - char * srs_output = NULL; + char * srs_output = nullptr; if (srs_ref && srs_ref->exportToProj4( &srs_output ) == OGRERR_NONE ) { extra_params["proj4"] = mapnik::util::trim_copy(srs_output); } diff --git a/plugins/input/pgraster/pgraster_datasource.cpp b/plugins/input/pgraster/pgraster_datasource.cpp index 451c74e52..d846d0087 100644 --- a/plugins/input/pgraster/pgraster_datasource.cpp +++ b/plugins/input/pgraster/pgraster_datasource.cpp @@ -257,7 +257,7 @@ pgraster_datasource::pgraster_datasource(parameters const& params) if (srid_ == 0) { const char* srid_c = rs->getValue("srid"); - if (srid_c != NULL) + if (srid_c != nullptr) { int result = 0; const char * end = srid_c + std::strlen(srid_c); @@ -291,13 +291,13 @@ pgraster_datasource::pgraster_datasource(parameters const& params) s.str(""); s << "SELECT ST_SRID(\"" << geometryColumn_ << "\") AS srid FROM " - << populate_tokens(table_) << " WHERE \"" << geometryColumn_ << "\" IS NOT NULL LIMIT 1;"; + << populate_tokens(table_) << " WHERE \"" << geometryColumn_ << "\" IS NOT nullptr LIMIT 1;"; shared_ptr rs = conn->executeQuery(s.str()); if (rs->next()) { const char* srid_c = rs->getValue("srid"); - if (srid_c != NULL) + if (srid_c != nullptr) { int result = 0; const char * end = srid_c + std::strlen(srid_c); diff --git a/plugins/input/pgraster/pgraster_wkb_reader.cpp b/plugins/input/pgraster/pgraster_wkb_reader.cpp index b97d0cdc3..4a9fd1c8f 100644 --- a/plugins/input/pgraster/pgraster_wkb_reader.cpp +++ b/plugins/input/pgraster/pgraster_wkb_reader.cpp @@ -66,7 +66,7 @@ read_uint16(const uint8_t** from, uint8_t littleEndian) { /* int16_t read_int16(const uint8_t** from, uint8_t littleEndian) { - assert(NULL != from); + assert(nullptr != from); return read_uint16(from, littleEndian); } diff --git a/src/font_engine_freetype.cpp b/src/font_engine_freetype.cpp index a14e6b60e..9721d70bf 100644 --- a/src/font_engine_freetype.cpp +++ b/src/font_engine_freetype.cpp @@ -105,7 +105,7 @@ bool freetype_engine::register_font_impl(std::string const& file_name, streamRec.size = file.size(); streamRec.descriptor.pointer = file.get(); streamRec.read = ft_read_cb; - streamRec.close = NULL; + streamRec.close = nullptr; args.flags = FT_OPEN_STREAM; args.stream = &streamRec; int num_faces = 0; @@ -269,7 +269,7 @@ bool freetype_engine::can_open(std::string const& face_name, streamRec.size = file.size(); streamRec.descriptor.pointer = file.get(); streamRec.read = ft_read_cb; - streamRec.close = NULL; + streamRec.close = nullptr; args.flags = FT_OPEN_STREAM; args.stream = &streamRec; // -1 is used to quickly check if the font file appears valid without iterating each face diff --git a/src/plugin.cpp b/src/plugin.cpp index af9bef3fb..9037f5300 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -108,7 +108,7 @@ void * PluginInfo::get_symbol(std::string const& sym_name) const #ifdef MAPNIK_SUPPORTS_DLOPEN return static_cast(dlsym(module_->dl, sym_name.c_str())); #else - return NULL; + return nullptr; #endif } diff --git a/src/proj_transform.cpp b/src/proj_transform.cpp index a08b4d7dd..108e3f97c 100644 --- a/src/proj_transform.cpp +++ b/src/proj_transform.cpp @@ -124,7 +124,7 @@ unsigned int proj_transform::forward (geometry::line_string & ls) const geometry::point * ptr = ls.data(); double * x = reinterpret_cast(ptr); double * y = x + 1; - double * z = NULL; + double * z = nullptr; if(!forward(x, y, z, size, 2)) { return size; @@ -264,7 +264,7 @@ unsigned int proj_transform::backward (geometry::line_string & ls) const geometry::point * ptr = ls.data(); double * x = reinterpret_cast(ptr); double * y = x + 1; - double * z = NULL; + double * z = nullptr; if(!backward(x, y, z, size, 2)) { return size;