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
7b1261f6
Kaydet (Commit)
7b1261f6
authored
Ock 06, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:cstylecast: sal
Change-Id: I0ad9681a8b31d78cefce5b66040415154a1c7a99
üst
d1a74c27
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
77 deletions
+49
-77
cstylecast.cxx
compilerplugins/clang/cstylecast.cxx
+2
-9
socket.cxx
sal/osl/unx/socket.cxx
+24
-46
thread.cxx
sal/osl/unx/thread.cxx
+3
-3
rtl_textcvt.cxx
sal/qa/rtl/textenc/rtl_textcvt.cxx
+1
-1
alloc_arena.cxx
sal/rtl/alloc_arena.cxx
+8
-7
alloc_cache.cxx
sal/rtl/alloc_cache.cxx
+9
-9
textcvt.cxx
sal/textenc/textcvt.cxx
+2
-2
No files found.
compilerplugins/clang/cstylecast.cxx
Dosyayı görüntüle @
7b1261f6
...
...
@@ -97,19 +97,12 @@ bool CStyleCast::VisitCStyleCastExpr(const CStyleCastExpr * expr) {
return
true
;
}
if
(
compat
::
isInMainFile
(
compiler
.
getSourceManager
(),
spellingLocation
)
)
{
if
(
filename
.
startswith
(
SRCDIR
"/sal/"
)
// sal has tons of weird stuff going on that I don't understand enough to fix
||
filename
.
startswith
(
SRCDIR
"/bridges/"
))
{
// I'm not messing with this code - far too dangerous
if
(
filename
.
startswith
(
SRCDIR
"/bridges/"
))
{
// I'm not messing with this code - far too dangerous
return
true
;
}
}
else
{
if
(
filename
==
SRCDIR
"/include/tools/solar.h"
||
filename
.
startswith
(
SRCDIR
"/include/cppuhelper/"
)
||
((
StringRef
(
compiler
.
getSourceManager
().
getFileEntryForID
(
compiler
.
getSourceManager
().
getMainFileID
())
->
getName
())
==
SRCDIR
"/jurt/source/pipe/staticsalhack.cxx"
)
&&
filename
.
startswith
(
SRCDIR
"/sal/"
)))
{
||
filename
.
startswith
(
SRCDIR
"/include/cppuhelper/"
))
{
return
true
;
}
}
...
...
sal/osl/unx/socket.cxx
Dosyayı görüntüle @
7b1261f6
...
...
@@ -2322,18 +2322,18 @@ oslSocketError SAL_CALL osl_getLastSocketError(oslSocket pSocket)
return
ERROR_FROM_NATIVE
(
pSocket
->
m_nLastError
);
}
typedef
struct
_T
SocketSetImpl
struct
osl
SocketSetImpl
{
int
m_MaxHandle
;
/* for select(), the largest descriptor in the set */
fd_set
m_Set
;
/* the set of descriptors */
}
TSocketSetImpl
;
};
oslSocketSet
SAL_CALL
osl_createSocketSet
()
{
T
SocketSetImpl
*
pSet
;
osl
SocketSetImpl
*
pSet
;
pSet
=
(
TSocketSetImpl
*
)
malloc
(
sizeof
(
T
SocketSetImpl
));
pSet
=
(
oslSocketSetImpl
*
)
malloc
(
sizeof
(
osl
SocketSetImpl
));
OSL_ASSERT
(
pSet
);
...
...
@@ -2354,23 +2354,19 @@ void SAL_CALL osl_destroySocketSet(oslSocketSet Set)
void
SAL_CALL
osl_clearSocketSet
(
oslSocketSet
Set
)
{
TSocketSetImpl
*
pSet
;
OSL_ASSERT
(
Set
);
if
(
Set
==
0
)
{
return
;
}
pSet
=
(
TSocketSetImpl
*
)
Set
;
pSet
->
m_MaxHandle
=
0
;
Set
->
m_MaxHandle
=
0
;
FD_ZERO
(
&
p
Set
->
m_Set
);
FD_ZERO
(
&
Set
->
m_Set
);
}
void
SAL_CALL
osl_addToSocketSet
(
oslSocketSet
Set
,
oslSocket
pSocket
)
{
TSocketSetImpl
*
pSet
;
OSL_ASSERT
(
Set
);
OSL_ASSERT
(
pSocket
);
...
...
@@ -2379,19 +2375,15 @@ void SAL_CALL osl_addToSocketSet(oslSocketSet Set, oslSocket pSocket)
return
;
}
pSet
=
(
TSocketSetImpl
*
)
Set
;
/* correct max handle */
if
(
pSocket
->
m_Socket
>
p
Set
->
m_MaxHandle
)
p
Set
->
m_MaxHandle
=
pSocket
->
m_Socket
;
FD_SET
(
pSocket
->
m_Socket
,
&
p
Set
->
m_Set
);
if
(
pSocket
->
m_Socket
>
Set
->
m_MaxHandle
)
Set
->
m_MaxHandle
=
pSocket
->
m_Socket
;
FD_SET
(
pSocket
->
m_Socket
,
&
Set
->
m_Set
);
}
void
SAL_CALL
osl_removeFromSocketSet
(
oslSocketSet
Set
,
oslSocket
pSocket
)
{
TSocketSetImpl
*
pSet
;
OSL_ASSERT
(
Set
);
OSL_ASSERT
(
pSocket
);
...
...
@@ -2400,27 +2392,23 @@ void SAL_CALL osl_removeFromSocketSet(oslSocketSet Set, oslSocket pSocket)
return
;
}
pSet
=
(
TSocketSetImpl
*
)
Set
;
/* correct max handle */
if
(
pSocket
->
m_Socket
==
p
Set
->
m_MaxHandle
)
if
(
pSocket
->
m_Socket
==
Set
->
m_MaxHandle
)
{
/* not optimal, since the next used descriptor might be */
/* much smaller than m_Socket-1, but it will do */
p
Set
->
m_MaxHandle
--
;
if
(
p
Set
->
m_MaxHandle
<
0
)
Set
->
m_MaxHandle
--
;
if
(
Set
->
m_MaxHandle
<
0
)
{
p
Set
->
m_MaxHandle
=
0
;
/* avoid underflow */
Set
->
m_MaxHandle
=
0
;
/* avoid underflow */
}
}
FD_CLR
(
pSocket
->
m_Socket
,
&
p
Set
->
m_Set
);
FD_CLR
(
pSocket
->
m_Socket
,
&
Set
->
m_Set
);
}
sal_Bool
SAL_CALL
osl_isInSocketSet
(
oslSocketSet
Set
,
oslSocket
pSocket
)
{
TSocketSetImpl
*
pSet
;
OSL_ASSERT
(
Set
);
OSL_ASSERT
(
pSocket
);
if
(
Set
==
0
||
pSocket
==
0
)
...
...
@@ -2428,9 +2416,7 @@ sal_Bool SAL_CALL osl_isInSocketSet(oslSocketSet Set, oslSocket pSocket)
return
sal_False
;
}
pSet
=
(
TSocketSetImpl
*
)
Set
;
return
bool
(
FD_ISSET
(
pSocket
->
m_Socket
,
&
pSet
->
m_Set
));
return
bool
(
FD_ISSET
(
pSocket
->
m_Socket
,
&
Set
->
m_Set
));
}
sal_Int32
SAL_CALL
osl_demultiplexSocketEvents
(
oslSocketSet
IncomingSet
,
...
...
@@ -2440,9 +2426,6 @@ sal_Int32 SAL_CALL osl_demultiplexSocketEvents(oslSocketSet IncomingSet,
{
int
MaxHandle
=
0
;
struct
timeval
tv
;
TSocketSetImpl
*
pInSet
;
TSocketSetImpl
*
pOutSet
;
TSocketSetImpl
*
pOOBSet
;
if
(
pTimeout
)
{
...
...
@@ -2451,25 +2434,20 @@ sal_Int32 SAL_CALL osl_demultiplexSocketEvents(oslSocketSet IncomingSet,
tv
.
tv_usec
=
pTimeout
->
Nanosec
/
1000L
;
}
/* map opaque data to impl-types */
pInSet
=
(
TSocketSetImpl
*
)
IncomingSet
;
pOutSet
=
(
TSocketSetImpl
*
)
OutgoingSet
;
pOOBSet
=
(
TSocketSetImpl
*
)
OutOfBandSet
;
/* get max handle from all sets */
if
(
pIn
Set
)
MaxHandle
=
pIn
Set
->
m_MaxHandle
;
if
(
Incoming
Set
)
MaxHandle
=
Incoming
Set
->
m_MaxHandle
;
if
(
pOutSet
&&
(
pOut
Set
->
m_MaxHandle
>
MaxHandle
))
MaxHandle
=
pOut
Set
->
m_MaxHandle
;
if
(
OutgoingSet
&&
(
Outgoing
Set
->
m_MaxHandle
>
MaxHandle
))
MaxHandle
=
Outgoing
Set
->
m_MaxHandle
;
if
(
pOOBSet
&&
(
pOOB
Set
->
m_MaxHandle
>
MaxHandle
))
MaxHandle
=
pOOB
Set
->
m_MaxHandle
;
if
(
OutOfBandSet
&&
(
OutOfBand
Set
->
m_MaxHandle
>
MaxHandle
))
MaxHandle
=
OutOfBand
Set
->
m_MaxHandle
;
return
select
(
MaxHandle
+
1
,
pInSet
?
PTR_FD_SET
(
pIn
Set
->
m_Set
)
:
0
,
pOutSet
?
PTR_FD_SET
(
pOut
Set
->
m_Set
)
:
0
,
pOOBSet
?
PTR_FD_SET
(
pOOB
Set
->
m_Set
)
:
0
,
IncomingSet
?
PTR_FD_SET
(
Incoming
Set
->
m_Set
)
:
0
,
OutgoingSet
?
PTR_FD_SET
(
Outgoing
Set
->
m_Set
)
:
0
,
OutOfBandSet
?
PTR_FD_SET
(
OutOfBand
Set
->
m_Set
)
:
0
,
pTimeout
?
&
tv
:
0
);
}
...
...
sal/osl/unx/thread.cxx
Dosyayı görüntüle @
7b1261f6
...
...
@@ -538,7 +538,7 @@ void SAL_CALL osl_yieldThread()
void
SAL_CALL
osl_setThreadName
(
char
const
*
name
)
{
#if defined LINUX && ! defined __FreeBSD_kernel__
if
(
prctl
(
PR_SET_NAME
,
(
unsigned
long
)
name
,
0
,
0
,
0
)
!=
0
)
{
if
(
prctl
(
PR_SET_NAME
,
reinterpret_cast
<
unsigned
long
>
(
name
)
,
0
,
0
,
0
)
!=
0
)
{
int
e
=
errno
;
SAL_WARN
(
"sal.osl"
,
"prctl(PR_SET_NAME) failed with errno "
<<
e
);
}
...
...
@@ -1022,7 +1022,7 @@ rtl_TextEncoding SAL_CALL osl_getThreadTextEncoding()
/* check for thread specific encoding, use default if not set */
threadEncoding
=
static_cast
<
rtl_TextEncoding
>
(
(
sal_uIntPtr
)
pthread_getspecific
(
g_thread
.
m_textencoding
.
m_key
));
reinterpret_cast
<
sal_uIntPtr
>
(
pthread_getspecific
(
g_thread
.
m_textencoding
.
m_key
)
));
if
(
0
==
threadEncoding
)
threadEncoding
=
g_thread
.
m_textencoding
.
m_default
;
...
...
@@ -1036,7 +1036,7 @@ rtl_TextEncoding osl_setThreadTextEncoding(rtl_TextEncoding Encoding)
/* save encoding in thread local storage */
pthread_setspecific
(
g_thread
.
m_textencoding
.
m_key
,
(
void
*
)
static_cast
<
sal_uIntPtr
>
(
Encoding
));
reinterpret_cast
<
void
*>
(
static_cast
<
sal_uIntPtr
>
(
Encoding
)
));
return
oldThreadEncoding
;
}
...
...
sal/qa/rtl/textenc/rtl_textcvt.cxx
Dosyayı görüntüle @
7b1261f6
...
...
@@ -239,7 +239,7 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) {
rtl_TextToUnicodeContext
aContext
=
rtl_createTextToUnicodeContext
(
aConverter
);
CPPUNIT_ASSERT_MESSAGE
(
"rtl_createTextToUnicodeContext failed"
,
aContext
!=
NULL
);
if
(
aContext
!=
(
rtl_TextToUnicodeContext
)
1
)
{
if
(
aContext
!=
reinterpret_cast
<
rtl_TextToUnicodeContext
>
(
1
)
)
{
sal_Size
nInput
=
0
;
sal_Size
nOutput
=
0
;
for
(
bool
bFlush
=
true
;
nInput
<
rTest
.
m_nTextSize
||
bFlush
;)
{
...
...
sal/rtl/alloc_arena.cxx
Dosyayı görüntüle @
7b1261f6
...
...
@@ -137,7 +137,7 @@ rtl_arena_segment_populate (
/* insert onto reserve span list */
QUEUE_INSERT_TAIL_NAMED
(
&
(
arena
->
m_segment_reserve_span_head
),
span
,
s
);
QUEUE_START_NAMED
(
span
,
f
);
span
->
m_addr
=
(
sal_uIntPtr
)
(
span
);
span
->
m_addr
=
reinterpret_cast
<
sal_uIntPtr
>
(
span
);
span
->
m_size
=
size
;
span
->
m_type
=
RTL_ARENA_SEGMENT_TYPE_SPAN
;
...
...
@@ -499,8 +499,9 @@ rtl_arena_segment_create (
RTL_MEMORY_LOCK_RELEASE
(
&
(
arena
->
m_lock
));
span
->
m_size
=
size
;
span
->
m_addr
=
(
sal_uIntPtr
)(
arena
->
m_source_alloc
)(
arena
->
m_source_arena
,
&
(
span
->
m_size
));
span
->
m_addr
=
reinterpret_cast
<
sal_uIntPtr
>
(
(
arena
->
m_source_alloc
)(
arena
->
m_source_arena
,
&
(
span
->
m_size
)));
RTL_MEMORY_LOCK_ACQUIRE
(
&
(
arena
->
m_lock
));
if
(
span
->
m_addr
!=
0
)
...
...
@@ -851,7 +852,7 @@ rtl_arena_deactivate (
QUEUE_REMOVE_NAMED
(
segment
,
s
);
/* return span to g_machdep_arena */
rtl_machdep_free
(
gp_machdep_arena
,
(
void
*
)
(
segment
->
m_addr
),
segment
->
m_size
);
rtl_machdep_free
(
gp_machdep_arena
,
reinterpret_cast
<
void
*>
(
segment
->
m_addr
),
segment
->
m_size
);
}
}
...
...
@@ -992,7 +993,7 @@ SAL_CALL rtl_arena_alloc (
rtl_arena_hash_insert
(
arena
,
segment
);
(
*
pSize
)
=
segment
->
m_size
;
addr
=
(
void
*
)
(
segment
->
m_addr
);
addr
=
reinterpret_cast
<
void
*>
(
segment
->
m_addr
);
}
RTL_MEMORY_LOCK_RELEASE
(
&
(
arena
->
m_lock
));
}
...
...
@@ -1035,7 +1036,7 @@ SAL_CALL rtl_arena_free (
RTL_MEMORY_LOCK_ACQUIRE
(
&
(
arena
->
m_lock
));
segment
=
rtl_arena_hash_remove
(
arena
,
(
sal_uIntPtr
)
(
addr
),
size
);
segment
=
rtl_arena_hash_remove
(
arena
,
reinterpret_cast
<
sal_uIntPtr
>
(
addr
),
size
);
if
(
segment
!=
0
)
{
rtl_arena_segment_type
*
next
,
*
prev
;
...
...
@@ -1057,7 +1058,7 @@ SAL_CALL rtl_arena_free (
if
(
arena
->
m_source_free
)
{
addr
=
(
void
*
)
(
prev
->
m_addr
);
addr
=
reinterpret_cast
<
void
*>
(
prev
->
m_addr
);
size
=
prev
->
m_size
;
/* remove from segment list */
...
...
sal/rtl/alloc_cache.cxx
Dosyayı görüntüle @
7b1261f6
...
...
@@ -229,7 +229,7 @@ rtl_cache_hash_remove (
/** RTL_CACHE_SLAB()
*/
#define RTL_CACHE_SLAB(addr, size) \
((
(rtl_cache_slab_type*)(RTL_MEMORY_P2END((sal_uIntPtr)
(addr), (size)))) - 1)
((
reinterpret_cast<rtl_cache_slab_type*>(RTL_MEMORY_P2END(reinterpret_cast<sal_uIntPtr>
(addr), (size)))) - 1)
/** rtl_cache_slab_constructor()
*/
...
...
@@ -288,7 +288,7 @@ rtl_cache_slab_create (
}
if
(
slab
!=
0
)
{
slab
->
m_data
=
(
sal_uIntPtr
)
(
addr
);
slab
->
m_data
=
reinterpret_cast
<
sal_uIntPtr
>
(
addr
);
/* dynamic freelist initialization */
slab
->
m_bp
=
slab
->
m_data
;
...
...
@@ -312,7 +312,7 @@ rtl_cache_slab_destroy (
rtl_cache_slab_type
*
slab
)
{
void
*
addr
=
(
void
*
)
(
slab
->
m_data
);
void
*
addr
=
reinterpret_cast
<
void
*>
(
slab
->
m_data
);
sal_Size
refcnt
=
slab
->
m_ntypes
;
slab
->
m_ntypes
=
0
;
if
(
cache
->
m_features
&
RTL_CACHE_FEATURE_HASH
)
...
...
@@ -422,12 +422,12 @@ rtl_cache_slab_alloc (
}
bufctl
->
m_addr
=
slab
->
m_bp
;
bufctl
->
m_slab
=
(
sal_uIntPtr
)
(
slab
);
bufctl
->
m_slab
=
reinterpret_cast
<
sal_uIntPtr
>
(
slab
);
}
else
{
/* embedded bufctl */
bufctl
=
(
rtl_cache_bufctl_type
*
)
(
slab
->
m_bp
);
bufctl
=
reinterpret_cast
<
rtl_cache_bufctl_type
*>
(
slab
->
m_bp
);
}
bufctl
->
m_next
=
0
;
...
...
@@ -457,7 +457,7 @@ rtl_cache_slab_alloc (
cache
->
m_slab_stats
.
m_mem_alloc
+=
cache
->
m_type_size
;
if
(
cache
->
m_features
&
RTL_CACHE_FEATURE_HASH
)
addr
=
(
void
*
)
rtl_cache_hash_insert
(
cache
,
bufctl
);
addr
=
reinterpret_cast
<
void
*>
(
rtl_cache_hash_insert
(
cache
,
bufctl
)
);
else
addr
=
bufctl
;
}
...
...
@@ -484,8 +484,8 @@ rtl_cache_slab_free (
/* determine slab from addr */
if
(
cache
->
m_features
&
RTL_CACHE_FEATURE_HASH
)
{
bufctl
=
rtl_cache_hash_remove
(
cache
,
(
sal_uIntPtr
)
(
addr
));
slab
=
(
bufctl
!=
0
)
?
(
rtl_cache_slab_type
*
)
(
bufctl
->
m_slab
)
:
0
;
bufctl
=
rtl_cache_hash_remove
(
cache
,
reinterpret_cast
<
sal_uIntPtr
>
(
addr
));
slab
=
(
bufctl
!=
0
)
?
reinterpret_cast
<
rtl_cache_slab_type
*>
(
bufctl
->
m_slab
)
:
0
;
}
else
{
...
...
@@ -1326,7 +1326,7 @@ rtl_cache_wsupdate_init()
g_cache_list
.
m_update_done
=
0
;
(
void
)
pthread_cond_init
(
&
(
g_cache_list
.
m_update_cond
),
NULL
);
if
(
pthread_create
(
&
(
g_cache_list
.
m_update_thread
),
NULL
,
rtl_cache_wsupdate_all
,
(
void
*
)
(
10
))
!=
0
)
&
(
g_cache_list
.
m_update_thread
),
NULL
,
rtl_cache_wsupdate_all
,
reinterpret_cast
<
void
*>
(
10
))
!=
0
)
{
/* failure */
g_cache_list
.
m_update_thread
=
(
pthread_t
)(
0
);
...
...
sal/textenc/textcvt.cxx
Dosyayı görüntüle @
7b1261f6
...
...
@@ -127,7 +127,7 @@ rtl_TextToUnicodeContext SAL_CALL rtl_createTextToUnicodeContext( rtl_TextToUnic
else
if
(
pConverter
->
mpCreateTextToUnicodeContext
)
return
(
rtl_TextToUnicodeContext
)
pConverter
->
mpCreateTextToUnicodeContext
();
else
return
(
rtl_TextToUnicodeContext
)
1
;
return
reinterpret_cast
<
rtl_TextToUnicodeContext
>
(
1
)
;
}
/* ----------------------------------------------------------------------- */
...
...
@@ -205,7 +205,7 @@ rtl_UnicodeToTextContext SAL_CALL rtl_createUnicodeToTextContext( rtl_UnicodeToT
else
if
(
pConverter
->
mpCreateUnicodeToTextContext
)
return
(
rtl_UnicodeToTextContext
)
pConverter
->
mpCreateUnicodeToTextContext
();
else
return
(
rtl_UnicodeToTextContext
)
1
;
return
reinterpret_cast
<
rtl_UnicodeToTextContext
>
(
1
)
;
}
/* ----------------------------------------------------------------------- */
...
...
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