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/conditions.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/conditions.cpp') diff --git a/src/conditions.cpp b/src/conditions.cpp index b531f22cf..4188b75e1 100644 --- a/src/conditions.cpp +++ b/src/conditions.cpp @@ -58,8 +58,8 @@ bool sp_item_evaluate(SPItem const *item) { #define ISALNUM(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z') || ((c) >= '0' && (c) <= '9')) static gchar *preprocessLanguageCode(gchar *lngcode) { - if ( NULL == lngcode ) - return NULL; + if ( nullptr == lngcode ) + return nullptr; lngcode = g_strstrip(lngcode); if ( 0 == *lngcode ) @@ -80,11 +80,11 @@ static gchar *preprocessLanguageCode(gchar *lngcode) { } static bool evaluateSystemLanguage(SPItem const *item, gchar const *value) { - if ( NULL == value ) + if ( nullptr == value ) return true; std::set language_codes; - gchar *str = NULL; + gchar *str = nullptr; gchar **strlist = g_strsplit( value, ",", 0); for ( int i = 0 ; (str = strlist[i]) ; i++ ) { @@ -132,7 +132,7 @@ static bool evaluateSystemLanguage(SPItem const *item, gchar const *value) { static std::vector splitByWhitespace(gchar const *value) { std::vector parts; - gchar *str = NULL; + gchar *str = nullptr; gchar **strlist = g_strsplit( value, ",", 0); for ( int i = 0 ; (str = strlist[i]) ; i++ ) { @@ -246,7 +246,7 @@ static bool evaluateSVG10Feature(gchar const *feature) { } static bool evaluateSingleFeature(gchar const *value) { - if ( NULL == value ) + if ( nullptr == value ) return false; gchar const *found; found = strstr(value, SVG11FEATURE); @@ -259,7 +259,7 @@ static bool evaluateSingleFeature(gchar const *value) { } static bool evaluateRequiredFeatures(SPItem const */*item*/, gchar const *value) { - if ( NULL == value ) + if ( nullptr == value ) return true; std::vector parts = splitByWhitespace(value); @@ -278,7 +278,7 @@ static bool evaluateRequiredFeatures(SPItem const */*item*/, gchar const *value) } static bool evaluateRequiredExtensions(SPItem const */*item*/, gchar const *value) { - if ( NULL == value ) + if ( nullptr == value ) return true; return false; } -- cgit v1.2.3