Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
4a1edf62
Kaydet (Commit)
4a1edf62
authored
Ara 10, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
More loplugin:nullptr automatic rewrite (within templates)
Change-Id: I9bc06cfb5eeb38fd7ae7fb25f876ea9f96e4a65a
üst
46fe3bdd
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
104 additions
and
36 deletions
+104
-36
hommatrixtemplate.hxx
basegfx/source/inc/hommatrixtemplate.hxx
+1
-1
guardedarray.hxx
bridges/source/cpp_uno/shared/guardedarray.hxx
+1
-1
nullptr.cxx
compilerplugins/clang/store/nullptr.cxx
+68
-0
Reference.h
include/com/sun/star/uno/Reference.h
+1
-1
Reference.hxx
include/com/sun/star/uno/Reference.hxx
+4
-4
ref.hxx
include/rtl/ref.hxx
+4
-4
dynload.hxx
include/salhelper/dynload.hxx
+1
-1
singletonref.hxx
include/salhelper/singletonref.hxx
+1
-1
itemconnect.hxx
include/sfx2/itemconnect.hxx
+1
-1
ref.hxx
include/tools/ref.hxx
+10
-10
weakbase.hxx
include/tools/weakbase.hxx
+2
-2
math.cxx
sal/rtl/math.cxx
+2
-2
lru_cache.h
stoc/source/security/lru_cache.h
+1
-1
storbase.hxx
store/source/storbase.hxx
+5
-5
writerwordglue.cxx
sw/source/filter/ww8/writerwordglue.cxx
+2
-2
No files found.
basegfx/source/inc/hommatrixtemplate.hxx
Dosyayı görüntüle @
4a1edf62
...
...
@@ -200,7 +200,7 @@ namespace basegfx
if
(
!
bNecessary
)
{
delete
mpLine
;
mpLine
=
0L
;
mpLine
=
nullptr
;
}
}
}
...
...
bridges/source/cpp_uno/shared/guardedarray.hxx
Dosyayı görüntüle @
4a1edf62
...
...
@@ -30,7 +30,7 @@ public:
T
*
get
()
const
{
return
pointer
;
}
T
*
release
()
{
T
*
p
=
pointer
;
pointer
=
0
;
return
p
;
}
T
*
release
()
{
T
*
p
=
pointer
;
pointer
=
nullptr
;
return
p
;
}
private
:
GuardedArray
(
GuardedArray
&
)
=
delete
;
...
...
compilerplugins/clang/store/nullptr.cxx
Dosyayı görüntüle @
4a1edf62
...
...
@@ -44,6 +44,12 @@ public:
bool
VisitGNUNullExpr
(
GNUNullExpr
const
*
expr
);
bool
VisitBinaryOperator
(
BinaryOperator
const
*
expr
);
bool
VisitCXXOperatorCallExpr
(
CXXOperatorCallExpr
const
*
expr
);
// bool shouldVisitTemplateInstantiations() const { return true; }
private
:
bool
isInLokIncludeFile
(
SourceLocation
spellingLocation
)
const
;
...
...
@@ -111,6 +117,68 @@ bool Nullptr::VisitGNUNullExpr(GNUNullExpr const * expr) {
return
true
;
}
bool
Nullptr
::
VisitBinaryOperator
(
BinaryOperator
const
*
expr
)
{
if
(
ignoreLocation
(
expr
))
{
return
true
;
}
Expr
const
*
e
;
switch
(
expr
->
getOpcode
())
{
case
BO_EQ
:
case
BO_NE
:
if
(
expr
->
getRHS
()
->
getType
()
->
isPointerType
())
{
e
=
expr
->
getLHS
();
break
;
}
// fall through
case
BO_Assign
:
if
(
expr
->
getLHS
()
->
getType
()
->
isPointerType
())
{
e
=
expr
->
getRHS
();
break
;
}
// fall through
default
:
return
true
;
}
//TODO: detect NPCK_ZeroExpression where appropriate
auto
const
lit
=
dyn_cast
<
IntegerLiteral
>
(
e
->
IgnoreParenImpCasts
());
if
(
lit
==
nullptr
||
lit
->
getValue
().
getBoolValue
())
{
return
true
;
}
handleNull
(
e
,
nullptr
,
Expr
::
NPCK_ZeroLiteral
);
return
true
;
}
bool
Nullptr
::
VisitCXXOperatorCallExpr
(
CXXOperatorCallExpr
const
*
expr
)
{
if
(
ignoreLocation
(
expr
))
{
return
true
;
}
Expr
const
*
e
;
switch
(
expr
->
getOperator
())
{
case
OO_EqualEqual
:
case
OO_ExclaimEqual
:
if
(
expr
->
getArg
(
1
)
->
getType
()
->
isPointerType
())
{
e
=
expr
->
getArg
(
0
);
break
;
}
// fall through
case
OO_Equal
:
if
(
expr
->
getArg
(
0
)
->
getType
()
->
isPointerType
())
{
e
=
expr
->
getArg
(
1
);
break
;
}
// fall through
default
:
return
true
;
}
//TODO: detect NPCK_ZeroExpression where appropriate
auto
const
lit
=
dyn_cast
<
IntegerLiteral
>
(
e
->
IgnoreParenImpCasts
());
if
(
lit
==
nullptr
||
lit
->
getValue
().
getBoolValue
())
{
return
true
;
}
handleNull
(
e
,
nullptr
,
Expr
::
NPCK_ZeroLiteral
);
return
true
;
}
bool
Nullptr
::
isInLokIncludeFile
(
SourceLocation
spellingLocation
)
const
{
return
compiler
.
getSourceManager
().
getFilename
(
spellingLocation
)
.
startswith
(
SRCDIR
"/include/LibreOfficeKit/"
);
...
...
include/com/sun/star/uno/Reference.h
Dosyayı görüntüle @
4a1edf62
...
...
@@ -408,7 +408,7 @@ public:
@return UNacquired interface pointer
*/
inline
interface_type
*
SAL_CALL
operator
->
()
const
{
assert
(
_pInterface
!=
0
);
assert
(
_pInterface
!=
NULL
);
return
castFromXInterface
(
_pInterface
);
}
...
...
include/com/sun/star/uno/Reference.hxx
Dosyayı görüntüle @
4a1edf62
...
...
@@ -113,7 +113,7 @@ inline Reference< interface_type >::~Reference()
template
<
class
interface_type
>
inline
Reference
<
interface_type
>::
Reference
()
{
_pInterface
=
0
;
_pInterface
=
NULL
;
}
template
<
class
interface_type
>
...
...
@@ -221,7 +221,7 @@ inline void Reference< interface_type >::clear()
if
(
_pInterface
)
{
XInterface
*
const
pOld
=
_pInterface
;
_pInterface
=
0
;
_pInterface
=
NULL
;
pOld
->
release
();
}
}
...
...
@@ -236,7 +236,7 @@ inline bool Reference< interface_type >::set(
_pInterface
=
castToXInterface
(
pInterface
);
if
(
pOld
)
pOld
->
release
();
return
(
0
!=
pInterface
);
return
(
NULL
!=
pInterface
);
}
template
<
class
interface_type
>
...
...
@@ -247,7 +247,7 @@ inline bool Reference< interface_type >::set(
_pInterface
=
castToXInterface
(
pInterface
);
if
(
pOld
)
pOld
->
release
();
return
(
0
!=
pInterface
);
return
(
NULL
!=
pInterface
);
}
template
<
class
interface_type
>
...
...
include/rtl/ref.hxx
Dosyayı görüntüle @
4a1edf62
...
...
@@ -153,7 +153,7 @@ public:
if
(
m_pBody
)
{
reference_type
*
const
pOld
=
m_pBody
;
m_pBody
=
0
;
m_pBody
=
NULL
;
pOld
->
release
();
}
return
*
this
;
...
...
@@ -174,7 +174,7 @@ public:
*/
inline
reference_type
*
SAL_CALL
operator
->
()
const
{
assert
(
m_pBody
!=
0
);
assert
(
m_pBody
!=
NULL
);
return
m_pBody
;
}
...
...
@@ -183,7 +183,7 @@ public:
*/
inline
reference_type
&
SAL_CALL
operator
*
()
const
{
assert
(
m_pBody
!=
0
);
assert
(
m_pBody
!=
NULL
);
return
*
m_pBody
;
}
...
...
@@ -192,7 +192,7 @@ public:
*/
inline
bool
SAL_CALL
is
()
const
{
return
(
m_pBody
!=
0
);
return
(
m_pBody
!=
NULL
);
}
...
...
include/salhelper/dynload.hxx
Dosyayı görüntüle @
4a1edf62
...
...
@@ -108,7 +108,7 @@ public:
/// Default constructor
ODynamicLoader
()
{
m_pLoader
=
0
;
m_pLoader
=
NULL
;
}
/** Constructor, loads the library if necessary otherwise the refernece count will
...
...
include/salhelper/singletonref.hxx
Dosyayı görüntüle @
4a1edf62
...
...
@@ -128,7 +128,7 @@ class SingletonRef
if
(
m_nRef
==
0
)
{
delete
m_pInstance
;
m_pInstance
=
0
;
m_pInstance
=
NULL
;
}
// <- GLOBAL SAFE
}
...
...
include/sfx2/itemconnect.hxx
Dosyayı görüntüle @
4a1edf62
...
...
@@ -473,7 +473,7 @@ template< typename ItemWrpT, typename ControlWrpT >
void
ItemControlConnection
<
ItemWrpT
,
ControlWrpT
>::
Reset
(
const
SfxItemSet
&
rItemSet
)
{
const
ItemType
*
pItem
=
maItemWrp
.
GetUniqueItem
(
rItemSet
);
mxCtrlWrp
->
SetControlDontKnow
(
pItem
==
0
);
mxCtrlWrp
->
SetControlDontKnow
(
pItem
==
nullptr
);
if
(
pItem
)
mxCtrlWrp
->
SetControlValue
(
maItemWrp
.
GetItemValue
(
*
pItem
)
);
}
...
...
include/tools/ref.hxx
Dosyayı görüntüle @
4a1edf62
...
...
@@ -36,24 +36,24 @@ public:
SvRef
(
SvRef
const
&
rObj
)
:
pObj
(
rObj
.
pObj
)
{
if
(
pObj
!=
0
)
pObj
->
AddNextRef
();
if
(
pObj
!=
nullptr
)
pObj
->
AddNextRef
();
}
SvRef
(
T
*
pObjP
)
:
pObj
(
pObjP
)
{
if
(
pObj
!=
0
)
pObj
->
AddFirstRef
();
if
(
pObj
!=
nullptr
)
pObj
->
AddFirstRef
();
}
~
SvRef
()
{
if
(
pObj
!=
0
)
pObj
->
ReleaseRef
();
if
(
pObj
!=
nullptr
)
pObj
->
ReleaseRef
();
}
void
Clear
()
{
if
(
pObj
!=
0
)
{
if
(
pObj
!=
nullptr
)
{
T
*
pRefObj
=
pObj
;
pObj
=
0
;
pObj
=
nullptr
;
pRefObj
->
ReleaseRef
();
}
}
...
...
@@ -65,21 +65,21 @@ public:
}
T
*
pRefObj
=
pObj
;
pObj
=
rObj
.
pObj
;
if
(
pRefObj
!=
0
)
{
if
(
pRefObj
!=
nullptr
)
{
pRefObj
->
ReleaseRef
();
}
return
*
this
;
}
bool
Is
()
const
{
return
pObj
!=
0
;
}
bool
Is
()
const
{
return
pObj
!=
nullptr
;
}
T
*
get
()
const
{
return
pObj
;
}
T
*
operator
&
()
const
{
return
pObj
;
}
T
*
operator
->
()
const
{
assert
(
pObj
!=
0
);
return
pObj
;
}
T
*
operator
->
()
const
{
assert
(
pObj
!=
nullptr
);
return
pObj
;
}
T
&
operator
*
()
const
{
assert
(
pObj
!=
0
);
return
*
pObj
;
}
T
&
operator
*
()
const
{
assert
(
pObj
!=
nullptr
);
return
*
pObj
;
}
operator
T
*
()
const
{
return
pObj
;
}
...
...
@@ -157,7 +157,7 @@ class SvCompatWeakHdl : public SvRefBase
SvCompatWeakHdl
(
T
*
pObj
)
:
_pObj
(
pObj
)
{}
public
:
void
ResetWeakBase
(
)
{
_pObj
=
0
;
}
void
ResetWeakBase
(
)
{
_pObj
=
nullptr
;
}
T
*
GetObj
()
{
return
_pObj
;
}
};
...
...
include/tools/weakbase.hxx
Dosyayı görüntüle @
4a1edf62
...
...
@@ -137,7 +137,7 @@ inline WeakReference<reference_type>& WeakReference<reference_type>::operator= (
template
<
class
reference_type
>
inline
WeakBase
<
reference_type
>::
WeakBase
()
{
mpWeakConnection
=
0
;
mpWeakConnection
=
nullptr
;
}
template
<
class
reference_type
>
...
...
@@ -147,7 +147,7 @@ inline WeakBase< reference_type >::~WeakBase()
{
mpWeakConnection
->
mpReference
=
0
;
mpWeakConnection
->
release
();
mpWeakConnection
=
0
;
mpWeakConnection
=
nullptr
;
}
}
...
...
sal/rtl/math.cxx
Dosyayı görüntüle @
4a1edf62
...
...
@@ -296,7 +296,7 @@ inline void doubleToString(StringT ** pResult,
{
pBuf
=
static_cast
<
typename
T
::
Char
*
>
(
rtl_allocateMemory
(
nBuf
*
sizeof
(
typename
T
::
Char
)));
OSL_ENSURE
(
pBuf
!=
0
,
"Out of memory"
);
OSL_ENSURE
(
pBuf
!=
nullptr
,
"Out of memory"
);
}
else
pBuf
=
aBuf
;
...
...
@@ -787,7 +787,7 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd,
if
(
pStatus
!=
nullptr
)
*
pStatus
=
eStatus
;
if
(
pParsedEnd
!=
0
)
if
(
pParsedEnd
!=
nullptr
)
*
pParsedEnd
=
p
==
p0
?
pBegin
:
p
;
return
fVal
;
...
...
stoc/source/security/lru_cache.h
Dosyayı görüntüle @
4a1edf62
...
...
@@ -95,7 +95,7 @@ inline void lru_cache< t_key, t_val, t_hashKey, t_equalKey >::setSize(
{
m_key2element
.
clear
();
delete
[]
m_block
;
m_block
=
0
;
m_block
=
NULL
;
m_size
=
size
;
if
(
0
<
m_size
)
...
...
store/source/storbase.hxx
Dosyayı görüntüle @
4a1edf62
...
...
@@ -688,26 +688,26 @@ public:
T
*
operator
->
()
{
T
*
pImpl
=
dynamic_page_cast
<
T
>
(
m_xPage
.
get
());
OSL_PRECOND
(
pImpl
!=
0
,
"store::PageHolder<T>::operator*(): Null pointer"
);
OSL_PRECOND
(
pImpl
!=
nullptr
,
"store::PageHolder<T>::operator*(): Null pointer"
);
return
pImpl
;
}
T
const
*
operator
->
()
const
{
T
const
*
pImpl
=
dynamic_page_cast
<
T
>
(
m_xPage
.
get
());
OSL_PRECOND
(
pImpl
!=
0
,
"store::PageHolder<T>::operator*(): Null pointer"
);
OSL_PRECOND
(
pImpl
!=
nullptr
,
"store::PageHolder<T>::operator*(): Null pointer"
);
return
pImpl
;
}
T
&
operator
*
()
{
T
*
pImpl
=
dynamic_page_cast
<
T
>
(
m_xPage
.
get
());
OSL_PRECOND
(
pImpl
!=
0
,
"store::PageHolder<T>::operator*(): Null pointer"
);
OSL_PRECOND
(
pImpl
!=
nullptr
,
"store::PageHolder<T>::operator*(): Null pointer"
);
return
(
*
pImpl
);
}
T
const
&
operator
*
()
const
{
T
const
*
pImpl
=
dynamic_page_cast
<
T
>
(
m_xPage
.
get
());
OSL_PRECOND
(
pImpl
!=
0
,
"store::PageHolder<T>::operator*(): Null pointer"
);
OSL_PRECOND
(
pImpl
!=
nullptr
,
"store::PageHolder<T>::operator*(): Null pointer"
);
return
(
*
pImpl
);
}
...
...
@@ -719,7 +719,7 @@ public:
pHead
->
guard
(
nAddr
);
T
*
pImpl
=
dynamic_page_cast
<
T
>
(
pHead
);
OSL_PRECOND
(
pImpl
!=
0
,
"store::PageHolder<T>::guard(): Null pointer"
);
OSL_PRECOND
(
pImpl
!=
nullptr
,
"store::PageHolder<T>::guard(): Null pointer"
);
pImpl
->
guard
();
return
store_E_None
;
...
...
sw/source/filter/ww8/writerwordglue.cxx
Dosyayı görüntüle @
4a1edf62
...
...
@@ -256,14 +256,14 @@ namespace myImplHelpers
//If we've used it once, don't reuse it
if
(
pRet
&&
(
maUsedStyles
.
end
()
!=
maUsedStyles
.
find
(
pRet
)))
pRet
=
0
;
pRet
=
nullptr
;
if
(
!
pRet
)
{
pRet
=
maHelper
.
GetStyle
(
rName
);
//If we've used it once, don't reuse it
if
(
pRet
&&
(
maUsedStyles
.
end
()
!=
maUsedStyles
.
find
(
pRet
)))
pRet
=
0
;
pRet
=
nullptr
;
}
bool
bStyExist
=
pRet
!=
nullptr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment