diff options
-rw-r--r-- | cairomm/context.cc | 14 | ||||
-rw-r--r-- | cairomm/fontface.cc | 6 | ||||
-rw-r--r-- | cairomm/region.cc | 8 | ||||
-rw-r--r-- | cairomm/surface.cc | 2 | ||||
-rw-r--r-- | meson.build | 3 |
5 files changed, 17 insertions, 16 deletions
diff --git a/cairomm/context.cc b/cairomm/context.cc index ab50cec..3eb73fd 100644 --- a/cairomm/context.cc +++ b/cairomm/context.cc @@ -163,14 +163,14 @@ void Context::set_dash(const std::valarray<double>& dashes, double offset) void Context::set_dash(const std::vector<double>& dashes, double offset) { cairo_set_dash(cobj(), - (dashes.empty() ? 0 : &dashes[0]), + (dashes.empty() ? nullptr : &dashes[0]), dashes.size(), offset); check_object_status_and_throw_exception(*this); } void Context::unset_dash() { - cairo_set_dash(cobj(), NULL, 0, 0.0); + cairo_set_dash(cobj(), nullptr, 0, 0.0); check_object_status_and_throw_exception(*this); } @@ -518,9 +518,9 @@ void Context::show_text_glyphs(const std::string& utf8, TextClusterFlags cluster_flags) { cairo_show_text_glyphs(cobj(), utf8.c_str(), utf8.size(), - (glyphs.empty() ? 0 : &glyphs[0]), + (glyphs.empty() ? nullptr : &glyphs[0]), glyphs.size(), - (clusters.empty() ? 0 : &clusters[0]), + (clusters.empty() ? nullptr : &clusters[0]), clusters.size(), static_cast<cairo_text_cluster_flags_t>(cluster_flags)); check_object_status_and_throw_exception(*this); @@ -529,7 +529,7 @@ void Context::show_text_glyphs(const std::string& utf8, void Context::show_glyphs(const std::vector<Glyph>& glyphs) { cairo_show_glyphs(cobj(), - const_cast<cairo_glyph_t*>((glyphs.empty() ? 0 : &glyphs[0])), + const_cast<cairo_glyph_t*>((glyphs.empty() ? nullptr : &glyphs[0])), glyphs.size()); check_object_status_and_throw_exception(*this); } @@ -569,7 +569,7 @@ void Context::get_text_extents(const std::string& utf8, TextExtents& extents) co void Context::get_glyph_extents(const std::vector<Glyph>& glyphs, TextExtents& extents) const { cairo_glyph_extents(const_cast<cobject*>(cobj()), - const_cast<cairo_glyph_t*>(glyphs.empty() ? 0 : &glyphs[0]), + const_cast<cairo_glyph_t*>(glyphs.empty() ? nullptr : &glyphs[0]), glyphs.size(), &extents); check_object_status_and_throw_exception(*this); } @@ -583,7 +583,7 @@ void Context::text_path(const std::string& utf8) void Context::glyph_path(const std::vector<Glyph>& glyphs) { cairo_glyph_path(cobj(), - const_cast<cairo_glyph_t*>(glyphs.empty() ? 0 : &glyphs[0]), + const_cast<cairo_glyph_t*>(glyphs.empty() ? nullptr : &glyphs[0]), glyphs.size()); check_object_status_and_throw_exception(*this); } diff --git a/cairomm/fontface.cc b/cairomm/fontface.cc index c75f355..c9363df 100644 --- a/cairomm/fontface.cc +++ b/cairomm/fontface.cc @@ -118,7 +118,7 @@ ToyFontFace::Weight ToyFontFace::get_weight() const static const cairo_user_data_key_t user_font_key = {0}; static void -log_uncaught_exception(const char* message = 0) +log_uncaught_exception(const char* message = nullptr) { std::cerr << "*** cairomm: Uncaught exception in UserFont callback"; if(message) @@ -316,7 +316,7 @@ UserFontFace::text_to_glyphs(const RefPtr<ScaledFont>& /*scaled_font*/, // parameter. // TODO: Is there a reentrancy requirement, and is this code reentrant? cairo_font_face_set_user_data(cobj(), &USER_DATA_KEY_DEFAULT_TEXT_TO_GLYPHS, - this, 0); + this, nullptr); return CAIRO_STATUS_SUCCESS; } @@ -364,7 +364,7 @@ UserFontFace::UserFontFace() // store a pointer to the wrapper class in the user-data, so that when one of // the callback functions gets called (which has to be a plain-C function so // can't be a class member), we can get a reference to the wrapper class - cairo_font_face_set_user_data(m_cobject, &user_font_key, this, 0); + cairo_font_face_set_user_data(m_cobject, &user_font_key, this, nullptr); cairo_user_font_face_set_init_func(cobj(), init_cb); cairo_user_font_face_set_render_glyph_func(cobj(), render_glyph_cb); cairo_user_font_face_set_unicode_to_glyph_func(cobj(), unicode_to_glyph_cb); diff --git a/cairomm/region.cc b/cairomm/region.cc index c262889..e5a5e7c 100644 --- a/cairomm/region.cc +++ b/cairomm/region.cc @@ -148,7 +148,7 @@ void Region::translate(int dx, int dy) void Region::subtract(const RefPtr<Region>& other) { - auto status = cairo_region_subtract(m_cobject, (other ? other->cobj() : 0)); + auto status = cairo_region_subtract(m_cobject, (other ? other->cobj() : nullptr)); check_status_and_throw_exception (status); } @@ -160,7 +160,7 @@ void Region::subtract(const RectangleInt& rectangle) void Region::intersect(const RefPtr<Region>& other) { - auto status = cairo_region_intersect(m_cobject, (other ? other->cobj() : 0)); + auto status = cairo_region_intersect(m_cobject, (other ? other->cobj() : nullptr)); check_status_and_throw_exception (status); } @@ -172,7 +172,7 @@ void Region::intersect(const RectangleInt& rectangle) void Region::do_union(const RefPtr<Region>& other) { - auto status = cairo_region_union(m_cobject, (other ? other->cobj() : 0)); + auto status = cairo_region_union(m_cobject, (other ? other->cobj() : nullptr)); check_status_and_throw_exception (status); } @@ -184,7 +184,7 @@ void Region::do_union(const RectangleInt& rectangle) void Region::do_xor(const RefPtr<Region>& other) { - auto status = cairo_region_xor(m_cobject, (other ? other->cobj() : 0)); + auto status = cairo_region_xor(m_cobject, (other ? other->cobj() : nullptr)); check_status_and_throw_exception (status); } diff --git a/cairomm/surface.cc b/cairomm/surface.cc index 0a6e7f9..be31b65 100644 --- a/cairomm/surface.cc +++ b/cairomm/surface.cc @@ -120,7 +120,7 @@ void Surface::set_mime_data(const std::string& mime_type, unsigned char* data, u void Surface::unset_mime_data(const std::string& mime_type) { cairo_surface_set_mime_data(const_cast<cobject*>(cobj()), mime_type.c_str(), - 0, 0, 0, 0); + nullptr, 0, nullptr, nullptr); check_object_status_and_throw_exception(*this); } diff --git a/meson.build b/meson.build index 61fff34..28137a7 100644 --- a/meson.build +++ b/meson.build @@ -192,7 +192,7 @@ elif warning_level == 'max' or warning_level == 'fatal' if is_msvc warning_flags = ['/W4'] else - warning_flags = '-pedantic -Wall -Wextra -Wformat-security -Wsuggest-override'.split() + warning_flags = '-pedantic -Wall -Wextra -Wformat-security -Wsuggest-override -Wzero-as-null-pointer-constant'.split() endif if warning_level == 'fatal' if is_msvc @@ -288,6 +288,7 @@ summary = [ 'Build HTML documentation: @0@@1@'.format(build_documentation_opt, real_build_documentation), ' Build example programs: @0@'.format(build_examples), ' Build test programs: @0@@1@'.format(build_tests_opt, real_build_tests), + ' Use shared Boost Test: @0@'.format(USE_SHARED_BOOST), 'Directories:', ' prefix: @0@'.format(install_prefix), ' includedir: @0@'.format(install_prefix / install_includedir), |