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
7b832986
Kaydet (Commit)
7b832986
authored
Ock 17, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Some more loplugin:cstylecast: pyuno
Change-Id: I80c9fdb45c9f58ac3cd1b0fab2631b903194e268
üst
00173d8c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
36 deletions
+35
-36
pyuno_loader.cxx
pyuno/source/loader/pyuno_loader.cxx
+1
-1
pyuno.cxx
pyuno/source/module/pyuno.cxx
+14
-14
pyuno_adapter.cxx
pyuno/source/module/pyuno_adapter.cxx
+1
-1
pyuno_callable.cxx
pyuno/source/module/pyuno_callable.cxx
+3
-3
pyuno_except.cxx
pyuno/source/module/pyuno_except.cxx
+2
-2
pyuno_module.cxx
pyuno/source/module/pyuno_module.cxx
+5
-6
pyuno_runtime.cxx
pyuno/source/module/pyuno_runtime.cxx
+6
-6
pyuno_type.cxx
pyuno/source/module/pyuno_type.cxx
+3
-3
No files found.
pyuno/source/loader/pyuno_loader.cxx
Dosyayı görüntüle @
7b832986
...
...
@@ -67,7 +67,7 @@ static void raiseRuntimeExceptionWhenNeeded() throw ( RuntimeException )
if
(
PyErr_Occurred
()
)
{
PyRef
excType
,
excValue
,
excTraceback
;
PyErr_Fetch
(
(
PyObject
**
)
&
excType
,
(
PyObject
**
)
&
excValue
,(
PyObject
**
)
&
excTraceback
);
PyErr_Fetch
(
reinterpret_cast
<
PyObject
**>
(
&
excType
),
reinterpret_cast
<
PyObject
**>
(
&
excValue
),
reinterpret_cast
<
PyObject
**>
(
&
excTraceback
)
);
Runtime
runtime
;
com
::
sun
::
star
::
uno
::
Any
a
=
runtime
.
extractUnoException
(
excType
,
excValue
,
excTraceback
);
OUStringBuffer
buf
;
...
...
pyuno/source/module/pyuno.cxx
Dosyayı görüntüle @
7b832986
...
...
@@ -130,12 +130,12 @@ OUString val2str( const void * pVal, typelib_TypeDescriptionReference * pTypeRef
TYPELIB_DANGER_GET
(
&
pTypeDescr
,
pTypeRef
);
assert
(
pTypeDescr
);
typelib_CompoundTypeDescription
*
pCompType
=
(
typelib_CompoundTypeDescription
*
)
pTypeDescr
;
typelib_CompoundTypeDescription
*
pCompType
=
reinterpret_cast
<
typelib_CompoundTypeDescription
*>
(
pTypeDescr
)
;
sal_Int32
nDescr
=
pCompType
->
nMembers
;
if
(
pCompType
->
pBaseTypeDescription
)
{
buf
.
append
(
val2str
(
pVal
,
((
typelib_TypeDescription
*
)
pCompType
->
pBaseTypeDescription
)
->
pWeakRef
,
mode
)
);
buf
.
append
(
val2str
(
pVal
,
pCompType
->
pBaseTypeDescription
->
aBase
.
pWeakRef
,
mode
)
);
if
(
nDescr
)
buf
.
append
(
", "
);
}
...
...
@@ -168,7 +168,7 @@ OUString val2str( const void * pVal, typelib_TypeDescriptionReference * pTypeRef
uno_Sequence
*
pSequence
=
*
(
uno_Sequence
**
)
pVal
;
typelib_TypeDescription
*
pElementTypeDescr
=
0
;
TYPELIB_DANGER_GET
(
&
pElementTypeDescr
,
((
typelib_IndirectTypeDescription
*
)
pTypeDescr
)
->
pType
);
TYPELIB_DANGER_GET
(
&
pElementTypeDescr
,
reinterpret_cast
<
typelib_IndirectTypeDescription
*>
(
pTypeDescr
)
->
pType
);
sal_Int32
nElementSize
=
pElementTypeDescr
->
nSize
;
sal_Int32
nElements
=
pSequence
->
nElements
;
...
...
@@ -213,15 +213,15 @@ OUString val2str( const void * pVal, typelib_TypeDescriptionReference * pTypeRef
typelib_TypeDescription
*
pTypeDescr
=
0
;
TYPELIB_DANGER_GET
(
&
pTypeDescr
,
pTypeRef
);
sal_Int32
*
pValues
=
((
typelib_EnumTypeDescription
*
)
pTypeDescr
)
->
pEnumValues
;
sal_Int32
nPos
=
((
typelib_EnumTypeDescription
*
)
pTypeDescr
)
->
nEnumValues
;
sal_Int32
*
pValues
=
reinterpret_cast
<
typelib_EnumTypeDescription
*>
(
pTypeDescr
)
->
pEnumValues
;
sal_Int32
nPos
=
reinterpret_cast
<
typelib_EnumTypeDescription
*>
(
pTypeDescr
)
->
nEnumValues
;
while
(
nPos
--
)
{
if
(
pValues
[
nPos
]
==
*
(
int
*
)
pVal
)
break
;
}
if
(
nPos
>=
0
)
buf
.
append
(
((
typelib_EnumTypeDescription
*
)
pTypeDescr
)
->
ppEnumNames
[
nPos
]
);
buf
.
append
(
reinterpret_cast
<
typelib_EnumTypeDescription
*>
(
pTypeDescr
)
->
ppEnumNames
[
nPos
]
);
else
buf
.
append
(
'?'
);
...
...
@@ -296,7 +296,7 @@ OUString val2str( const void * pVal, typelib_TypeDescriptionReference * pTypeRef
PyObject
*
PyUNO_repr
(
PyObject
*
self
)
{
PyUNO
*
me
=
(
PyUNO
*
)
self
;
PyUNO
*
me
=
reinterpret_cast
<
PyUNO
*>
(
self
)
;
PyObject
*
ret
=
0
;
if
(
me
->
members
->
wrappedObject
.
getValueType
().
getTypeClass
()
...
...
@@ -328,7 +328,7 @@ PyObject *PyUNO_invoke( PyObject *object, const char *name , PyObject *args )
PyRef
paras
,
callable
;
if
(
PyObject_IsInstance
(
object
,
getPyUnoClass
().
get
()
)
)
{
PyUNO
*
me
=
(
PyUNO
*
)
object
;
PyUNO
*
me
=
reinterpret_cast
<
PyUNO
*>
(
object
)
;
OUString
attrName
=
OUString
::
createFromAscii
(
name
);
if
(
!
me
->
members
->
xInvocation
->
hasMethod
(
attrName
))
{
...
...
@@ -393,7 +393,7 @@ PyObject *PyUNO_invoke( PyObject *object, const char *name , PyObject *args )
PyObject
*
PyUNO_str
(
PyObject
*
self
)
{
PyUNO
*
me
=
(
PyUNO
*
)
self
;
PyUNO
*
me
=
reinterpret_cast
<
PyUNO
*>
(
self
)
;
OStringBuffer
buf
;
...
...
@@ -428,7 +428,7 @@ PyObject *PyUNO_str( PyObject * self )
PyObject
*
PyUNO_dir
(
PyObject
*
self
)
{
PyUNO
*
me
=
(
PyUNO
*
)
self
;
PyUNO
*
me
=
reinterpret_cast
<
PyUNO
*>
(
self
)
;
PyObject
*
member_list
=
NULL
;
Sequence
<
OUString
>
oo_member_list
;
...
...
@@ -461,7 +461,7 @@ PyObject* PyUNO_getattr (PyObject* self, char* name)
Runtime
runtime
;
me
=
(
PyUNO
*
)
self
;
me
=
reinterpret_cast
<
PyUNO
*>
(
self
)
;
if
(
strcmp
(
name
,
"__dict__"
)
==
0
)
{
Py_INCREF
(
Py_TYPE
(
me
)
->
tp_dict
);
...
...
@@ -539,7 +539,7 @@ int PyUNO_setattr (PyObject* self, char* name, PyObject* value)
{
PyUNO
*
me
;
me
=
(
PyUNO
*
)
self
;
me
=
reinterpret_cast
<
PyUNO
*>
(
self
)
;
try
{
Runtime
runtime
;
...
...
@@ -644,7 +644,7 @@ static PyObject* PyUNO_cmp( PyObject *self, PyObject *that, int op )
static
PyMethodDef
PyUNOMethods
[]
=
{
{
"__dir__"
,
(
PyCFunction
)
PyUNO_dir
,
METH_NOARGS
,
NULL
},
{
"__dir__"
,
reinterpret_cast
<
PyCFunction
>
(
PyUNO_dir
)
,
METH_NOARGS
,
NULL
},
{
NULL
,
NULL
,
0
,
NULL
}
};
...
...
@@ -766,7 +766,7 @@ PyObject* PyUNO_new_UNCHECKED (
self
->
members
=
new
PyUNOInternals
();
self
->
members
->
xInvocation
=
tmp_invocation
;
self
->
members
->
wrappedObject
=
targetInterface
;
return
(
PyObject
*
)
self
;
return
reinterpret_cast
<
PyObject
*>
(
self
)
;
}
}
...
...
pyuno/source/module/pyuno_adapter.cxx
Dosyayı görüntüle @
7b832986
...
...
@@ -83,7 +83,7 @@ void raiseInvocationTargetExceptionWhenNeeded( const Runtime &runtime )
if
(
PyErr_Occurred
()
)
{
PyRef
excType
,
excValue
,
excTraceback
;
PyErr_Fetch
(
(
PyObject
**
)
&
excType
,
(
PyObject
**
)
&
excValue
,(
PyObject
**
)
&
excTraceback
);
PyErr_Fetch
(
reinterpret_cast
<
PyObject
**>
(
&
excType
),
reinterpret_cast
<
PyObject
**>
(
&
excValue
),
reinterpret_cast
<
PyObject
**>
(
&
excTraceback
)
);
Any
unoExc
(
runtime
.
extractUnoException
(
excType
,
excValue
,
excTraceback
)
);
throw
InvocationTargetException
(
((
com
::
sun
::
star
::
uno
::
Exception
*
)
unoExc
.
getValue
())
->
Message
,
...
...
pyuno/source/module/pyuno_callable.cxx
Dosyayı görüntüle @
7b832986
...
...
@@ -53,7 +53,7 @@ void PyUNO_callable_del (PyObject* self)
{
PyUNO_callable
*
me
;
me
=
(
PyUNO_callable
*
)
self
;
me
=
reinterpret_cast
<
PyUNO_callable
*>
(
self
)
;
delete
me
->
members
;
PyObject_Del
(
self
);
...
...
@@ -71,7 +71,7 @@ PyObject* PyUNO_callable_call(
Any
any_params
;
Any
ret_value
;
RuntimeCargo
*
cargo
=
0
;
me
=
(
PyUNO_callable
*
)
self
;
me
=
reinterpret_cast
<
PyUNO_callable
*>
(
self
)
;
PyRef
ret
;
try
...
...
@@ -255,7 +255,7 @@ PyRef PyUNO_callable_new (
self
->
members
->
methodName
=
methodName
;
self
->
members
->
mode
=
mode
;
return
PyRef
(
(
PyObject
*
)
self
,
SAL_NO_ACQUIRE
);
return
PyRef
(
reinterpret_cast
<
PyObject
*>
(
self
)
,
SAL_NO_ACQUIRE
);
}
}
...
...
pyuno/source/module/pyuno_except.cxx
Dosyayı görüntüle @
7b832986
...
...
@@ -109,7 +109,7 @@ static PyRef createClass( const OUString & name, const Runtime &runtime )
PyRef
base
;
if
(
isInterface
)
{
typelib_InterfaceTypeDescription
*
pDesc
=
(
typelib_InterfaceTypeDescription
*
)
desc
.
get
(
);
typelib_InterfaceTypeDescription
*
pDesc
=
reinterpret_cast
<
typelib_InterfaceTypeDescription
*>
(
desc
.
get
()
);
if
(
pDesc
->
pBaseTypeDescription
)
{
base
=
getClass
(
pDesc
->
pBaseTypeDescription
->
aBase
.
pTypeName
,
runtime
);
...
...
@@ -121,7 +121,7 @@ static PyRef createClass( const OUString & name, const Runtime &runtime )
}
else
{
typelib_CompoundTypeDescription
*
pDesc
=
(
typelib_CompoundTypeDescription
*
)
desc
.
get
(
);
typelib_CompoundTypeDescription
*
pDesc
=
reinterpret_cast
<
typelib_CompoundTypeDescription
*>
(
desc
.
get
()
);
if
(
pDesc
->
pBaseTypeDescription
)
{
base
=
getClass
(
pDesc
->
pBaseTypeDescription
->
aBase
.
pTypeName
,
runtime
);
...
...
pyuno/source/module/pyuno_module.cxx
Dosyayı görüntüle @
7b832986
...
...
@@ -350,8 +350,7 @@ static PyObject* initTestEnvironment(
oslGenericFunction
const
pFunc
(
mod
.
getFunctionSymbol
(
"test_init"
));
if
(
!
pFunc
)
{
abort
();
}
// guess casting pFunc is undefined behavior but don't see a better way
((
void
(
SAL_CALL
*
)(
XMultiServiceFactory
*
))
pFunc
)
(
xMSF
.
get
());
reinterpret_cast
<
void
(
SAL_CALL
*
)(
XMultiServiceFactory
*
)
>
(
pFunc
)(
xMSF
.
get
());
}
catch
(
const
com
::
sun
::
star
::
uno
::
Exception
&
)
{
...
...
@@ -403,13 +402,13 @@ static PyObject *createUnoStructHelper(
if
(
idl_class
.
is
())
{
idl_class
->
createObject
(
IdlStruct
);
PyUNO
*
me
=
(
PyUNO
*
)
PyUNO_new_UNCHECKED
(
IdlStruct
,
c
->
xInvocation
);
PyRef
returnCandidate
(
(
PyObject
*
)
me
,
SAL_NO_ACQUIRE
);
PyUNO
*
me
=
reinterpret_cast
<
PyUNO
*>
(
PyUNO_new_UNCHECKED
(
IdlStruct
,
c
->
xInvocation
)
);
PyRef
returnCandidate
(
reinterpret_cast
<
PyObject
*>
(
me
)
,
SAL_NO_ACQUIRE
);
TypeDescription
desc
(
typeName
);
OSL_ASSERT
(
desc
.
is
()
);
// could already instantiate an XInvocation2 !
typelib_CompoundTypeDescription
*
pCompType
=
(
typelib_CompoundTypeDescription
*
)
desc
.
get
(
);
reinterpret_cast
<
typelib_CompoundTypeDescription
*>
(
desc
.
get
()
);
fillStructState
state
;
if
(
PyTuple_Size
(
initializer
)
>
0
||
PyDict_Size
(
keywordArgs
)
>
0
)
fillStruct
(
me
->
members
->
xInvocation
,
pCompType
,
initializer
,
keywordArgs
,
state
,
runtime
);
...
...
@@ -632,7 +631,7 @@ static PyObject * generateUuid(
SAL_UNUSED_PARAMETER
PyObject
*
,
SAL_UNUSED_PARAMETER
PyObject
*
)
{
Sequence
<
sal_Int8
>
seq
(
16
);
rtl_createUuid
(
(
sal_uInt8
*
)
seq
.
getArray
(
)
,
0
,
sal_False
);
rtl_createUuid
(
reinterpret_cast
<
sal_uInt8
*>
(
seq
.
getArray
()
)
,
0
,
sal_False
);
PyRef
ret
;
try
{
...
...
pyuno/source/module/pyuno_runtime.cxx
Dosyayı görüntüle @
7b832986
...
...
@@ -161,7 +161,7 @@ static PyRef importUnoModule( ) throw ( RuntimeException )
if
(
PyErr_Occurred
()
)
{
PyRef
excType
,
excValue
,
excTraceback
;
PyErr_Fetch
(
(
PyObject
**
)
&
excType
,
(
PyObject
**
)
&
excValue
,(
PyObject
**
)
&
excTraceback
);
PyErr_Fetch
(
reinterpret_cast
<
PyObject
**>
(
&
excType
),
reinterpret_cast
<
PyObject
**>
(
&
excValue
),
reinterpret_cast
<
PyObject
**>
(
&
excTraceback
)
);
// As of Python 2.7 this gives a rather non-useful "<traceback object at 0xADDRESS>",
// but it is the best we can do in the absence of uno._uno_extract_printable_stacktrace
// Who knows, a future Python might print something better.
...
...
@@ -186,7 +186,7 @@ static void readLoggingConfig( sal_Int32 *pLevel, FILE **ppFile )
OUString
fileName
;
osl_getModuleURLFromFunctionAddress
(
reinterpret_cast
<
oslGenericFunction
>
(
readLoggingConfig
),
(
rtl_uString
**
)
&
fileName
);
&
fileName
.
pData
);
fileName
=
fileName
.
copy
(
fileName
.
lastIndexOf
(
'/'
)
+
1
);
#ifdef MACOSX
fileName
+=
"../"
LIBO_ETC_FOLDER
"/"
;
...
...
@@ -460,7 +460,7 @@ PyRef Runtime::any2PyObject (const Any &a ) const
{
desc
.
makeComplete
();
typelib_EnumTypeDescription
*
pEnumDesc
=
(
typelib_EnumTypeDescription
*
)
desc
.
get
(
);
reinterpret_cast
<
typelib_EnumTypeDescription
*>
(
desc
.
get
()
);
for
(
int
i
=
0
;
i
<
pEnumDesc
->
nEnumValues
;
i
++
)
{
if
(
pEnumDesc
->
pEnumValues
[
i
]
==
l
)
...
...
@@ -740,7 +740,7 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con
if
(
PyStrBytes_Check
(
str
.
get
()
)
)
{
seq
=
Sequence
<
sal_Int8
>
(
(
sal_Int8
*
)
PyStrBytes_AsString
(
str
.
get
(
)),
PyStrBytes_Size
(
str
.
get
()));
reinterpret_cast
<
sal_Int8
*>
(
PyStrBytes_AsString
(
str
.
get
()
)),
PyStrBytes_Size
(
str
.
get
()));
}
a
<<=
seq
;
}
...
...
@@ -757,7 +757,7 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con
else
if
(
isInstanceOfStructOrException
(
o
)
)
{
PyRef
struc
(
PyObject_GetAttrString
(
o
,
"value"
),
SAL_NO_ACQUIRE
);
PyUNO
*
obj
=
(
PyUNO
*
)
struc
.
get
(
);
PyUNO
*
obj
=
reinterpret_cast
<
PyUNO
*>
(
struc
.
get
()
);
Reference
<
XMaterialHolder
>
holder
(
obj
->
members
->
xInvocation
,
UNO_QUERY
);
if
(
holder
.
is
(
)
)
a
=
holder
->
getMaterial
();
...
...
@@ -770,7 +770,7 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con
else
if
(
PyObject_IsInstance
(
o
,
getPyUnoClass
().
get
()
)
)
{
PyUNO
*
o_pi
;
o_pi
=
(
PyUNO
*
)
o
;
o_pi
=
reinterpret_cast
<
PyUNO
*>
(
o
)
;
if
(
o_pi
->
members
->
wrappedObject
.
getValueTypeClass
()
==
com
::
sun
::
star
::
uno
::
TypeClass_STRUCT
||
o_pi
->
members
->
wrappedObject
.
getValueTypeClass
()
==
...
...
pyuno/source/module/pyuno_type.cxx
Dosyayı görüntüle @
7b832986
...
...
@@ -174,11 +174,11 @@ Any PyEnum2Enum( PyObject *obj ) throw ( RuntimeException )
desc
.
makeComplete
();
typelib_EnumTypeDescription
*
pEnumDesc
=
(
typelib_EnumTypeDescription
*
)
desc
.
get
(
);
typelib_EnumTypeDescription
*
pEnumDesc
=
reinterpret_cast
<
typelib_EnumTypeDescription
*>
(
desc
.
get
()
);
int
i
=
0
;
for
(
i
=
0
;
i
<
pEnumDesc
->
nEnumValues
;
i
++
)
{
if
(
(
*
((
OUString
*
)
&
pEnumDesc
->
ppEnumNames
[
i
])
).
equalsAscii
(
stringValue
)
)
if
(
OUString
::
unacquired
(
&
pEnumDesc
->
ppEnumNames
[
i
]
).
equalsAscii
(
stringValue
)
)
{
break
;
}
...
...
@@ -293,7 +293,7 @@ PyObject *PyUNO_ByteSequence_new(
const
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>
&
byteSequence
,
const
Runtime
&
r
)
{
PyRef
str
(
PyStrBytes_FromStringAndSize
(
(
char
*
)
byteSequence
.
getConstArray
(
),
byteSequence
.
getLength
()),
PyStrBytes_FromStringAndSize
(
reinterpret_cast
<
char
const
*>
(
byteSequence
.
getConstArray
()
),
byteSequence
.
getLength
()),
SAL_NO_ACQUIRE
);
PyRef
args
(
PyTuple_New
(
1
),
SAL_NO_ACQUIRE
,
NOT_NULL
);
PyTuple_SetItem
(
args
.
get
()
,
0
,
str
.
getAcquired
()
);
...
...
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