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
31498259
Kaydet (Commit)
31498259
authored
Ock 09, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:cstylecast: warn about certain redundant reinterpret_casts
Change-Id: Iaa46849742c215798722d03d9ee59bb39d8033f7
üst
97a8b3ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
unmarshal.cxx
binaryurp/source/unmarshal.cxx
+1
-1
cstylecast.cxx
compilerplugins/clang/cstylecast.cxx
+28
-0
No files found.
binaryurp/source/unmarshal.cxx
Dosyayı görüntüle @
31498259
...
@@ -465,7 +465,7 @@ BinaryAny Unmarshal::readSequence(css::uno::TypeDescription const & type) {
...
@@ -465,7 +465,7 @@ BinaryAny Unmarshal::readSequence(css::uno::TypeDescription const & type) {
static_cast
<
sal_Sequence
*
>
(
buf
)
->
elements
+
i
*
ctd
.
get
()
->
nSize
,
static_cast
<
sal_Sequence
*
>
(
buf
)
->
elements
+
i
*
ctd
.
get
()
->
nSize
,
const_cast
<
void
*
>
(
as
[
i
].
getValue
(
ctd
)),
ctd
.
get
(),
0
);
const_cast
<
void
*
>
(
as
[
i
].
getValue
(
ctd
)),
ctd
.
get
(),
0
);
}
}
return
BinaryAny
(
type
,
reinterpret_cast
<
sal_Sequence
**
>
(
&
buf
)
);
return
BinaryAny
(
type
,
&
buf
);
}
}
void
Unmarshal
::
readMemberValues
(
void
Unmarshal
::
readMemberValues
(
...
...
compilerplugins/clang/cstylecast.cxx
Dosyayı görüntüle @
31498259
...
@@ -47,6 +47,8 @@ public:
...
@@ -47,6 +47,8 @@ public:
bool
VisitCStyleCastExpr
(
const
CStyleCastExpr
*
expr
);
bool
VisitCStyleCastExpr
(
const
CStyleCastExpr
*
expr
);
bool
VisitImplicitCastExpr
(
ImplicitCastExpr
const
*
expr
);
private
:
private
:
bool
externCFunction
;
bool
externCFunction
;
};
};
...
@@ -136,6 +138,32 @@ bool CStyleCast::VisitCStyleCastExpr(const CStyleCastExpr * expr) {
...
@@ -136,6 +138,32 @@ bool CStyleCast::VisitCStyleCastExpr(const CStyleCastExpr * expr) {
return
true
;
return
true
;
}
}
bool
CStyleCast
::
VisitImplicitCastExpr
(
const
ImplicitCastExpr
*
expr
)
{
if
(
ignoreLocation
(
expr
)
||
expr
->
getCastKind
()
!=
CK_BitCast
)
{
return
true
;
}
QualType
t
=
expr
->
getType
();
if
(
!
(
t
->
isPointerType
()
&&
t
->
getAs
<
PointerType
>
()
->
getPointeeType
()
->
isVoidType
()
&&
expr
->
getSubExpr
()
->
getType
()
->
isPointerType
()))
{
return
true
;
}
Expr
const
*
e
=
expr
->
getSubExpr
()
->
IgnoreParenImpCasts
();
while
(
isa
<
CXXConstCastExpr
>
(
e
))
{
e
=
dyn_cast
<
CXXConstCastExpr
>
(
e
)
->
getSubExpr
()
->
IgnoreParenImpCasts
();
}
if
(
isa
<
CXXReinterpretCastExpr
>
(
e
))
{
report
(
DiagnosticsEngine
::
Warning
,
(
"redundant reinterpret_cast, result is implicitly cast to void"
" pointer"
),
e
->
getExprLoc
())
<<
e
->
getSourceRange
();
}
return
true
;
}
loplugin
::
Plugin
::
Registration
<
CStyleCast
>
X
(
"cstylecast"
);
loplugin
::
Plugin
::
Registration
<
CStyleCast
>
X
(
"cstylecast"
);
}
}
...
...
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