[Libreoffice-commits] core.git: bridges/source compilerplugins/clang desktop/source hwpfilter/source opencl/inc rsc/inc sc/source stoc/source tools/inc vcl/inc

Stephan Bergmann sbergman at redhat.com
Mon Jul 11 12:32:30 UTC 2016


 bridges/source/jni_uno/jni_base.h            |   22 ++++++++--------
 bridges/source/jni_uno/jni_helper.h          |   14 +++++-----
 compilerplugins/clang/nullptr.cxx            |   35 ++++++++++++++++++++++++---
 desktop/source/deployment/inc/dp_misc.h      |    2 -
 desktop/source/pkgchk/unopkg/unopkg_shared.h |    2 -
 hwpfilter/source/drawing.h                   |   34 +++++++++++++-------------
 hwpfilter/source/hbox.h                      |    4 +--
 hwpfilter/source/hinfo.h                     |    2 -
 hwpfilter/source/hwpfile.h                   |    2 -
 hwpfilter/source/nodes.h                     |   10 +++----
 opencl/inc/opencl_device_selection.h         |    6 ++--
 rsc/inc/rscall.h                             |    6 ++--
 rsc/inc/rscerror.h                           |    6 ++--
 sc/source/filter/inc/tool.h                  |    2 -
 stoc/source/security/lru_cache.h             |    2 -
 tools/inc/poly.h                             |    6 ++--
 vcl/inc/toolbox.h                            |    2 -
 vcl/inc/unx/genpspgraphics.h                 |    2 -
 vcl/inc/unx/salframe.h                       |    6 ++--
 vcl/inc/unx/salgdi.h                         |    4 +--
 vcl/inc/unx/salinst.h                        |    2 -
 21 files changed, 100 insertions(+), 71 deletions(-)

New commits:
commit f541b99855bd70781f8d7d655ab259ff9eb596f0
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jul 11 14:32:07 2016 +0200

    loplugin:nullptr: Better heuristic to determine code shared between C and C++
    
    Change-Id: I51e1c5fa4639e51fac90f92adf3d87d12960d589

diff --git a/bridges/source/jni_uno/jni_base.h b/bridges/source/jni_uno/jni_base.h
index f5b5342..a84701d 100644
--- a/bridges/source/jni_uno/jni_base.h
+++ b/bridges/source/jni_uno/jni_base.h
@@ -91,7 +91,7 @@ public:
     inline void ensure_no_exception() const; // throws BridgeRuntimeError
     inline bool assert_no_exception() const; // asserts and clears exception
 
-    OUString get_stack_trace( jobject jo_exc = NULL ) const;
+    OUString get_stack_trace( jobject jo_exc = nullptr ) const;
 };
 
 inline void JNI_context::ensure_no_exception() const
@@ -144,7 +144,7 @@ class JLocalAutoRef
 public:
     explicit JLocalAutoRef( JNI_context const & jni )
         : m_jni( jni ),
-          m_jo( NULL )
+          m_jo( nullptr )
         {}
     explicit JLocalAutoRef( JNI_context const & jni, jobject jo )
         : m_jni( jni ),
@@ -156,7 +156,7 @@ public:
     jobject get() const
         { return m_jo; }
     bool is() const
-        { return (NULL != m_jo); }
+        { return (nullptr != m_jo); }
     inline jobject release();
     inline void reset( jobject jo );
     inline JLocalAutoRef & operator = ( JLocalAutoRef & auto_ref );
@@ -164,7 +164,7 @@ public:
 
 inline JLocalAutoRef::~JLocalAutoRef()
 {
-    if (NULL != m_jo)
+    if (nullptr != m_jo)
         m_jni->DeleteLocalRef( m_jo );
 }
 
@@ -172,13 +172,13 @@ inline JLocalAutoRef::JLocalAutoRef( JLocalAutoRef & auto_ref )
     : m_jni( auto_ref.m_jni ),
       m_jo( auto_ref.m_jo )
 {
-    auto_ref.m_jo = NULL;
+    auto_ref.m_jo = nullptr;
 }
 
 inline jobject JLocalAutoRef::release()
 {
     jobject jo = m_jo;
-    m_jo = NULL;
+    m_jo = nullptr;
     return jo;
 }
 
