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 )
static PyRef getObjectFromLoaderModule( const char * func )
throw ( RuntimeException )
{
PyRef object( PyDict_GetItemString(getLoaderModule().get(), (char*)func ) );
PyRef object( PyDict_GetItemString(getLoaderModule().get(), func ) );
if( !object.is() )
{
OUStringBuffer buf;
......@@ -215,7 +215,7 @@ Reference< XInterface > CreateInstance( const Reference< XComponentContext > & c
#endif
#if PY_MAJOR_VERSION >= 3
PyImport_AppendInittab( (char*)"pyuno", PyInit_pyuno );
PyImport_AppendInittab( "pyuno", PyInit_pyuno );
#else
PyImport_AppendInittab( (char*)"pyuno", initpyuno );
#endif
......
......@@ -365,7 +365,7 @@ PyObject *PyUNO_invoke( PyObject *object, const char *name , PyObject *args )
}
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() )
return 0;
}
......
......@@ -223,7 +223,7 @@ Any Adapter::invoke( const OUString &aFunctionName,
}
// get callable
PyRef method(PyObject_GetAttrString( mWrappedObject.get(), (char*)TO_ASCII(aFunctionName)),
PyRef method(PyObject_GetAttrString( mWrappedObject.get(), TO_ASCII(aFunctionName)),
SAL_NO_ACQUIRE);
raiseInvocationTargetExceptionWhenNeeded( runtime);
if( !method.is() )
......@@ -359,7 +359,7 @@ void Adapter::setValue( const OUString & aPropertyName, const Any & value )
PyRef obj = runtime.any2PyObject( value );
PyObject_SetAttrString(
mWrappedObject.get(), (char*)TO_ASCII(aPropertyName), obj.get() );
mWrappedObject.get(), TO_ASCII(aPropertyName), obj.get() );
raiseInvocationTargetExceptionWhenNeeded( runtime);
}
......@@ -377,7 +377,7 @@ Any Adapter::getValue( const OUString & aPropertyName )
{
Runtime runtime;
PyRef pyRef(
PyObject_GetAttrString( mWrappedObject.get(), (char*)TO_ASCII(aPropertyName) ),
PyObject_GetAttrString( mWrappedObject.get(), TO_ASCII(aPropertyName) ),
SAL_NO_ACQUIRE );
if (!pyRef.is() || PyErr_Occurred())
......@@ -405,7 +405,7 @@ sal_Bool Adapter::hasProperty( const OUString & aPropertyName )
PyThreadAttach guard( mInterpreter );
{
bRet = PyObject_HasAttrString(
mWrappedObject.get() , (char*) TO_ASCII( aPropertyName ));
mWrappedObject.get() , TO_ASCII( aPropertyName ));
}
return bRet;
}
......
......@@ -97,7 +97,7 @@ const char *typeClassToString( TypeClass t )
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 )
......@@ -236,7 +236,7 @@ Type PyType2Type( PyObject * o ) throw(RuntimeException )
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() )
{
OStringBuffer buf;
......
......@@ -102,7 +102,7 @@ OUString pyString2ustring( PyObject *pystr )
PyRef getObjectFromUnoModule( const Runtime &runtime, const char * func )
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() )
{
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