Kaydet (Commit) 9bd2b842 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

const_cast: convert some C-style casts and remove some redundant ones

Change-Id: I71ebd11d850304772535cfb873086176d301172a
üst b8577031
...@@ -94,7 +94,7 @@ static PyRef getLoaderModule() throw( RuntimeException ) ...@@ -94,7 +94,7 @@ static PyRef getLoaderModule() throw( RuntimeException )
static PyRef getObjectFromLoaderModule( const char * func ) static PyRef getObjectFromLoaderModule( const char * func )
throw ( RuntimeException ) throw ( RuntimeException )
{ {
PyRef object( PyDict_GetItemString(getLoaderModule().get(), (char*)func ) ); PyRef object( PyDict_GetItemString(getLoaderModule().get(), func ) );
if( !object.is() ) if( !object.is() )
{ {
OUStringBuffer buf; OUStringBuffer buf;
...@@ -215,7 +215,7 @@ Reference< XInterface > CreateInstance( const Reference< XComponentContext > & c ...@@ -215,7 +215,7 @@ Reference< XInterface > CreateInstance( const Reference< XComponentContext > & c
#endif #endif
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
PyImport_AppendInittab( (char*)"pyuno", PyInit_pyuno ); PyImport_AppendInittab( "pyuno", PyInit_pyuno );
#else #else
PyImport_AppendInittab( (char*)"pyuno", initpyuno ); PyImport_AppendInittab( (char*)"pyuno", initpyuno );
#endif #endif
......
...@@ -365,7 +365,7 @@ PyObject *PyUNO_invoke( PyObject *object, const char *name , PyObject *args ) ...@@ -365,7 +365,7 @@ PyObject *PyUNO_invoke( PyObject *object, const char *name , PyObject *args )
} }
PyTuple_SetItem( paras.get(), i , element ); PyTuple_SetItem( paras.get(), i , element );
} }
callable = PyRef( PyObject_GetAttrString( object , (char*)name ), SAL_NO_ACQUIRE ); callable = PyRef( PyObject_GetAttrString( object , name ), SAL_NO_ACQUIRE );
if( !callable.is() ) if( !callable.is() )
return 0; return 0;
} }
......
...@@ -223,7 +223,7 @@ Any Adapter::invoke( const OUString &aFunctionName, ...@@ -223,7 +223,7 @@ Any Adapter::invoke( const OUString &aFunctionName,
} }
// get callable // get callable
PyRef method(PyObject_GetAttrString( mWrappedObject.get(), (char*)TO_ASCII(aFunctionName)), PyRef method(PyObject_GetAttrString( mWrappedObject.get(), TO_ASCII(aFunctionName)),
SAL_NO_ACQUIRE); SAL_NO_ACQUIRE);
raiseInvocationTargetExceptionWhenNeeded( runtime); raiseInvocationTargetExceptionWhenNeeded( runtime);
if( !method.is() ) if( !method.is() )
...@@ -359,7 +359,7 @@ void Adapter::setValue( const OUString & aPropertyName, const Any & value ) ...@@ -359,7 +359,7 @@ void Adapter::setValue( const OUString & aPropertyName, const Any & value )
PyRef obj = runtime.any2PyObject( value ); PyRef obj = runtime.any2PyObject( value );
PyObject_SetAttrString( PyObject_SetAttrString(
mWrappedObject.get(), (char*)TO_ASCII(aPropertyName), obj.get() ); mWrappedObject.get(), TO_ASCII(aPropertyName), obj.get() );
raiseInvocationTargetExceptionWhenNeeded( runtime); raiseInvocationTargetExceptionWhenNeeded( runtime);
} }
...@@ -377,7 +377,7 @@ Any Adapter::getValue( const OUString & aPropertyName ) ...@@ -377,7 +377,7 @@ Any Adapter::getValue( const OUString & aPropertyName )
{ {
Runtime runtime; Runtime runtime;
PyRef pyRef( PyRef pyRef(
PyObject_GetAttrString( mWrappedObject.get(), (char*)TO_ASCII(aPropertyName) ), PyObject_GetAttrString( mWrappedObject.get(), TO_ASCII(aPropertyName) ),
SAL_NO_ACQUIRE ); SAL_NO_ACQUIRE );
if (!pyRef.is() || PyErr_Occurred()) if (!pyRef.is() || PyErr_Occurred())
...@@ -405,7 +405,7 @@ sal_Bool Adapter::hasProperty( const OUString & aPropertyName ) ...@@ -405,7 +405,7 @@ sal_Bool Adapter::hasProperty( const OUString & aPropertyName )
PyThreadAttach guard( mInterpreter ); PyThreadAttach guard( mInterpreter );
{ {
bRet = PyObject_HasAttrString( bRet = PyObject_HasAttrString(
mWrappedObject.get() , (char*) TO_ASCII( aPropertyName )); mWrappedObject.get() , TO_ASCII( aPropertyName ));
} }
return bRet; return bRet;
} }
......
...@@ -97,7 +97,7 @@ const char *typeClassToString( TypeClass t ) ...@@ -97,7 +97,7 @@ const char *typeClassToString( TypeClass t )
static PyRef getClass( const Runtime & r , const char * name) static PyRef getClass( const Runtime & r , const char * name)
{ {
return PyRef( PyDict_GetItemString( r.getImpl()->cargo->getUnoModule().get(), (char*) name ) ); return PyRef( PyDict_GetItemString( r.getImpl()->cargo->getUnoModule().get(), name ) );
} }
PyRef getTypeClass( const Runtime & r ) PyRef getTypeClass( const Runtime & r )
...@@ -236,7 +236,7 @@ Type PyType2Type( PyObject * o ) throw(RuntimeException ) ...@@ -236,7 +236,7 @@ Type PyType2Type( PyObject * o ) throw(RuntimeException )
static PyObject* callCtor( const Runtime &r , const char * clazz, const PyRef & args ) static PyObject* callCtor( const Runtime &r , const char * clazz, const PyRef & args )
{ {
PyRef code( PyDict_GetItemString( r.getImpl()->cargo->getUnoModule().get(), (char*)clazz ) ); PyRef code( PyDict_GetItemString( r.getImpl()->cargo->getUnoModule().get(), clazz ) );
if( ! code.is() ) if( ! code.is() )
{ {
OStringBuffer buf; OStringBuffer buf;
......
...@@ -102,7 +102,7 @@ OUString pyString2ustring( PyObject *pystr ) ...@@ -102,7 +102,7 @@ OUString pyString2ustring( PyObject *pystr )
PyRef getObjectFromUnoModule( const Runtime &runtime, const char * func ) PyRef getObjectFromUnoModule( const Runtime &runtime, const char * func )
throw ( RuntimeException ) throw ( RuntimeException )
{ {
PyRef object(PyDict_GetItemString( runtime.getImpl()->cargo->getUnoModule().get(), (char*)func ) ); PyRef object(PyDict_GetItemString( runtime.getImpl()->cargo->getUnoModule().get(), func ) );
if( !object.is() ) if( !object.is() )
{ {
OUStringBuffer buf; OUStringBuffer buf;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment