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
0bfc98e6
Kaydet (Commit)
0bfc98e6
authored
May 12, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:redundantcast: reinterpret_cast to void*
Change-Id: I947b49cfb15f0e7d6ddfaae386656c70e4bd48ba
üst
4e871a9b
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
55 additions
and
42 deletions
+55
-42
redundantcast.cxx
compilerplugins/clang/redundantcast.cxx
+44
-30
helper_purpenv_Proxy.cxx
cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx
+1
-1
intercept.cxx
dbaccess/source/core/dataaccess/intercept.cxx
+1
-1
AppDetailView.cxx
dbaccess/source/ui/app/AppDetailView.cxx
+1
-1
sdmod1.cxx
sd/source/ui/app/sdmod1.cxx
+2
-2
PreviewValueSet.cxx
sd/source/ui/sidebar/PreviewValueSet.cxx
+1
-2
newhelp.cxx
sfx2/source/appl/newhelp.cxx
+1
-1
recently_used_file.cxx
shell/source/unix/sysshell/recently_used_file.cxx
+2
-2
grfmgr.cxx
svtools/source/graphic/grfmgr.cxx
+1
-1
gtksalframe.cxx
vcl/unx/gtk/window/gtksalframe.cxx
+1
-1
No files found.
compilerplugins/clang/redundantcast.cxx
Dosyayı görüntüle @
0bfc98e6
...
...
@@ -207,45 +207,59 @@ bool RedundantCast::VisitImplicitCastExpr(const ImplicitCastExpr * expr) {
bool
RedundantCast
::
VisitCXXReinterpretCastExpr
(
CXXReinterpretCastExpr
const
*
expr
)
{
if
(
ignoreLocation
(
expr
)
||
!
expr
->
getSubExpr
()
->
getType
()
->
isVoidPointerType
())
{
return
true
;
}
auto
t
=
expr
->
getType
()
->
getAs
<
PointerType
>
();
if
(
t
==
nullptr
||
!
t
->
getPointeeType
()
->
isObjectType
())
{
if
(
ignoreLocation
(
expr
))
{
return
true
;
}
if
(
rewriter
!=
nullptr
)
{
auto
loc
=
expr
->
getLocStart
();
while
(
compiler
.
getSourceManager
().
isMacroArgExpansion
(
loc
))
{
loc
=
compiler
.
getSourceManager
().
getImmediateMacroCallerLoc
(
loc
)
;
if
(
expr
->
getSubExpr
()
->
getType
()
->
isVoidPointerType
()
)
{
auto
t
=
expr
->
getType
()
->
getAs
<
PointerType
>
();
if
(
t
==
nullptr
||
!
t
->
getPointeeType
()
->
isObjectType
(
))
{
return
true
;
}
if
(
compat
::
isMacroBodyExpansion
(
compiler
,
loc
)
)
{
auto
loc
2
=
expr
->
getLocEnd
();
while
(
compiler
.
getSourceManager
().
isMacroArgExpansion
(
loc
2
))
{
loc
2
=
compiler
.
getSourceManager
().
getImmediateMacroCallerLoc
(
loc
2
);
if
(
rewriter
!=
nullptr
)
{
auto
loc
=
expr
->
getLocStart
();
while
(
compiler
.
getSourceManager
().
isMacroArgExpansion
(
loc
))
{
loc
=
compiler
.
getSourceManager
().
getImmediateMacroCallerLoc
(
loc
);
}
if
(
compat
::
isMacroBodyExpansion
(
compiler
,
loc2
))
{
//TODO: check loc, loc2 are in same macro body expansion
loc
=
compiler
.
getSourceManager
().
getSpellingLoc
(
loc
);
if
(
compat
::
isMacroBodyExpansion
(
compiler
,
loc
))
{
auto
loc2
=
expr
->
getLocEnd
();
while
(
compiler
.
getSourceManager
().
isMacroArgExpansion
(
loc2
))
{
loc2
=
compiler
.
getSourceManager
()
.
getImmediateMacroCallerLoc
(
loc2
);
}
if
(
compat
::
isMacroBodyExpansion
(
compiler
,
loc2
))
{
//TODO: check loc, loc2 are in same macro body expansion
loc
=
compiler
.
getSourceManager
().
getSpellingLoc
(
loc
);
}
}
auto
s
=
compiler
.
getSourceManager
().
getCharacterData
(
loc
);
auto
n
=
Lexer
::
MeasureTokenLength
(
loc
,
compiler
.
getSourceManager
(),
compiler
.
getLangOpts
());
std
::
string
tok
(
s
,
n
);
if
(
tok
==
"reinterpret_cast"
&&
replaceText
(
loc
,
n
,
"static_cast"
))
{
return
true
;
}
}
auto
s
=
compiler
.
getSourceManager
().
getCharacterData
(
loc
);
auto
n
=
Lexer
::
MeasureTokenLength
(
loc
,
compiler
.
getSourceManager
(),
compiler
.
getLangOpts
());
std
::
string
tok
(
s
,
n
);
if
(
tok
==
"reinterpret_cast"
&&
replaceText
(
loc
,
n
,
"static_cast"
))
{
report
(
DiagnosticsEngine
::
Warning
,
"reinterpret_cast from %0 to %1 can be simplified to static_cast"
,
expr
->
getExprLoc
())
<<
expr
->
getSubExprAsWritten
()
->
getType
()
<<
expr
->
getType
()
<<
expr
->
getSourceRange
();
}
else
if
(
expr
->
getType
()
->
isVoidPointerType
())
{
auto
t
=
expr
->
getSubExpr
()
->
getType
()
->
getAs
<
PointerType
>
();
if
(
t
==
nullptr
||
!
t
->
getPointeeType
()
->
isObjectType
())
{
return
true
;
}
report
(
DiagnosticsEngine
::
Warning
,
(
"reinterpret_cast from %0 to %1 can be simplified to static_cast"
" or an implicit conversion"
),
expr
->
getExprLoc
())
<<
expr
->
getSubExprAsWritten
()
->
getType
()
<<
expr
->
getType
()
<<
expr
->
getSourceRange
();
}
report
(
DiagnosticsEngine
::
Warning
,
"reinterpret_cast from %0 to %1 can be simplified to static_cast"
,
expr
->
getExprLoc
())
<<
expr
->
getSubExprAsWritten
()
->
getType
()
<<
expr
->
getType
()
<<
expr
->
getSourceRange
();
return
true
;
}
...
...
cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx
Dosyayı görüntüle @
0bfc98e6
...
...
@@ -242,7 +242,7 @@ extern "C" { static void s_releaseAndRevoke_v(va_list * pParam)
uno_ExtEnvironment
*
pEnv
=
va_arg
(
*
pParam
,
uno_ExtEnvironment
*
);
uno_Interface
*
pUnoI
=
va_arg
(
*
pParam
,
uno_Interface
*
);
pEnv
->
revokeInterface
(
pEnv
,
reinterpret_cast
<
void
*>
(
pUnoI
)
);
pEnv
->
revokeInterface
(
pEnv
,
pUnoI
);
pUnoI
->
release
(
pUnoI
);
}}
...
...
dbaccess/source/core/dataaccess/intercept.cxx
Dosyayı görüntüle @
0bfc98e6
...
...
@@ -176,7 +176,7 @@ void SAL_CALL OInterceptor::dispatch( const URL& _URL,const Sequence<PropertyVal
DispatchHelper
*
pHelper
=
new
DispatchHelper
;
pHelper
->
aArguments
=
Arguments
;
pHelper
->
aURL
=
_URL
;
Application
::
PostUserEvent
(
LINK
(
this
,
OInterceptor
,
OnDispatch
),
reinterpret_cast
<
void
*
>
(
pHelper
)
);
Application
::
PostUserEvent
(
LINK
(
this
,
OInterceptor
,
OnDispatch
),
pHelper
);
return
;
}
}
...
...
dbaccess/source/ui/app/AppDetailView.cxx
Dosyayı görüntüle @
0bfc98e6
...
...
@@ -496,7 +496,7 @@ void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList )
for
(
TaskEntryList
::
const_iterator
pTask
=
_rList
.
begin
();
pTask
!=
aEnd
;
++
pTask
,
++
pImages
)
{
SvTreeListEntry
*
pEntry
=
m_aCreation
->
InsertEntry
(
pTask
->
sTitle
);
pEntry
->
SetUserData
(
reinterpret_cast
<
void
*
>
(
new
TaskEntry
(
*
pTask
)
)
);
pEntry
->
SetUserData
(
new
TaskEntry
(
*
pTask
)
);
Image
aImage
=
Image
(
*
pImages
);
m_aCreation
->
SetExpandedEntryBmp
(
pEntry
,
aImage
);
...
...
sd/source/ui/app/sdmod1.cxx
Dosyayı görüntüle @
0bfc98e6
...
...
@@ -927,7 +927,7 @@ OutlineToImpressFinalizer::OutlineToImpressFinalizer (
const
ErrCode
nErrorCode
(
rBytes
.
ReadAt
(
nReadPosition
,
reinterpret_cast
<
void
*>
(
pBuffer
.
get
()
),
pBuffer
.
get
(
),
nBufferSize
,
&
nReadByteCount
));
...
...
@@ -951,7 +951,7 @@ OutlineToImpressFinalizer::OutlineToImpressFinalizer (
// Append the read bytes to the end of the memory stream.
if
(
nReadByteCount
>
0
)
{
mpStream
->
Write
(
reinterpret_cast
<
void
*>
(
pBuffer
.
get
()
),
nReadByteCount
);
mpStream
->
Write
(
pBuffer
.
get
(
),
nReadByteCount
);
nReadPosition
+=
nReadByteCount
;
}
}
...
...
sd/source/ui/sidebar/PreviewValueSet.cxx
Dosyayı görüntüle @
0bfc98e6
...
...
@@ -55,8 +55,7 @@ void PreviewValueSet::SetRightMouseClickHandler (const Link<>& rLink)
void
PreviewValueSet
::
MouseButtonDown
(
const
MouseEvent
&
rEvent
)
{
if
(
rEvent
.
IsRight
())
maRightMouseClickHandler
.
Call
(
reinterpret_cast
<
void
*>
(
&
const_cast
<
MouseEvent
&>
(
rEvent
)));
maRightMouseClickHandler
.
Call
(
&
const_cast
<
MouseEvent
&>
(
rEvent
));
else
ValueSet
::
MouseButtonDown
(
rEvent
);
...
...
sfx2/source/appl/newhelp.cxx
Dosyayı görüntüle @
0bfc98e6
...
...
@@ -590,7 +590,7 @@ namespace sfx2 {
}
#define NEW_ENTRY( url, bool ) \
reinterpret_cast<void*>( new IndexEntry_Impl( url, bool )
)
new IndexEntry_Impl( url, bool
)
#define UNIFY_AND_INSERT_TOKEN( aToken ) \
it = aInfo.insert( sfx2::KeywordInfo::value_type( aToken, 0 ) ).first; \
...
...
shell/source/unix/sysshell/recently_used_file.cxx
Dosyayı görüntüle @
0bfc98e6
...
...
@@ -108,7 +108,7 @@ void recently_used_file::truncate(off_t length)
size_t
recently_used_file
::
read
(
char
*
buffer
,
size_t
size
)
const
{
size_t
r
=
fread
(
reinterpret_cast
<
void
*>
(
buffer
)
,
sizeof
(
char
),
size
,
file_
);
size_t
r
=
fread
(
buffer
,
sizeof
(
char
),
size
,
file_
);
if
((
r
<
size
)
&&
ferror
(
file_
))
throw
"I/O error: read failed"
;
...
...
@@ -119,7 +119,7 @@ size_t recently_used_file::read(char* buffer, size_t size) const
void
recently_used_file
::
write
(
const
char
*
buffer
,
size_t
size
)
const
{
if
(
size
!=
fwrite
(
reinterpret_cast
<
const
void
*>
(
buffer
)
,
sizeof
(
char
),
size
,
file_
))
if
(
size
!=
fwrite
(
buffer
,
sizeof
(
char
),
size
,
file_
))
throw
"I/O error: write failed"
;
}
...
...
svtools/source/graphic/grfmgr.cxx
Dosyayı görüntüle @
0bfc98e6
...
...
@@ -396,7 +396,7 @@ OString GraphicObject::GetUniqueID() const
SvStream
*
GraphicObject
::
GetSwapStream
()
const
{
if
(
HasSwapStreamHdl
()
)
return
reinterpret_cast
<
SvStream
*>
(
mpSwapStreamHdl
->
Call
(
const_cast
<
void
*>
(
reinterpret
_cast
<
const
void
*>
(
this
))
)
);
return
reinterpret_cast
<
SvStream
*>
(
mpSwapStreamHdl
->
Call
(
const_cast
<
void
*>
(
static
_cast
<
const
void
*>
(
this
))
)
);
else
return
GRFMGR_AUTOSWAPSTREAM_NONE
;
}
...
...
vcl/unx/gtk/window/gtksalframe.cxx
Dosyayı görüntüle @
0bfc98e6
...
...
@@ -668,7 +668,7 @@ gboolean ensure_dbus_setup( gpointer data )
// Create menu model and action group attached to this frame.
GMenuModel
*
pMenuModel
=
G_MENU_MODEL
(
g_lo_menu_new
()
);
GActionGroup
*
pActionGroup
=
reinterpret_cast
<
GActionGroup
*>
(
g_lo_action_group_new
(
reinterpret
_cast
<
gpointer
>
(
pSalFrame
)
));
GActionGroup
*
pActionGroup
=
reinterpret_cast
<
GActionGroup
*>
(
g_lo_action_group_new
(
static
_cast
<
gpointer
>
(
pSalFrame
)
));
// Generate menu paths.
::
Window
windowId
=
GDK_WINDOW_XID
(
gdkWindow
);
...
...
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