summaryrefslogtreecommitdiff
path: root/pyuno
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:18:37 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:18:37 +0100
commitbc3e970641147a3b3b599f019aeb409cef1d44b2 (patch)
tree48660f3fd6a177143461740cd98da645117af5da /pyuno
parentfe3924a3677ff5e3aa58bc0c7ec0310ad49acafd (diff)
More loplugin:cstylecast: pyuno
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I11e4fde47c5da601e4ffeada31083c3bdb4286f9
Diffstat (limited to 'pyuno')
-rw-r--r--pyuno/source/loader/pyuno_loader.cxx2
-rw-r--r--pyuno/source/module/pyuno.cxx18
-rw-r--r--pyuno/source/module/pyuno_adapter.cxx2
-rw-r--r--pyuno/source/module/pyuno_module.cxx6
-rw-r--r--pyuno/source/module/pyuno_runtime.cxx8
-rw-r--r--pyuno/source/module/pyuno_type.cxx2
-rw-r--r--pyuno/source/module/pyuno_util.cxx2
7 files changed, 20 insertions, 20 deletions
diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx
index 437bac4eb455..559dc64d1d99 100644
--- a/pyuno/source/loader/pyuno_loader.cxx
+++ b/pyuno/source/loader/pyuno_loader.cxx
@@ -126,7 +126,7 @@ static void setPythonHome ( const OUString & pythonHome )
// static because Py_SetPythonHome just copies the "wide" pointer
static wchar_t wide[PATH_MAX + 1];
size_t len = mbstowcs(wide, o.pData->buffer, PATH_MAX + 1);
- if(len == (size_t)-1)
+ if(len == size_t(-1))
{
PyErr_SetString(PyExc_SystemError, "invalid multibyte sequence in python home path");
return;
diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx
index 92c58be45930..5098c803b5f8 100644
--- a/pyuno/source/module/pyuno.cxx
+++ b/pyuno/source/module/pyuno.cxx
@@ -263,15 +263,15 @@ OUString val2str( const void * pVal, typelib_TypeDescriptionReference * pTypeRef
break;
case typelib_TypeClass_BYTE:
buf.append( "0x" );
- buf.append( (sal_Int32)*static_cast<sal_Int8 const *>(pVal), 16 );
+ buf.append( static_cast<sal_Int32>(*static_cast<sal_Int8 const *>(pVal)), 16 );
break;
case typelib_TypeClass_SHORT:
buf.append( "0x" );
- buf.append( (sal_Int32)*static_cast<sal_Int16 const *>(pVal), 16 );
+ buf.append( static_cast<sal_Int32>(*static_cast<sal_Int16 const *>(pVal)), 16 );
break;
case typelib_TypeClass_UNSIGNED_SHORT:
buf.append( "0x" );
- buf.append( (sal_Int32)*static_cast<sal_uInt16 const *>(pVal), 16 );
+ buf.append( static_cast<sal_Int32>(*static_cast<sal_uInt16 const *>(pVal)), 16 );
break;
case typelib_TypeClass_LONG:
buf.append( "0x" );
@@ -279,7 +279,7 @@ OUString val2str( const void * pVal, typelib_TypeDescriptionReference * pTypeRef
break;
case typelib_TypeClass_UNSIGNED_LONG:
buf.append( "0x" );
- buf.append( (sal_Int64)*static_cast<sal_uInt32 const *>(pVal), 16 );
+ buf.append( static_cast<sal_Int64>(*static_cast<sal_uInt32 const *>(pVal)), 16 );
break;
case typelib_TypeClass_HYPER:
case typelib_TypeClass_UNSIGNED_HYPER:
@@ -356,10 +356,10 @@ int lcl_PySlice_GetIndicesEx( PyObject *pObject, sal_Int32 nLen, sal_Int32 *nSta
return -1;
}
- *nStart = (sal_Int32)nStart_ssize;
- *nStop = (sal_Int32)nStop_ssize;
- *nStep = (sal_Int32)nStep_ssize;
- *nSliceLength = (sal_Int32)nSliceLength_ssize;
+ *nStart = static_cast<sal_Int32>(nStart_ssize);
+ *nStop = static_cast<sal_Int32>(nStop_ssize);
+ *nStep = static_cast<sal_Int32>(nStep_ssize);
+ *nSliceLength = static_cast<sal_Int32>(nSliceLength_ssize);
return 0;
}
@@ -1013,7 +1013,7 @@ int lcl_setitem_slice( PyUNO const *me, PyObject *pKey, PyObject *pValue )
PyErr_SetString( PyExc_ValueError, "tuple too large" );
return 1;
}
- sal_Int32 nTupleLength = (sal_Int32)nTupleLength_ssize;
+ sal_Int32 nTupleLength = static_cast<sal_Int32>(nTupleLength_ssize);
if ( (nTupleLength != nSliceLength) && (nStep != 1) )
{
diff --git a/pyuno/source/module/pyuno_adapter.cxx b/pyuno/source/module/pyuno_adapter.cxx
index ebb6204bb7ea..0a18a48ae75b 100644
--- a/pyuno/source/module/pyuno_adapter.cxx
+++ b/pyuno/source/module/pyuno_adapter.cxx
@@ -158,7 +158,7 @@ Sequence< sal_Int16 > Adapter::getOutIndexes( const OUString & functionName )
if( seqInfo[i].aMode == css::reflection::ParamMode_OUT ||
seqInfo[i].aMode == css::reflection::ParamMode_INOUT )
{
- ret[nOutsAssigned] = (sal_Int16) i;
+ ret[nOutsAssigned] = static_cast<sal_Int16>(i);
nOutsAssigned ++;
}
}
diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx
index 8c738aedbecc..e0d4f3e4d3a6 100644
--- a/pyuno/source/module/pyuno_module.cxx
+++ b/pyuno/source/module/pyuno_module.cxx
@@ -658,7 +658,7 @@ static PyObject *systemPathToFileUrl(
buf.append( "Couldn't convert " );
buf.append( sysPath );
buf.append( " to a file url for reason (" );
- buf.append( (sal_Int32) e );
+ buf.append( static_cast<sal_Int32>(e) );
buf.append( ")" );
raisePyExceptionWithAny(
makeAny( RuntimeException( buf.makeStringAndClear() )));
@@ -684,7 +684,7 @@ static PyObject * fileUrlToSystemPath(
buf.append( "Couldn't convert file url " );
buf.append( sysPath );
buf.append( " to a system path for reason (" );
- buf.append( (sal_Int32) e );
+ buf.append( static_cast<sal_Int32>(e) );
buf.append( ")" );
raisePyExceptionWithAny(
makeAny( RuntimeException( buf.makeStringAndClear() )));
@@ -709,7 +709,7 @@ static PyObject * absolutize( SAL_UNUSED_PARAMETER PyObject *, PyObject * args )
buf.append( " using root " );
buf.append( ouPath );
buf.append( " for reason (" );
- buf.append( (sal_Int32) e );
+ buf.append( static_cast<sal_Int32>(e) );
buf.append( ")" );
PyErr_SetString(
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx
index ad1f1985a635..0734f9174b45 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -680,21 +680,21 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con
else
{
#endif /* PY_MAJOR_VERSION >= 3 */
- sal_Int64 l = (sal_Int64)PyLong_AsLong (o);
+ sal_Int64 l = static_cast<sal_Int64>(PyLong_AsLong (o));
if( l < 128 && l >= -128 )
{
- sal_Int8 b = (sal_Int8 ) l;
+ sal_Int8 b = static_cast<sal_Int8>(l);
a <<= b;
}
else if( l <= 0x7fff && l >= -0x8000 )
{
- sal_Int16 s = (sal_Int16) l;
+ sal_Int16 s = static_cast<sal_Int16>(l);
a <<= s;
}
else if( l <= SAL_CONST_INT64(0x7fffffff) &&
l >= -SAL_CONST_INT64(0x80000000) )
{
- sal_Int32 l32 = (sal_Int32) l;
+ sal_Int32 l32 = static_cast<sal_Int32>(l);
a <<= l32;
}
else
diff --git a/pyuno/source/module/pyuno_type.cxx b/pyuno/source/module/pyuno_type.cxx
index e54400ba6d8d..191db4c21b2b 100644
--- a/pyuno/source/module/pyuno_type.cxx
+++ b/pyuno/source/module/pyuno_type.cxx
@@ -141,7 +141,7 @@ sal_Unicode PyChar2Unicode( PyObject *obj )
"uno.Char contains an empty unicode string");
}
- sal_Unicode c = (sal_Unicode)PyUnicode_AsUnicode( value.get() )[0];
+ sal_Unicode c = static_cast<sal_Unicode>(PyUnicode_AsUnicode( value.get() )[0]);
return c;
}
diff --git a/pyuno/source/module/pyuno_util.cxx b/pyuno/source/module/pyuno_util.cxx
index e92dad2e8bca..45ee5a38e40b 100644
--- a/pyuno/source/module/pyuno_util.cxx
+++ b/pyuno/source/module/pyuno_util.cxx
@@ -140,7 +140,7 @@ void log( RuntimeCargo * cargo, sal_Int32 level, const char *str )
localDateTime.NanoSeconds/1000000),
strLevel[level],
sal::static_int_cast< long >(
- (sal_Int32) osl::Thread::getCurrentIdentifier()),
+ static_cast<sal_Int32>(osl::Thread::getCurrentIdentifier())),
str );
}
}