@@ -186,7 +186,7 @@ inline void JLocalAutoRef::reset( jobject jo )
 {
     if (jo != m_jo)
     {
-        if (NULL != m_jo)
+        if (nullptr != m_jo)
             m_jni->DeleteLocalRef( m_jo );
         m_jo = jo;
     }
@@ -196,7 +196,7 @@ inline JLocalAutoRef & JLocalAutoRef::operator = ( JLocalAutoRef & auto_ref )
 {
     assert( m_jni.get_jni_env() == auto_ref.m_jni.get_jni_env() );
     reset( auto_ref.m_jo );
-    auto_ref.m_jo = NULL;
+    auto_ref.m_jo = nullptr;
     return *this;
 }
 
@@ -219,7 +219,7 @@ struct rtl_mem
 inline rtl_mem * rtl_mem::allocate( ::std::size_t bytes )
 {
     void * p = rtl_allocateMemory( bytes );
-    if (NULL == p)
+    if (nullptr == p)
         throw BridgeRuntimeError( "out of memory!" );
     return static_cast<rtl_mem *>(p);
 }
@@ -242,10 +242,10 @@ public:
 };
 
 inline TypeDescr::TypeDescr( typelib_TypeDescriptionReference * td_ref )
-    : m_td( NULL )
+    : m_td( nullptr )
 {
     TYPELIB_DANGER_GET( &m_td, td_ref );
-    if (NULL == m_td)
+    if (nullptr == m_td)
     {
         throw BridgeRuntimeError(
             "cannot get comprehensive type description for " +
diff --git a/bridges/source/jni_uno/jni_helper.h b/bridges/source/jni_uno/jni_helper.h
index 43b0c96..a31e938 100644
--- a/bridges/source/jni_uno/jni_helper.h
+++ b/bridges/source/jni_uno/jni_helper.h
@@ -34,7 +34,7 @@ namespace jni_uno
 inline void jstring_to_ustring(
     JNI_context const & jni, rtl_uString ** out_ustr, jstring jstr )
 {
-    if (NULL == jstr)
+    if (nullptr == jstr)
     {
         rtl_uString_new( out_ustr );
     }
@@ -51,7 +51,7 @@ inline void jstring_to_ustring(
         ustr->length = len;
         ustr->buffer[ len ] = '\0';
         mem.release();
-        if (NULL != *out_ustr)
+        if (nullptr != *out_ustr)
             rtl_uString_release( *out_ustr );
         *out_ustr = ustr;
     }
@@ -60,7 +60,7 @@ inline void jstring_to_ustring(
 inline OUString jstring_to_oustring(
     JNI_context const & jni, jstring jstr )
 {
-    rtl_uString * ustr = NULL;
+    rtl_uString * ustr = nullptr;
     jstring_to_ustring( jni, &ustr, jstr );
     return OUString( ustr, SAL_NO_ACQUIRE );
 }
@@ -80,14 +80,14 @@ inline jclass find_class(
     JNI_context const & jni, char const * class_name, bool inException = false )
 {
     // find_class may be called before the JNI_info is set:
-    jclass c=NULL;
+    jclass c=nullptr;
     jmethodID m;
     JNI_info const * info = jni.get_info();
-    if (info == NULL) {
+    if (info == nullptr) {
         jni.getClassForName(&c, &m);
-        if (c == NULL) {
+        if (c == nullptr) {
             if (inException) {
-                return NULL;
+                return nullptr;
             }
             jni.ensure_no_exception();
         }
diff --git a/compilerplugins/clang/nullptr.cxx b/compilerplugins/clang/nullptr.cxx
index 8250d51..0ebbcde 100644
--- a/compilerplugins/clang/nullptr.cxx
+++ b/compilerplugins/clang/nullptr.cxx
@@ -9,6 +9,7 @@
 
 #include <cassert>
 #include <cstdlib>
+#include <limits>
 #include <set>
 
 #include "plugin.hxx"
@@ -59,6 +60,8 @@ public:
 
     bool TraverseConstructorInitializer(CXXCtorInitializer * init);
 
+    bool TraverseLinkageSpecDecl(LinkageSpecDecl * decl);
+
     // bool shouldVisitTemplateInstantiations() const { return true; }
 
 private:
@@ -66,6 +69,8 @@ private:
 
     bool isFromCIncludeFile(SourceLocation spellingLocation) const;
 
+    bool isSharedCAndCppCode(SourceLocation location) const;
+
     void visitCXXCtorInitializer(CXXCtorInitializer const * init);
 
     void handleZero(Expr const * expr);
@@ -80,6 +85,7 @@ private:
         char const * replacement);
 
     std::set<Expr const *> gnuNulls_;
+    unsigned int externCContexts_ = 0;
 };
 
 bool Nullptr::VisitImplicitCastExpr(CastExpr const * expr) {
@@ -202,6 +208,15 @@ bool Nullptr::TraverseConstructorInitializer(CXXCtorInitializer * init) {
     return RecursiveASTVisitor::TraverseConstructorInitializer(init);
 }
 
+bool Nullptr::TraverseLinkageSpecDecl(LinkageSpecDecl * decl) {
+    assert(externCContexts_ != std::numeric_limits<unsigned int>::max()); //TODO
+    ++externCContexts_;
+    bool ret = RecursiveASTVisitor::TraverseLinkageSpecDecl(decl);
+    assert(externCContexts_ != 0);
+    --externCContexts_;
+    return ret;
+}
+
 bool Nullptr::isInLokIncludeFile(SourceLocation spellingLocation) const {
     return compiler.getSourceManager().getFilename(spellingLocation)
         .startswith(SRCDIR "/include/LibreOfficeKit/");
@@ -215,6 +230,16 @@ bool Nullptr::isFromCIncludeFile(SourceLocation spellingLocation) const {
             .endswith(".h"));
 }
 
+bool Nullptr::isSharedCAndCppCode(SourceLocation location) const {
+    // Assume that code is intended to be shared between C and C++ if it comes
+    // from an include file ending in .h, and is either in an extern "C" context
+    // or the body of a macro definition:
+    return
+        isFromCIncludeFile(compiler.getSourceManager().getSpellingLoc(location))
+        && (externCContexts_ != 0
+            || compiler.getSourceManager().isMacroBodyExpansion(location));
+}
+
 void Nullptr::visitCXXCtorInitializer(CXXCtorInitializer const * init) {
     if (!init->isWritten()) {
         return;
@@ -273,12 +298,16 @@ void Nullptr::handleNull(
                 }
                 loc = compiler.getSourceManager()
                     .getImmediateExpansionRange(loc).first;
+                if (ignoreLocation(
+                        compiler.getSourceManager().getSpellingLoc(loc)))
+                {
+                    return;
+                }
                 if (isInUnoIncludeFile(
                         compiler.getSourceManager().getSpellingLoc(loc))
                     || isInLokIncludeFile(
                         compiler.getSourceManager().getSpellingLoc(loc))
-                    || isFromCIncludeFile(
-                        compiler.getSourceManager().getSpellingLoc(loc)))
+                    || isSharedCAndCppCode(loc))
                 {
                     //TODO: if !castKind, warn if NULL is passed into fn call
                     // ellipsis, cast to void*
@@ -309,7 +338,7 @@ void Nullptr::handleNull(
     auto const asMacro = !compiler.getLangOpts().CPlusPlus
         || isInUnoIncludeFile(compiler.getSourceManager().getSpellingLoc(loc))
         || isInLokIncludeFile(compiler.getSourceManager().getSpellingLoc(loc))
-        || isFromCIncludeFile(compiler.getSourceManager().getSpellingLoc(loc));
+        || isSharedCAndCppCode(loc);
     assert(!asMacro || nullPointerKind != Expr::NPCK_GNUNull);
     rewriteOrWarn(e, castKind, nullPointerKind, asMacro ? "NULL" : "nullptr");
 }
diff --git a/desktop/source/deployment/inc/dp_misc.h b/desktop/source/deployment/inc/dp_misc.h
index 59956e2..16cd442 100644
--- a/desktop/source/deployment/inc/dp_misc.h
+++ b/desktop/source/deployment/inc/dp_misc.h
@@ -97,7 +97,7 @@ DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
 css::uno::Reference< css::uno::XInterface> resolveUnoURL(
     OUString const & connectString,
     css::uno::Reference< css::uno::XComponentContext> const & xLocalContext,
-    AbortChannel * abortChannel = NULL );
+    AbortChannel * abortChannel = nullptr );
 
 
 DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool office_is_running();
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index a11a29b..aba4912 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h
@@ -74,7 +74,7 @@ inline bool readOption(
     bool * flag, OptionInfo const * option_info, sal_uInt32 * pIndex )
 {
     if (isOption( option_info, pIndex )) {
-        OSL_ASSERT( flag != NULL );
+        OSL_ASSERT( flag != nullptr );
         *flag = true;
         return true;
     }
diff --git a/hwpfilter/source/drawing.h b/hwpfilter/source/drawing.h
index c3fc245..00eef63 100644
--- a/hwpfilter/source/drawing.h
+++ b/hwpfilter/source/drawing.h
@@ -85,7 +85,7 @@ HWPDOFuncType HWPDOFuncTbl[] =
     HWPDOFreeFormFunc,
 };
 
-static HMemIODev *hmem = NULL;
+static HMemIODev *hmem = nullptr;
 
 static int count = 0;
 
@@ -299,7 +299,7 @@ static bool LoadCommonHeader(HWPDrawingObject * hdo, unsigned short * link_info)
         hdo->property.contrast = 0;
         hdo->property.greyscale = 0;
     }
-    hdo->property.pPara = NULL;
+    hdo->property.pPara = nullptr;
 
     if( ( size > common_size ) && (hdo->property.flag & HWPDO_FLAG_AS_TEXTBOX) )
     {
@@ -324,7 +324,7 @@ static HWPDrawingObject *LoadDrawingObject(void)
 
     unsigned short link_info;
 
-    head = prev = NULL;
+    head = prev = nullptr;
     do
     {
         hdo = new HWPDrawingObject;
@@ -342,7 +342,7 @@ static HWPDrawingObject *LoadDrawingObject(void)
         }
         else
         {
-            switch (int res = HWPDOFunc(hdo, OBJFUNC_LOAD, NULL, 0))
+            switch (int res = HWPDOFunc(hdo, OBJFUNC_LOAD, nullptr, 0))
             {
                 case OBJRET_FILE_ERROR:
                     goto error;
@@ -358,12 +358,12 @@ static HWPDrawingObject *LoadDrawingObject(void)
         if (link_info & HDOFILE_HAS_CHILD)
         {
             hdo->child = LoadDrawingObject();
-            if (hdo->child == NULL)
+            if (hdo->child == nullptr)
             {
                 goto error;
             }
         }
-        if (prev == NULL)
+        if (prev == nullptr)
             head = hdo;
         else
             prev->next = hdo;
@@ -376,23 +376,23 @@ static HWPDrawingObject *LoadDrawingObject(void)
 // drawing object can be list.
 // hdo = current item, head = list;
 
-    if (hdo != NULL)
+    if (hdo != nullptr)
     {
         if (hdo->type < 0 || hdo->type >= HWPDO_NITEMS)
         {
             hdo->type = HWPDO_RECT;
         }
 
-        HWPDOFunc(hdo, OBJFUNC_FREE, NULL, 0);
+        HWPDOFunc(hdo, OBJFUNC_FREE, nullptr, 0);
         delete hdo;
     }
     if( prev )
     {
-        prev->next = NULL;
+        prev->next = nullptr;
         return head;
     }
     else
-        return NULL;
+        return nullptr;
 }
 
 
@@ -423,7 +423,7 @@ static bool LoadDrawingObjectBlock(Picture * pic)
         return false;
 
     pic->picinfo.picdraw.hdo = LoadDrawingObject();
-    if (pic->picinfo.picdraw.hdo == NULL)
+    if (pic->picinfo.picdraw.hdo == nullptr)
         return false;
     return true;
 }
@@ -557,7 +557,7 @@ int cmd, void *argp, int argv)
     {
         case OBJFUNC_LOAD:
         {
-            hdo->u.freeform.pt = NULL;
+            hdo->u.freeform.pt = nullptr;
             if (ReadSizeField(4) < 4)
                 return OBJRET_FILE_ERROR;
             if (!hmem->read4b(hdo->u.freeform.npt))
@@ -575,7 +575,7 @@ int cmd, void *argp, int argv)
             {
                 hdo->u.freeform.pt =
                     ::comphelper::newArray_null<ZZPoint>(hdo->u.freeform.npt);
-                if (hdo->u.freeform.pt == NULL)
+                if (hdo->u.freeform.pt == nullptr)
                 {
                     hdo->u.freeform.npt = 0;
                     return OBJRET_FILE_ERROR;
@@ -625,7 +625,7 @@ static void FreeParaList(HWPPara * para)
 static HWPPara *LoadParaList()
 {
     if (!hmem)
-        return NULL;
+        return nullptr;
 
     HWPFile *hwpf = GetCurrentDoc();
     HIODev *hio = hwpf->SetIODevice(hmem);
@@ -635,7 +635,7 @@ static HWPPara *LoadParaList()
     hwpf->ReadParaList(plist);
     hwpf->SetIODevice(hio);
 
-    return plist.size()? plist.front() : NULL;
+    return plist.size()? plist.front() : nullptr;
 }
 
 
@@ -656,7 +656,7 @@ int cmd, void *argp, int argv)
             if (hdo->u.textbox.h)
             {
                 FreeParaList(hdo->u.textbox.h);
-                hdo->u.textbox.h = NULL;
+                hdo->u.textbox.h = nullptr;
             }
             break;
         default:
@@ -690,7 +690,7 @@ HWPDrawingObject::~HWPDrawingObject()
     if (next)
         delete next;
 
-    HWPDOFunc(this, OBJFUNC_FREE, NULL, 0);
+    HWPDOFunc(this, OBJFUNC_FREE, nullptr, 0);
 }
 #endif
 
diff --git a/hwpfilter/source/hbox.h b/hwpfilter/source/hbox.h
index 36b8a14..fd4b22a 100644
--- a/hwpfilter/source/hbox.h
+++ b/hwpfilter/source/hbox.h
@@ -281,7 +281,7 @@ struct FBoxStyle
         , boxnum(0)
         , boxtype(0)
         , cap_len(0)
-        , cell(NULL)
+        , cell(nullptr)
     {
         memset(margin, 0, sizeof(margin));
     }
@@ -521,7 +521,7 @@ struct TCell
 
 struct Table
 {
-     Table() : box(NULL) {};
+     Table() : box(nullptr) {};
      ~Table() {
           std::list<TCell*>::iterator it = cells.begin();
           for( ; it != cells.end(); ++it)
diff --git a/hwpfilter/source/hinfo.h b/hwpfilter/source/hinfo.h
index b080150..d16da5d 100644
--- a/hwpfilter/source/hinfo.h
+++ b/hwpfilter/source/hinfo.h
@@ -87,7 +87,7 @@ struct PaperBackInfo
         , flag(0)
         , range(0)
         , size(0)
-        , data(NULL)
+        , data(nullptr)
         , isset(false)
     {
         memset(reserved1, 0, sizeof(reserved1));
diff --git a/hwpfilter/source/hwpfile.h b/hwpfilter/source/hwpfile.h
index 497593f..36e332d 100644
--- a/hwpfilter/source/hwpfile.h
+++ b/hwpfilter/source/hwpfile.h
@@ -73,7 +73,7 @@ struct ColumnInfo{
     explicit ColumnInfo(int num){
         start_page = num;
         bIsSet = false;
-        coldef = NULL;
+        coldef = nullptr;
     }
 };
 
diff --git a/hwpfilter/source/nodes.h b/hwpfilter/source/nodes.h
index 5394522..60626c5 100644
--- a/hwpfilter/source/nodes.h
+++ b/hwpfilter/source/nodes.h
@@ -64,9 +64,9 @@ class Node{
 public:
      explicit Node(int _id) : id(_id)
      {
-          value = NULL;
-          child = NULL;
-          next = NULL;
+          value = nullptr;
+          child = nullptr;
+          next = nullptr;
 #ifdef NODE_DEBUG
           count++;
           printf("Node count : [%d]\n",count);
@@ -77,8 +77,8 @@ public:
           if( value ) free( value );
          // if( child ) delete child;
          // if( next ) delete next;
-          next = NULL;
-          child = NULL;
+          next = nullptr;
+          child = nullptr;
 #ifdef NODE_DEBUG
           count--;
           printf("Node count : [%d]\n",count);
diff --git a/opencl/inc/opencl_device_selection.h b/opencl/inc/opencl_device_selection.h
index 74d8d37..0b0ee4e 100644
--- a/opencl/inc/opencl_device_selection.h
+++ b/opencl/inc/opencl_device_selection.h
@@ -146,18 +146,18 @@ inline ds_status initDSProfile(std::unique_ptr<ds_profile>& rProfile, OString co
 
     rProfile = std::unique_ptr<ds_profile>(new ds_profile(rVersion));
 
-    clGetPlatformIDs(0, NULL, &numPlatforms);
+    clGetPlatformIDs(0, nullptr, &numPlatforms);
     if (numPlatforms != 0)
     {
         platforms.resize(numPlatforms);
-        clGetPlatformIDs(numPlatforms, platforms.data(), NULL);
+        clGetPlatformIDs(numPlatforms, platforms.data(), nullptr);
     }
 
     numDevices = 0;
     for (i = 0; i < (unsigned int)numPlatforms; i++)
     {
         cl_uint num = 0;
-        cl_int err = clGetDeviceIDs(platforms[i], CL_DEVICE_TYPE_ALL, 0, NULL, &num);
+        cl_int err = clGetDeviceIDs(platforms[i], CL_DEVICE_TYPE_ALL, 0, nullptr, &num);
         if (err != CL_SUCCESS)
         {
             /* we want to catch at least the case when the call returns
diff --git a/rsc/inc/rscall.h b/rsc/inc/rscall.h
index cacd6d2..91222df 100644
--- a/rsc/inc/rscall.h
+++ b/rsc/inc/rscall.h
@@ -78,19 +78,19 @@ struct RSCINST
     RscTop *    pClass;
     CLASS_DATA  pData;
 
-                RSCINST(){ pClass = NULL; pData = NULL; }
+                RSCINST(){ pClass = nullptr; pData = nullptr; }
                 RSCINST( RscTop * pCl, CLASS_DATA pClassData )
                     {
                         pClass = pCl;
                         pData = pClassData;
                     }
-    bool        IsInst() const { return( pData != NULL ); }
+    bool        IsInst() const { return( pData != nullptr ); }
 };
 
 /********************** S U B I N F O S T R U C T ************************/
 struct SUBINFO_STRUCT
 {
-    SUBINFO_STRUCT(){ nPos = 0; pClass = NULL; };
+    SUBINFO_STRUCT(){ nPos = 0; pClass = nullptr; };
     RscId        aId;    // Identifier der Resource
     sal_uInt32   nPos;   // Position der Resource
     RscTop *     pClass; // Klasse des Eintrages
diff --git a/rsc/inc/rscerror.h b/rsc/inc/rscerror.h
index 2f6a6a7..89bbe56 100644
--- a/rsc/inc/rscerror.h
+++ b/rsc/inc/rscerror.h
@@ -127,7 +127,7 @@ public:
     sal_uInt32  nErrors;// Anzahl der Fehler
                     RscError( RscVerbosity _verbosity )
                         {
-                            fListing = NULL;
+                            fListing = nullptr;
                             nErrors = 0;
                             m_verbosity = _verbosity;
                         }
@@ -138,11 +138,11 @@ public:
     static void     StdErr( const char * );
     void            LstOut( const char * );
     void            Error( const ERRTYPE& rError, RscTop* pClass, const RscId &aId,
-                           const char * pMessage = NULL );
+                           const char * pMessage = nullptr );
     // Dieser Fehler sollte nur im Compilermodus auftreten,
     // das Programm wird mit exit() verlassen
     void            FatalError( const ERRTYPE& rError, const RscId &aId,
-                                const char * pMessage = NULL );
+                                const char * pMessage = nullptr );
 };
 
 #endif // INCLUDED_RSC_INC_RSCERROR_H
diff --git a/sc/source/filter/inc/tool.h b/sc/source/filter/inc/tool.h
index 7ae3213..7f0b5d7 100644
--- a/sc/source/filter/inc/tool.h
+++ b/sc/source/filter/inc/tool.h
@@ -53,7 +53,7 @@ public:
                     FormIdent( void )
                     {
                         nStamp = 0;
-                        pAttr = NULL;
+                        pAttr = nullptr;
                     }
 
                     FormIdent( sal_uInt8 nFormat, sal_uInt8 nSt, SfxUInt32Item& rAttr )
diff --git a/stoc/source/security/lru_cache.h b/stoc/source/security/lru_cache.h
index 78523c5..d618773 100644
--- a/stoc/source/security/lru_cache.h
+++ b/stoc/source/security/lru_cache.h
@@ -90,7 +90,7 @@ inline void lru_cache< t_key, t_val, t_hashKey, t_equalKey >::setSize(
 {
     m_key2element.clear();
     delete [] m_block;
-    m_block = NULL;
+    m_block = nullptr;
     m_size = size;
 
     if (0 < m_size)
diff --git a/tools/inc/poly.h b/tools/inc/poly.h
index f15f01f..69d2de2 100644
--- a/tools/inc/poly.h
+++ b/tools/inc/poly.h
@@ -36,13 +36,13 @@ class SAL_WARN_UNUSED ImplPolygon  : public ImplPolygonData
 {
 public:
                     ImplPolygon( sal_uInt16 nInitSize, bool bFlags = false );
-                    ImplPolygon( sal_uInt16 nPoints, const Point* pPtAry, const sal_uInt8* pInitFlags = NULL );
+                    ImplPolygon( sal_uInt16 nPoints, const Point* pPtAry, const sal_uInt8* pInitFlags = nullptr );
                     ImplPolygon( const ImplPolygon& rImplPoly );
                     ~ImplPolygon();
 
     void            ImplSetSize( sal_uInt16 nSize, bool bResize = true );
     void            ImplCreateFlagArray();
-    void            ImplSplit( sal_uInt16 nPos, sal_uInt16 nSpace, ImplPolygon* pInitPoly = NULL );
+    void            ImplSplit( sal_uInt16 nPos, sal_uInt16 nSpace, ImplPolygon* pInitPoly = nullptr );
 };
 
 #define MAX_POLYGONS        ((sal_uInt16)0x3FF0)
@@ -61,7 +61,7 @@ public:
     sal_uInt16          mnResize;
 
                     ImplPolyPolygon( sal_uInt16 nInitSize, sal_uInt16 nResize )
-                        { mpPolyAry = NULL; mnCount = 0; mnRefCount = 1;
+                        { mpPolyAry = nullptr; mnCount = 0; mnRefCount = 1;
                           mnSize = nInitSize; mnResize = nResize; }
                     ImplPolyPolygon( sal_uInt16 nInitSize );
                     ImplPolyPolygon( const ImplPolyPolygon& rImplPolyPoly );
diff --git a/vcl/inc/toolbox.h b/vcl/inc/toolbox.h
index c3bf697..7fd621e 100644
--- a/vcl/inc/toolbox.h
+++ b/vcl/inc/toolbox.h
@@ -122,7 +122,7 @@ struct ImplToolBoxPrivateData
     ImplToolBoxPrivateData();
     ~ImplToolBoxPrivateData();
 
-    void ImplClearLayoutData() { delete m_pLayoutData; m_pLayoutData = NULL; }
+    void ImplClearLayoutData() { delete m_pLayoutData; m_pLayoutData = nullptr; }
 
     // called when dropdown items are clicked
     Link<ToolBox *, void> maDropdownClickHdl;
diff --git a/vcl/inc/unx/genpspgraphics.h b/vcl/inc/unx/genpspgraphics.h
index 339ec16..f38dc0e 100644
--- a/vcl/inc/unx/genpspgraphics.h
+++ b/vcl/inc/unx/genpspgraphics.h
@@ -75,7 +75,7 @@ public:
                                            const psp::FastPrintFontInfo& );
 
     // override all pure virtual methods
-    virtual SalGraphicsImpl*GetImpl() const override { return NULL; };
+    virtual SalGraphicsImpl*GetImpl() const override { return nullptr; };
     virtual void            GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) override;
     virtual sal_uInt16      GetBitCount() const override;
     virtual long            GetGraphicsWidth() const override;
diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h
index 3fd2072..f2c3122 100644
--- a/vcl/inc/unx/salframe.h
+++ b/vcl/inc/unx/salframe.h
@@ -158,12 +158,12 @@ class VCLPLUG_GEN_PUBLIC X11SalFrame : public SalFrame, public NativeWindowHandl
 
     void            updateWMClass();
 public:
-    X11SalFrame( SalFrame* pParent, SalFrameStyleFlags nSalFrameStyle, SystemParentData* pSystemParent = NULL );
+    X11SalFrame( SalFrame* pParent, SalFrameStyleFlags nSalFrameStyle, SystemParentData* pSystemParent = nullptr );
     virtual ~X11SalFrame();
 
     long            Dispatch( XEvent *pEvent );
     void            Init( SalFrameStyleFlags nSalFrameStyle, SalX11Screen nScreen = SalX11Screen( -1 ),
-                          SystemParentData* pParentData = NULL, bool bUseGeometry = false );
+                          SystemParentData* pParentData = nullptr, bool bUseGeometry = false );
 
     SalDisplay* GetDisplay() const
     {
@@ -178,7 +178,7 @@ public:
     ::Window                GetShellWindow() const { return mhShellWindow; }
     ::Window                GetForeignParent() const { return mhForeignParent; }
     ::Window                GetStackingWindow() const { return mhStackingWindow; }
-    void                    Close() const { CallCallback( SalEvent::Close, NULL ); }
+    void                    Close() const { CallCallback( SalEvent::Close, nullptr ); }
     SalFrameStyleFlags      GetStyle() const { return nStyle_; }
 
     Cursor                  GetCursor() const { return hCursor_; }
diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
index fb4d844..7cb0841 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -76,7 +76,7 @@ public:
     virtual                         ~X11SalGraphics();
 
     void                            Init( SalFrame *pFrame, Drawable aDrawable, SalX11Screen nXScreen );
-    void                            Init( X11SalVirtualDevice *pVirtualDevice, SalColormap* pColormap = NULL, bool bDeleteColormap = false );
+    void                            Init( X11SalVirtualDevice *pVirtualDevice, SalColormap* pColormap = nullptr, bool bDeleteColormap = false );
     void                            Init( X11OpenGLSalVirtualDevice *pVirtualDevice );
     void                            DeInit();
 
@@ -312,7 +312,7 @@ public:
 
 protected:
     using SalGraphics::SetClipRegion;
-    void                            SetClipRegion( GC pGC, Region pXReg = NULL ) const;
+    void                            SetClipRegion( GC pGC, Region pXReg = nullptr ) const;
     bool                            GetDitherPixmap ( SalColor nSalColor );
 
     using SalGraphics::DrawBitmap;
diff --git a/vcl/inc/unx/salinst.h b/vcl/inc/unx/salinst.h
index 8cb1014..d3f5fa7 100644
--- a/vcl/inc/unx/salinst.h
+++ b/vcl/inc/unx/salinst.h
@@ -60,7 +60,7 @@ public:
 
     virtual SalVirtualDevice*   CreateVirtualDevice( SalGraphics* pGraphics,
                                                      long &nDX, long &nDY,
-                                                     DeviceFormat eFormat, const SystemGraphicsData *pData = NULL ) override;
+                                                     DeviceFormat eFormat, const SystemGraphicsData *pData = nullptr ) override;
     virtual void                PostPrintersChanged() override;
     virtual GenPspGraphics     *CreatePrintGraphics() override;
 


More information about the Libreoffice-commits mailing list