From f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Fri, 15 Jun 2018 12:46:15 +0200 Subject: =?UTF-8?q?Run=20clang-tidy=E2=80=99s=20modernize-use-nullptr=20pa?= =?UTF-8?q?ss.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This replaces all NULL or 0 with nullptr when assigned to or returned as a pointer. --- src/color.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/color.cpp') diff --git a/src/color.cpp b/src/color.cpp index d7e8d25dd..29efd5fee 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -35,7 +35,7 @@ static bool profileMatches( SVGICCColor const* first, SVGICCColor const* second #define PROFILE_EPSILON 0.00000001 SPColor::SPColor() : - icc(0) + icc(nullptr) { v.c[0] = 0; v.c[1] = 0; @@ -43,19 +43,19 @@ SPColor::SPColor() : } SPColor::SPColor( SPColor const& other ) : - icc(0) + icc(nullptr) { *this = other; } SPColor::SPColor( float r, float g, float b ) : - icc(0) + icc(nullptr) { set( r, g, b ); } SPColor::SPColor( guint32 value ) : - icc(0) + icc(nullptr) { set( value ); } @@ -63,7 +63,7 @@ SPColor::SPColor( guint32 value ) : SPColor::~SPColor() { delete icc; - icc = 0; + icc = nullptr; } @@ -73,7 +73,7 @@ SPColor& SPColor::operator= (SPColor const& other) return *this; } - SVGICCColor* tmp_icc = other.icc ? new SVGICCColor(*other.icc) : 0; + SVGICCColor* tmp_icc = other.icc ? new SVGICCColor(*other.icc) : nullptr; v.c[0] = other.v.c[0]; v.c[1] = other.v.c[1]; @@ -223,8 +223,8 @@ std::string SPColor::toString() const void sp_color_get_rgb_floatv(SPColor const *color, float *rgb) { - return_if_fail (color != NULL); - return_if_fail (rgb != NULL); + return_if_fail (color != nullptr); + return_if_fail (rgb != nullptr); rgb[0] = color->v.c[0]; rgb[1] = color->v.c[1]; @@ -238,8 +238,8 @@ sp_color_get_rgb_floatv(SPColor const *color, float *rgb) void sp_color_get_cmyk_floatv(SPColor const *color, float *cmyk) { - return_if_fail (color != NULL); - return_if_fail (cmyk != NULL); + return_if_fail (color != nullptr); + return_if_fail (cmyk != nullptr); sp_color_rgb_to_cmyk_floatv( cmyk, color->v.c[0], -- cgit v1.2.3