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
d2f9f277
Kaydet (Commit)
d2f9f277
authored
Mar 30, 2016
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:nullptr: Find some more cases in templates
Change-Id: I1f127d56e40b04f2b4df85c0afbcfd424d68a8cc
üst
14060e76
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
85 additions
and
33 deletions
+85
-33
hommatrixtemplate.hxx
basegfx/source/inc/hommatrixtemplate.hxx
+1
-1
nullptr.cxx
compilerplugins/clang/nullptr.cxx
+62
-10
unique_disposing_ptr.hxx
include/comphelper/unique_disposing_ptr.hxx
+4
-4
ref.hxx
include/rtl/ref.hxx
+1
-1
controlwrapper.hxx
include/sfx2/controlwrapper.hxx
+3
-3
itemconnect.hxx
include/sfx2/itemconnect.hxx
+2
-2
scopedbitmapaccess.hxx
include/vcl/scopedbitmapaccess.hxx
+1
-1
clone.hxx
lotuswordpro/source/filter/clone.hxx
+1
-1
lrucache.hxx
stoc/source/corereflection/lrucache.hxx
+3
-3
lru_cache.h
stoc/source/security/lru_cache.h
+5
-5
regexpmap.hxx
ucb/source/inc/regexpmap.hxx
+2
-2
No files found.
basegfx/source/inc/hommatrixtemplate.hxx
Dosyayı görüntüle @
d2f9f277
...
...
@@ -48,7 +48,7 @@ namespace basegfx
{
}
explicit
ImplMatLine
(
sal_uInt16
nRow
,
ImplMatLine
<
RowSize
>*
pToBeCopied
=
0L
)
explicit
ImplMatLine
(
sal_uInt16
nRow
,
ImplMatLine
<
RowSize
>*
pToBeCopied
=
nullptr
)
{
if
(
pToBeCopied
)
{
...
...
compilerplugins/clang/nullptr.cxx
Dosyayı görüntüle @
d2f9f277
...
...
@@ -51,6 +51,10 @@ public:
bool
VisitCXXOperatorCallExpr
(
CXXOperatorCallExpr
const
*
expr
);
bool
VisitParmVarDecl
(
ParmVarDecl
const
*
decl
);
bool
TraverseConstructorInitializer
(
CXXCtorInitializer
*
init
);
// bool shouldVisitTemplateInstantiations() const { return true; }
private
:
...
...
@@ -60,6 +64,10 @@ private:
bool
isMacroBodyExpansion
(
SourceLocation
location
)
const
;
void
visitCXXCtorInitializer
(
CXXCtorInitializer
const
*
init
);
void
handleZero
(
Expr
const
*
expr
);
void
handleNull
(
Expr
const
*
expr
,
char
const
*
castKind
,
Expr
::
NullPointerConstantKind
nullPointerKind
);
...
...
@@ -142,12 +150,7 @@ bool Nullptr::VisitBinaryOperator(BinaryOperator const * expr) {
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
);
handleZero
(
e
);
return
true
;
}
...
...
@@ -173,15 +176,30 @@ bool Nullptr::VisitCXXOperatorCallExpr(CXXOperatorCallExpr const * expr) {
default
:
return
true
;
}
//TODO: detect NPCK_ZeroExpression where appropriate
auto
const
lit
=
dyn_cast
<
IntegerLiteral
>
(
e
->
IgnoreParenImpCasts
());
if
(
lit
==
nullptr
||
lit
->
getValue
().
getBoolValue
())
{
handleZero
(
e
);
return
true
;
}
bool
Nullptr
::
VisitParmVarDecl
(
ParmVarDecl
const
*
decl
)
{
if
(
ignoreLocation
(
decl
))
{
return
true
;
}
if
(
!
decl
->
getType
()
->
isPointerType
())
{
return
true
;
}
auto
e
=
decl
->
getDefaultArg
();
if
(
e
==
nullptr
)
{
return
true
;
}
handle
Null
(
e
,
nullptr
,
Expr
::
NPCK_ZeroLiteral
);
handle
Zero
(
e
);
return
true
;
}
bool
Nullptr
::
TraverseConstructorInitializer
(
CXXCtorInitializer
*
init
)
{
visitCXXCtorInitializer
(
init
);
return
RecursiveASTVisitor
::
TraverseConstructorInitializer
(
init
);
}
bool
Nullptr
::
isInLokIncludeFile
(
SourceLocation
spellingLocation
)
const
{
return
compiler
.
getSourceManager
().
getFilename
(
spellingLocation
)
.
startswith
(
SRCDIR
"/include/LibreOfficeKit/"
);
...
...
@@ -204,6 +222,40 @@ bool Nullptr::isMacroBodyExpansion(SourceLocation location) const {
#endif
}
void
Nullptr
::
visitCXXCtorInitializer
(
CXXCtorInitializer
const
*
init
)
{
if
(
!
init
->
isWritten
())
{
return
;
}
auto
e
=
init
->
getInit
();
if
(
ignoreLocation
(
e
))
{
return
;
}
auto
d
=
init
->
getAnyMember
();
if
(
d
==
nullptr
||
!
d
->
getType
()
->
isPointerType
())
{
return
;
}
if
(
auto
e2
=
dyn_cast
<
ParenListExpr
>
(
e
))
{
if
(
e2
->
getNumExprs
()
!=
1
)
{
return
;
}
e
=
e2
->
getExpr
(
0
);
}
else
if
(
auto
e2
=
dyn_cast
<
InitListExpr
>
(
e
))
{
if
(
e2
->
getNumInits
()
!=
1
)
{
return
;
}
e
=
e2
->
getInit
(
0
);
}
handleZero
(
e
);
}
void
Nullptr
::
handleZero
(
Expr
const
*
expr
)
{
//TODO: detect NPCK_ZeroExpression where appropriate
auto
const
lit
=
dyn_cast
<
IntegerLiteral
>
(
expr
->
IgnoreParenImpCasts
());
if
(
lit
!=
nullptr
&&
!
lit
->
getValue
().
getBoolValue
())
{
handleNull
(
expr
,
nullptr
,
Expr
::
NPCK_ZeroLiteral
);
}
}
void
Nullptr
::
handleNull
(
Expr
const
*
expr
,
char
const
*
castKind
,
Expr
::
NullPointerConstantKind
nullPointerKind
)
...
...
include/comphelper/unique_disposing_ptr.hxx
Dosyayı görüntüle @
d2f9f277
...
...
@@ -30,13 +30,13 @@ private:
unique_disposing_ptr
(
const
unique_disposing_ptr
&
)
=
delete
;
unique_disposing_ptr
&
operator
=
(
const
unique_disposing_ptr
&
)
=
delete
;
public
:
unique_disposing_ptr
(
const
css
::
uno
::
Reference
<
css
::
lang
::
XComponent
>
&
rComponent
,
T
*
p
=
0
)
unique_disposing_ptr
(
const
css
::
uno
::
Reference
<
css
::
lang
::
XComponent
>
&
rComponent
,
T
*
p
=
nullptr
)
:
m_xItem
(
p
)
{
m_xTerminateListener
=
new
TerminateListener
(
rComponent
,
*
this
);
}
virtual
void
reset
(
T
*
p
=
0
)
virtual
void
reset
(
T
*
p
=
nullptr
)
{
m_xItem
.
reset
(
p
);
}
...
...
@@ -141,12 +141,12 @@ template<class T> class unique_disposing_solar_mutex_reset_ptr
:
public
unique_disposing_ptr
<
T
>
{
public
:
unique_disposing_solar_mutex_reset_ptr
(
const
css
::
uno
::
Reference
<
css
::
lang
::
XComponent
>
&
rComponent
,
T
*
p
=
0
)
unique_disposing_solar_mutex_reset_ptr
(
const
css
::
uno
::
Reference
<
css
::
lang
::
XComponent
>
&
rComponent
,
T
*
p
=
nullptr
)
:
unique_disposing_ptr
<
T
>
(
rComponent
,
p
)
{
}
virtual
void
reset
(
T
*
p
=
0
)
override
virtual
void
reset
(
T
*
p
=
nullptr
)
override
{
SolarMutexGuard
aGuard
;
unique_disposing_ptr
<
T
>::
reset
(
p
);
...
...
include/rtl/ref.hxx
Dosyayı görüntüle @
d2f9f277
...
...
@@ -43,7 +43,7 @@ public:
/** Constructor...
*/
inline
Reference
()
:
m_pBody
(
0
)
:
m_pBody
(
NULL
)
{}
...
...
include/sfx2/controlwrapper.hxx
Dosyayı görüntüle @
d2f9f277
...
...
@@ -79,7 +79,7 @@ public:
is used (simply casting between list position and values). If the map
exists, it *MUST* be terminated by an entry containing the special
"not found" list position. */
inline
explicit
PosValueMapper
(
PosT
nNFPos
,
const
MapEntryType
*
pMap
=
0
)
:
inline
explicit
PosValueMapper
(
PosT
nNFPos
,
const
MapEntryType
*
pMap
=
nullptr
)
:
mpMap
(
pMap
),
mnNFPos
(
nNFPos
)
{}
/** Returns the value at the specified list position.
...
...
@@ -325,7 +325,7 @@ public:
/** @param pMap Optional list position <-> value map.
See PosValueMapper documentation for details. */
inline
explicit
ListBoxWrapper
(
ListBox
&
rListBox
,
const
MapEntryType
*
pMap
=
0
)
:
inline
explicit
ListBoxWrapper
(
ListBox
&
rListBox
,
const
MapEntryType
*
pMap
=
nullptr
)
:
SingleControlWrapper
<
ListBox
,
ValueT
>
(
rListBox
),
MapperType
(
WRAPPER_LISTBOX_ENTRY_NOTFOUND
,
pMap
)
{}
virtual
bool
IsControlDontKnow
()
const
SAL_OVERRIDE
...
...
@@ -358,7 +358,7 @@ public:
/** @param pMap Optional position <-> value map.
See PosValueMapper documentation for details. */
inline
explicit
ValueSetWrapper
(
ValueSet
&
rValueSet
,
const
MapEntryType
*
pMap
=
0
)
:
inline
explicit
ValueSetWrapper
(
ValueSet
&
rValueSet
,
const
MapEntryType
*
pMap
=
nullptr
)
:
SingleControlWrapper
<
ValueSet
,
ValueT
>
(
rValueSet
),
MapperType
(
WRAPPER_VALUESET_ITEM_NOTFOUND
,
pMap
)
{}
virtual
bool
IsControlDontKnow
()
const
SAL_OVERRIDE
...
...
include/sfx2/itemconnect.hxx
Dosyayı görüntüle @
d2f9f277
...
...
@@ -354,7 +354,7 @@ public:
typedef
typename
ListBoxWrapperType
::
MapEntryType
MapEntryType
;
explicit
ListBoxConnection
(
sal_uInt16
nSlot
,
ListBox
&
rListBox
,
const
MapEntryType
*
pMap
=
0
,
ItemConnFlags
nFlags
=
ITEMCONN_DEFAULT
);
const
MapEntryType
*
pMap
=
nullptr
,
ItemConnFlags
nFlags
=
ITEMCONN_DEFAULT
);
};
...
...
@@ -379,7 +379,7 @@ public:
typedef
typename
ValueSetWrapperType
::
MapEntryType
MapEntryType
;
explicit
ValueSetConnection
(
sal_uInt16
nSlot
,
ValueSet
&
rValueSet
,
const
MapEntryType
*
pMap
=
0
,
ItemConnFlags
nFlags
=
ITEMCONN_DEFAULT
);
const
MapEntryType
*
pMap
=
nullptr
,
ItemConnFlags
nFlags
=
ITEMCONN_DEFAULT
);
};
...
...
include/vcl/scopedbitmapaccess.hxx
Dosyayı görüntüle @
d2f9f277
...
...
@@ -50,7 +50,7 @@ template < class Access, class Bitmap, Access* (Bitmap::* Acquire)() > class Sco
public
:
explicit
ScopedBitmapAccess
(
Bitmap
&
rBitmap
)
:
mpAccess
(
0
),
mpAccess
(
nullptr
),
mrBitmap
(
rBitmap
)
{
mpAccess
=
(
mrBitmap
.
*
Acquire
)();
...
...
lotuswordpro/source/filter/clone.hxx
Dosyayı görüntüle @
d2f9f277
...
...
@@ -23,7 +23,7 @@ struct has_clone
typedef
struct
{
char
a
[
2
];
}
no
;
template
<
typename
U
>
static
yes
&
check_sig
(
U
*
,
test
<
U
*
(
U
::*
)()
const
,
&
U
::
clone
>*
=
0
);
static
yes
&
check_sig
(
U
*
,
test
<
U
*
(
U
::*
)()
const
,
&
U
::
clone
>*
=
nullptr
);
template
<
typename
U
>
static
no
&
check_sig
(...);
...
...
stoc/source/corereflection/lrucache.hxx
Dosyayı görüntüle @
d2f9f277
...
...
@@ -90,9 +90,9 @@ inline LRU_Cache< t_Key, t_Val, t_KeyHash >::LRU_Cache( sal_Int32 nCachedElement
#else
:
_nCachedElements
(
nCachedElements
)
#endif
,
_pBlock
(
0
)
,
_pHead
(
0
)
,
_pTail
(
0
)
,
_pBlock
(
nullptr
)
,
_pHead
(
nullptr
)
,
_pTail
(
nullptr
)
{
if
(
_nCachedElements
>
0
)
{
...
...
stoc/source/security/lru_cache.h
Dosyayı görüntüle @
d2f9f277
...
...
@@ -115,8 +115,8 @@ template< typename t_key, typename t_val, typename t_hashKey, typename t_equalKe
inline
lru_cache
<
t_key
,
t_val
,
t_hashKey
,
t_equalKey
>::
lru_cache
(
::
std
::
size_t
size
)
:
m_size
(
0
)
,
m_block
(
0
)
,
m_tail
(
0
)
,
m_block
(
nullptr
)
,
m_tail
(
nullptr
)
{
setSize
(
size
);
}
...
...
@@ -124,9 +124,9 @@ inline lru_cache< t_key, t_val, t_hashKey, t_equalKey >::lru_cache(
template
<
typename
t_key
,
typename
t_val
,
typename
t_hashKey
,
typename
t_equalKey
>
inline
lru_cache
<
t_key
,
t_val
,
t_hashKey
,
t_equalKey
>::
lru_cache
()
:
m_size
(
0
)
,
m_block
(
0
)
,
m_head
(
0
)
,
m_tail
(
0
)
,
m_block
(
nullptr
)
,
m_head
(
nullptr
)
,
m_tail
(
nullptr
)
{
}
...
...
ucb/source/inc/regexpmap.hxx
Dosyayı görüntüle @
d2f9f277
...
...
@@ -75,7 +75,7 @@ struct RegexpMapImpl
List
<
Val
>
m_aList
[
Regexp
::
KIND_DOMAIN
+
1
];
Entry
<
Val
>
*
m_pDefault
;
RegexpMapImpl
()
:
m_pDefault
(
0
)
{}
RegexpMapImpl
()
:
m_pDefault
(
nullptr
)
{}
~
RegexpMapImpl
()
{
delete
m_pDefault
;
}
};
...
...
@@ -126,7 +126,7 @@ private:
template
<
typename
Val
>
inline
RegexpMapIterImpl
<
Val
>::
RegexpMapIterImpl
()
:
m_aEntry
(
rtl
::
OUString
(),
0
),
m_pMap
(
0
),
m_pMap
(
nullptr
),
m_nList
(
-
1
),
m_bEntrySet
(
false
)
{}
...
...
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