diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-01-19 15:10:10 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-01-20 09:06:54 +0100 |
commit | fe9d002ef55e30aa3629f4e1951beb18ebb692b0 (patch) | |
tree | 1c72b3d97c34801d23ab1d9509aa56081e4d401f /vcl/unx | |
parent | f6cfe99d22041061b8042cdab05e57180c0ab70a (diff) |
Some more loplugin:cstylecast: vcl
Change-Id: I74d35630b9fcdaa97af0b1f1e6d1e5c72488964d
Diffstat (limited to 'vcl/unx')
32 files changed, 180 insertions, 179 deletions
diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx index 015f226ed8fb..e025881f66df 100644 --- a/vcl/unx/generic/app/i18n_cb.cxx +++ b/vcl/unx/generic/app/i18n_cb.cxx @@ -42,7 +42,7 @@ int PreeditStartCallback ( XIC, XPointer client_data, XPointer ) { - preedit_data_t* pPreeditData = (preedit_data_t*)client_data; + preedit_data_t* pPreeditData = reinterpret_cast<preedit_data_t*>(client_data); if ( pPreeditData->eState == ePreeditStatusActivationRequired ) { pPreeditData->eState = ePreeditStatusActive; @@ -58,7 +58,7 @@ PreeditStartCallback ( XIC, XPointer client_data, XPointer ) void PreeditDoneCallback ( XIC, XPointer client_data, XPointer ) { - preedit_data_t* pPreeditData = (preedit_data_t*)client_data; + preedit_data_t* pPreeditData = reinterpret_cast<preedit_data_t*>(client_data); if (pPreeditData->eState == ePreeditStatusActive ) { if( pPreeditData->pFrame ) @@ -191,7 +191,7 @@ Preedit_InsertText(preedit_text_t *pText, XIMText *pInsertText, int where) } else { - pInsertTextString = (sal_Unicode*)pMBString; + pInsertTextString = reinterpret_cast<sal_Unicode*>(pMBString); } // enlarge target text-buffer if necessary @@ -303,7 +303,7 @@ void PreeditDrawCallback(XIC ic, XPointer client_data, XIMPreeditDrawCallbackStruct *call_data) { - preedit_data_t* pPreeditData = (preedit_data_t*)client_data; + preedit_data_t* pPreeditData = reinterpret_cast<preedit_data_t*>(client_data); // if there's nothing to change then change nothing if ( ( (call_data->text == NULL) && (call_data->chg_length == 0) ) @@ -377,7 +377,7 @@ PreeditDrawCallback(XIC ic, XPointer client_data, if (pPreeditData->aText.nLength == 0) pPreeditData->eState = ePreeditStatusStartPending; - GetPreeditSpotLocation(ic, (XPointer)pPreeditData); + GetPreeditSpotLocation(ic, reinterpret_cast<XPointer>(pPreeditData)); } void @@ -387,7 +387,7 @@ GetPreeditSpotLocation(XIC ic, XPointer client_data) // Send SalEventExtTextInputPos event to get spotlocation SalExtTextInputPosEvent mPosEvent; - preedit_data_t* pPreeditData = (preedit_data_t*)client_data; + preedit_data_t* pPreeditData = reinterpret_cast<preedit_data_t*>(client_data); if( pPreeditData->pFrame ) pPreeditData->pFrame->CallCallback(SALEVENT_EXTTEXTINPUTPOS, (void*)&mPosEvent); @@ -522,7 +522,7 @@ StatusDrawCallback (XIC, XPointer, XIMStatusDrawCallbackStruct *call_data) void SwitchIMCallback (XIC, XPointer, XPointer call_data) { - XIMSwitchIMNotifyCallbackStruct* pCallData = (XIMSwitchIMNotifyCallbackStruct*)call_data; + XIMSwitchIMNotifyCallbackStruct* pCallData = reinterpret_cast<XIMSwitchIMNotifyCallbackStruct*>(call_data); ::vcl::I18NStatus::get().changeIM( OStringToOUString(pCallData->to->name, RTL_TEXTENCODING_UTF8) ); } @@ -531,7 +531,7 @@ SwitchIMCallback (XIC, XPointer, XPointer call_data) void IC_IMDestroyCallback (XIM, XPointer client_data, XPointer) { - SalI18N_InputContext *pContext = (SalI18N_InputContext*)client_data; + SalI18N_InputContext *pContext = reinterpret_cast<SalI18N_InputContext*>(client_data); if (pContext != NULL) pContext->HandleDestroyIM(); } @@ -539,7 +539,7 @@ IC_IMDestroyCallback (XIM, XPointer client_data, XPointer) void IM_IMDestroyCallback (XIM, XPointer client_data, XPointer) { - SalI18N_InputMethod *pMethod = (SalI18N_InputMethod*)client_data; + SalI18N_InputMethod *pMethod = reinterpret_cast<SalI18N_InputMethod*>(client_data); if (pMethod != NULL) pMethod->HandleDestroyIM(); } diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx index 379243fbe846..c055ff44c2e2 100644 --- a/vcl/unx/generic/app/i18n_ic.cxx +++ b/vcl/unx/generic/app/i18n_ic.cxx @@ -201,12 +201,12 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) : static XIMCallback aStatusDoneCallback; static XIMCallback aStatusDrawCallback; - aStatusStartCallback.callback = (XIMProc)StatusStartCallback; - aStatusStartCallback.client_data = (XPointer)&maClientData; - aStatusDoneCallback.callback = (XIMProc)StatusDoneCallback; - aStatusDoneCallback.client_data = (XPointer)&maClientData; - aStatusDrawCallback.callback = (XIMProc)StatusDrawCallback; - aStatusDrawCallback.client_data = (XPointer)&maClientData; + aStatusStartCallback.callback = reinterpret_cast<XIMProc>(StatusStartCallback); + aStatusStartCallback.client_data = reinterpret_cast<XPointer>(&maClientData); + aStatusDoneCallback.callback = reinterpret_cast<XIMProc>(StatusDoneCallback); + aStatusDoneCallback.client_data = reinterpret_cast<XPointer>(&maClientData); + aStatusDrawCallback.callback = reinterpret_cast<XIMProc>(StatusDrawCallback); + aStatusDrawCallback.client_data = reinterpret_cast<XPointer>(&maClientData); mpStatusAttributes = XVaCreateNestedList ( 0, @@ -235,14 +235,14 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) : { case XIMPreeditCallbacks: - maPreeditCaretCallback.callback = (XIMProc)PreeditCaretCallback; - maPreeditStartCallback.callback = (XIMProc)PreeditStartCallback; - maPreeditDoneCallback.callback = (XIMProc)PreeditDoneCallback; - maPreeditDrawCallback.callback = (XIMProc)PreeditDrawCallback; - maPreeditCaretCallback.client_data = (XPointer)&maClientData; - maPreeditStartCallback.client_data = (XPointer)&maClientData; - maPreeditDoneCallback.client_data = (XPointer)&maClientData; - maPreeditDrawCallback.client_data = (XPointer)&maClientData; + maPreeditCaretCallback.callback = reinterpret_cast<XIMProc>(PreeditCaretCallback); + maPreeditStartCallback.callback = reinterpret_cast<XIMProc>(PreeditStartCallback); + maPreeditDoneCallback.callback = reinterpret_cast<XIMProc>(PreeditDoneCallback); + maPreeditDrawCallback.callback = reinterpret_cast<XIMProc>(PreeditDrawCallback); + maPreeditCaretCallback.client_data = reinterpret_cast<XPointer>(&maClientData); + maPreeditStartCallback.client_data = reinterpret_cast<XPointer>(&maClientData); + maPreeditDoneCallback.client_data = reinterpret_cast<XPointer>(&maClientData); + maPreeditDrawCallback.client_data = reinterpret_cast<XPointer>(&maClientData); mpPreeditAttributes = XVaCreateNestedList ( 0, @@ -357,7 +357,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) : if ( maContext != NULL) { maDestroyCallback.callback = (XIMProc)IC_IMDestroyCallback; - maDestroyCallback.client_data = (XPointer)this; + maDestroyCallback.client_data = reinterpret_cast<XPointer>(this); XSetICValues( maContext, XNDestroyCallback, &maDestroyCallback, NULL ); diff --git a/vcl/unx/generic/app/i18n_im.cxx b/vcl/unx/generic/app/i18n_im.cxx index 795df4031f78..dcf11cde4cc5 100644 --- a/vcl/unx/generic/app/i18n_im.cxx +++ b/vcl/unx/generic/app/i18n_im.cxx @@ -368,7 +368,7 @@ SalI18N_InputMethod::CreateMethod ( Display *pDisplay ) #endif maDestroyCallback.callback = (XIMProc)IM_IMDestroyCallback; - maDestroyCallback.client_data = (XPointer)this; + maDestroyCallback.client_data = reinterpret_cast<XPointer>(this); if (mbUseable && maMethod != NULL) XSetIMValues(maMethod, XNDestroyCallback, &maDestroyCallback, NULL); diff --git a/vcl/unx/generic/app/i18n_xkb.cxx b/vcl/unx/generic/app/i18n_xkb.cxx index 3201d1539866..cfc3bef7f3be 100644 --- a/vcl/unx/generic/app/i18n_xkb.cxx +++ b/vcl/unx/generic/app/i18n_xkb.cxx @@ -90,12 +90,12 @@ SalI18N_KeyboardExtension::Dispatch( XEvent* pEvent ) // only handle state notify events for now, and only interested // in group details - sal_uInt32 nXKBType = ((XkbAnyEvent*)pEvent)->xkb_type; + sal_uInt32 nXKBType = reinterpret_cast<XkbAnyEvent*>(pEvent)->xkb_type; switch ( nXKBType ) { case XkbStateNotify: - mnGroup = ((XkbStateNotifyEvent*)pEvent)->group; + mnGroup = reinterpret_cast<XkbStateNotifyEvent*>(pEvent)->group; break; default: diff --git a/vcl/unx/generic/app/randrwrapper.cxx b/vcl/unx/generic/app/randrwrapper.cxx index 82e94a544b27..ecdfce34e736 100644 --- a/vcl/unx/generic/app/randrwrapper.cxx +++ b/vcl/unx/generic/app/randrwrapper.cxx @@ -280,7 +280,7 @@ int SalDisplay::processRandREvent( XEvent* pEvent ) { int nRet = 0; #ifdef USE_RANDR - XConfigureEvent* pCnfEvent=(XConfigureEvent*)pEvent; + XConfigureEvent* pCnfEvent=reinterpret_cast<XConfigureEvent*>(pEvent); if( m_bUseRandRWrapper && pWrapper && pWrapper->XRRRootToScreen(GetDisplay(),pCnfEvent->window) != -1 ) { nRet = pWrapper->XRRUpdateConfiguration( pEvent ); diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index ee922853686c..3c95b574d9a3 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -398,9 +398,9 @@ SalX11Display::SalX11Display( Display *display ) pXLib_ = GetX11SalData()->GetLib(); pXLib_->Insert( ConnectionNumber( pDisp_ ), this, - (YieldFunc) DisplayHasEvent, - (YieldFunc) DisplayQueue, - (YieldFunc) DisplayYield ); + reinterpret_cast<YieldFunc>(DisplayHasEvent), + reinterpret_cast<YieldFunc>(DisplayQueue), + reinterpret_cast<YieldFunc>(DisplayYield) ); } SalX11Display::~SalX11Display() @@ -477,7 +477,7 @@ SalDisplay::initScreen( SalX11Screen nXScreen ) const XA_WINDOW, 32, PropModeReplace, - (unsigned char*)&pSD->m_aRefWindow, + reinterpret_cast<unsigned char*>(&pSD->m_aRefWindow), 1 ); @@ -1398,12 +1398,12 @@ KeySym SalDisplay::GetKeySym( XKeyEvent *pEvent, { // XmbLookupString must not be called for KeyRelease events // Cannot enter space in c locale problem #89616# #88978# btraq #4478197 - *pLen = XLookupString( pEvent, (char*)pPrintable, 1, &nKeySym, NULL ); + *pLen = XLookupString( pEvent, reinterpret_cast<char*>(pPrintable), 1, &nKeySym, NULL ); } else { *pLen = XmbLookupString( aInputContext, - pEvent, (char*)pPrintable, *pLen - 1, &nKeySym, pStatusReturn ); + pEvent, reinterpret_cast<char*>(pPrintable), *pLen - 1, &nKeySym, pStatusReturn ); // Lookup the string again, now with appropriate size if ( *pStatusReturn == XBufferOverflow ) @@ -2319,7 +2319,7 @@ Time SalDisplay::GetLastUserEventTime( bool i_bAlwaysReget ) const nAtom, nAtom, 8, PropModeReplace, &c, 1 ); XFlush( GetDisplay() ); - if( ! XIfEventWithTimeout( &aEvent, (XPointer)this, timestamp_predicate ) ) + if( ! XIfEventWithTimeout( &aEvent, reinterpret_cast<XPointer>(const_cast<SalDisplay *>(this)), timestamp_predicate ) ) { // this should not happen at all; still sometimes it happens aEvent.xproperty.time = CurrentTime; diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx index aced86b81ed8..4ec1a40908c8 100644 --- a/vcl/unx/generic/app/salinst.cxx +++ b/vcl/unx/generic/app/salinst.cxx @@ -87,7 +87,7 @@ struct PredicateReturn extern "C" { Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData ) { - PredicateReturn *pPre = (PredicateReturn *)pData; + PredicateReturn *pPre = reinterpret_cast<PredicateReturn *>(pData); if ( pPre->bRet ) return False; @@ -141,7 +141,7 @@ bool X11SalInstance::AnyInput(VclInputFlags nType) aInput.nType = nType; XCheckIfEvent(pDisplay, &aEvent, ImplPredicateEvent, - (char *)&aInput ); + reinterpret_cast<char *>(&aInput) ); bRet = aInput.bRet; } @@ -316,7 +316,7 @@ void X11SalInstance::AddToRecentDocumentList(const OUString& rFileUrl, const OUS osl::Module module; module.loadRelative( &thisModule, LIB_RECENT_FILE ); if (module.is()) - add_to_recently_used_file_list = (PFUNC_ADD_TO_RECENTLY_USED_LIST)module.getFunctionSymbol(SYM_ADD_TO_RECENTLY_USED_FILE_LIST); + add_to_recently_used_file_list = reinterpret_cast<PFUNC_ADD_TO_RECENTLY_USED_LIST>(module.getFunctionSymbol(SYM_ADD_TO_RECENTLY_USED_FILE_LIST)); if (add_to_recently_used_file_list) add_to_recently_used_file_list(rFileUrl, rMimeType, rDocumentService); } diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx index 146768bdc547..65522c6a41c9 100644 --- a/vcl/unx/generic/app/sm.cxx +++ b/vcl/unx/generic/app/sm.cxx @@ -469,7 +469,7 @@ void SessionManagerClient::open(SalSession * pSession) XA_STRING, 8, PropModeReplace, - (unsigned char*)m_aClientID.getStr(), + reinterpret_cast<unsigned char const *>(m_aClientID.getStr()), m_aClientID.getLength() ); } diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx index 4fe74335a05e..58d34fe3928e 100644 --- a/vcl/unx/generic/app/wmadaptor.cxx +++ b/vcl/unx/generic/app/wmadaptor.cxx @@ -384,7 +384,7 @@ NetWMAdaptor::NetWMAdaptor( SalDisplay* pSalDisplay ) : && nItems ) { - Atom* pAtoms = (Atom*)pProperty; + Atom* pAtoms = reinterpret_cast<Atom*>(pProperty); char** pAtomNames = (char**)alloca( sizeof(char*)*nItems ); if( XGetAtomNames( m_pDisplay, pAtoms, nItems, pAtomNames ) ) { @@ -442,7 +442,7 @@ NetWMAdaptor::NetWMAdaptor( SalDisplay* pSalDisplay ) : && pProperty ) { - m_nDesktops = *(long*)pProperty; + m_nDesktops = *reinterpret_cast<long*>(pProperty); XFree( pProperty ); pProperty = NULL; // get work areas @@ -463,7 +463,7 @@ NetWMAdaptor::NetWMAdaptor( SalDisplay* pSalDisplay ) : ) { m_aWMWorkAreas = ::std::vector< Rectangle > ( m_nDesktops ); - long* pValues = (long*)pProperty; + long* pValues = reinterpret_cast<long*>(pProperty); for( int i = 0; i < m_nDesktops; i++ ) { Point aPoint( pValues[4*i], @@ -556,7 +556,7 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) : && nItems != 0 ) { - aWMChild = *(::Window*)pProperty; + aWMChild = *reinterpret_cast< ::Window* >(pProperty); XFree( pProperty ); pProperty = NULL; ::Window aCheckWindow = None; @@ -580,7 +580,7 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) : { GetGenericData()->ErrorTrapPush(); - aCheckWindow = *(::Window*)pProperty; + aCheckWindow = *reinterpret_cast< ::Window* >(pProperty); XFree( pProperty ); pProperty = NULL; if( aCheckWindow == aWMChild ) @@ -642,7 +642,7 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) : && pProperty ) { - Atom* pAtoms = (Atom*)pProperty; + Atom* pAtoms = reinterpret_cast<Atom*>(pProperty); char** pAtomNames = (char**)alloca( sizeof(char*)*nItems ); if( XGetAtomNames( m_pDisplay, pAtoms, nItems, pAtomNames ) ) { @@ -706,7 +706,7 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) : && pProperty ) { - m_nDesktops = *(long*)pProperty; + m_nDesktops = *reinterpret_cast<long*>(pProperty); XFree( pProperty ); pProperty = NULL; } @@ -761,7 +761,7 @@ bool WMAdaptor::getNetWmName() && nItems != 0 ) { - aWMChild = *(::Window*)pProperty; + aWMChild = *reinterpret_cast< ::Window* >(pProperty); XFree( pProperty ); pProperty = NULL; ::Window aCheckWindow = None; @@ -784,7 +784,7 @@ bool WMAdaptor::getNetWmName() if ( ! GetGenericData()->ErrorTrapPop( false ) ) { GetGenericData()->ErrorTrapPush(); - aCheckWindow = *(::Window*)pProperty; + aCheckWindow = *reinterpret_cast< ::Window* >(pProperty); XFree( pProperty ); pProperty = NULL; if( aCheckWindow == aWMChild ) @@ -807,9 +807,9 @@ bool WMAdaptor::getNetWmName() ) { if (aRealType == m_aWMAtoms[ UTF8_STRING ]) - m_aWMName = OUString( (sal_Char*)pProperty, nItems, RTL_TEXTENCODING_UTF8 ); + m_aWMName = OUString( reinterpret_cast<char*>(pProperty), nItems, RTL_TEXTENCODING_UTF8 ); else if (aRealType == XA_STRING) - m_aWMName = OUString( (sal_Char*)pProperty, nItems, RTL_TEXTENCODING_ISO_8859_1 ); + m_aWMName = OUString( reinterpret_cast<char*>(pProperty), nItems, RTL_TEXTENCODING_ISO_8859_1 ); XFree( pProperty ); pProperty = NULL; @@ -841,7 +841,7 @@ bool WMAdaptor::getNetWmName() && nItems != 0 ) { - OUString aMetaVersion( (sal_Char*)pProperty, nItems, RTL_TEXTENCODING_UTF8 ); + OUString aMetaVersion( reinterpret_cast<char*>(pProperty), nItems, RTL_TEXTENCODING_UTF8 ); nVersionMajor = aMetaVersion.getToken(0, '.').toInt32(); nVersionMinor = aMetaVersion.getToken(1, '.').toInt32(); } @@ -1009,7 +1009,7 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const OUString& rWMName ) const &aProp ); } - unsigned char* pData = aProp.nitems ? aProp.value : (unsigned char*)aTitle.getStr(); + unsigned char const * pData = aProp.nitems ? aProp.value : reinterpret_cast<unsigned char const *>(aTitle.getStr()); Atom nType = aProp.nitems ? aProp.encoding : XA_STRING; int nFormat = aProp.nitems ? aProp.format : 8; int nBytes = aProp.nitems ? aProp.nitems : aTitle.getLength(); @@ -1036,7 +1036,7 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const OUString& rWMName ) const XA_STRING, 8, PropModeReplace, - (unsigned char*)aWMLocale.getStr(), + reinterpret_cast<unsigned char const *>(aWMLocale.getStr()), aWMLocale.getLength() ); if (aProp.value != NULL) XFree( aProp.value ); @@ -1062,7 +1062,7 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const OUString& rWMName ) con m_aWMAtoms[ UTF8_STRING ], 8, PropModeReplace, - (unsigned char*)aTitle.getStr(), + reinterpret_cast<unsigned char const *>(aTitle.getStr()), aTitle.getLength() ); if( m_aWMAtoms[ NET_WM_ICON_NAME ] ) XChangeProperty( m_pDisplay, @@ -1071,7 +1071,7 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const OUString& rWMName ) con m_aWMAtoms[ UTF8_STRING ], 8, PropModeReplace, - (unsigned char*)aTitle.getStr(), + reinterpret_cast<unsigned char const *>(aTitle.getStr()), aTitle.getLength() ); } @@ -1121,7 +1121,7 @@ void NetWMAdaptor::setNetWMState( X11SalFrame* pFrame ) const XA_ATOM, 32, PropModeReplace, - (unsigned char*)aStateAtoms, + reinterpret_cast<unsigned char*>(aStateAtoms), nStateAtoms ); } @@ -1216,7 +1216,7 @@ void GnomeWMAdaptor::setGnomeWMState( X11SalFrame* pFrame ) const XA_CARDINAL, 32, PropModeReplace, - (unsigned char*)&nWinWMState, + reinterpret_cast<unsigned char*>(&nWinWMState), 1 ); if( pFrame->mbMaximizedHorz @@ -1344,7 +1344,7 @@ void WMAdaptor::setFrameTypeAndDecoration( X11SalFrame* pFrame, WMWindowType eTy m_aWMAtoms[ MOTIF_WM_HINTS ], 32, PropModeReplace, - (unsigned char*)&aHint, + reinterpret_cast<unsigned char*>(&aHint), 5 ); } @@ -1429,7 +1429,7 @@ void NetWMAdaptor::setFrameTypeAndDecoration( X11SalFrame* pFrame, WMWindowType XA_ATOM, 32, PropModeReplace, - (unsigned char*)aWindowTypes, + reinterpret_cast<unsigned char*>(aWindowTypes), nWindowTypes ); } if( ( eType == windowType_ModalDialogue || @@ -1749,7 +1749,7 @@ void GnomeWMAdaptor::enableAlwaysOnTop( X11SalFrame* pFrame, bool bEnable ) cons XA_CARDINAL, 32, PropModeReplace, - (unsigned char*)&nNewLayer, + reinterpret_cast<unsigned char*>(&nNewLayer), 1 ); } @@ -1821,7 +1821,7 @@ int NetWMAdaptor::handlePropertyNotify( X11SalFrame* pFrame, XPropertyEvent* pEv { if( nType == XA_ATOM && nFormat == 32 && nItems > 0 ) { - pStates = (Atom*)pData; + pStates = reinterpret_cast<Atom*>(pData); for( unsigned long i = 0; i < nItems; i++ ) { if( pStates[i] == m_aWMAtoms[ NET_WM_STATE_MAXIMIZED_VERT ] && m_aWMAtoms[ NET_WM_STATE_MAXIMIZED_VERT ] ) @@ -1895,7 +1895,7 @@ int GnomeWMAdaptor::handlePropertyNotify( X11SalFrame* pFrame, XPropertyEvent* p { if( nType == XA_CARDINAL && nFormat == 32 && nItems == 1 ) { - sal_uInt32 nWinState = *(sal_uInt32*)pData; + sal_uInt32 nWinState = *reinterpret_cast<sal_uInt32*>(pData); if( nWinState & (1<<2) ) pFrame->mbMaximizedVert = true; if( nWinState & (1<<3) ) @@ -2130,7 +2130,7 @@ int WMAdaptor::getCurrentWorkArea() const && pProperty ) { - nCurrent = int(*(sal_Int32*)pProperty); + nCurrent = int(*reinterpret_cast<sal_Int32*>(pProperty)); XFree( pProperty ); } else if( pProperty ) @@ -2169,7 +2169,7 @@ int WMAdaptor::getWindowWorkArea( ::Window aWindow ) const && pProperty ) { - nCurrent = int(*(sal_Int32*)pProperty); + nCurrent = int(*reinterpret_cast<sal_Int32*>(pProperty)); XFree( pProperty ); } else if( pProperty ) @@ -2281,7 +2281,7 @@ void NetWMAdaptor::setFrameStruts( X11SalFrame* pFrame, XA_CARDINAL, 32, PropModeReplace, - (unsigned char*)&nData, + reinterpret_cast<unsigned char*>(&nData), nSetData ); } @@ -2307,7 +2307,7 @@ void NetWMAdaptor::setUserTime( X11SalFrame* i_pFrame, long i_nUserTime ) const XA_CARDINAL, 32, PropModeReplace, - (unsigned char*)&i_nUserTime, + reinterpret_cast<unsigned char*>(&i_nUserTime), 1 ); } @@ -2327,7 +2327,7 @@ void WMAdaptor::setPID( X11SalFrame* i_pFrame ) const XA_CARDINAL, 32, PropModeReplace, - (unsigned char*)&nPID, + reinterpret_cast<unsigned char*>(&nPID), 1 ); } @@ -2339,7 +2339,7 @@ void WMAdaptor::setPID( X11SalFrame* i_pFrame ) const void WMAdaptor::setClientMachine( X11SalFrame* i_pFrame ) const { OString aWmClient( OUStringToOString( GetGenericData()->GetHostname(), RTL_TEXTENCODING_ASCII_US ) ); - XTextProperty aClientProp = { (unsigned char*)aWmClient.getStr(), XA_STRING, 8, sal::static_int_cast<unsigned long>( aWmClient.getLength() ) }; + XTextProperty aClientProp = { reinterpret_cast<unsigned char *>(const_cast<char *>(aWmClient.getStr())), XA_STRING, 8, sal::static_int_cast<unsigned long>( aWmClient.getLength() ) }; XSetWMClientMachine( m_pDisplay, i_pFrame->GetShellWindow(), &aClientProp ); } diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx index 386925e3f370..4a0838b5ba34 100644 --- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx +++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx @@ -96,7 +96,7 @@ static bool is_gnome_desktop( Display* pDisplay ) &pProp ); if( pProp && nType == nUTFAtom ) { - OString aWMName( (sal_Char*)pProp ); + OString aWMName( reinterpret_cast<char*>(pProp) ); if ( (aWMName.equalsIgnoreAsciiCase("gnome-shell")) || (aWMName.equalsIgnoreAsciiCase("gnome-panel")) diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index 180758c8c166..a5c8387d21fb 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -538,7 +538,7 @@ OUString SelectionManager::convertFromCompound( const char* pText, int nLen ) int nTexts = 0; XTextProperty aProp; - aProp.value = (unsigned char*)pText; + aProp.value = reinterpret_cast<unsigned char *>(const_cast<char *>(pText)); aProp.encoding = m_nCOMPOUNDAtom; aProp.format = 8; aProp.nitems = nLen; @@ -575,7 +575,7 @@ OString SelectionManager::convertToCompound( const OUString& rText ) &aProp ); if( aProp.value ) { - aRet = (char*)aProp.value; + aRet = reinterpret_cast<char*>(aProp.value); XFree( aProp.value ); #ifdef SOLARIS /* @@ -630,7 +630,7 @@ bool SelectionManager::convertData( { OUString aString; aValue >>= aString; - rData = Sequence< sal_Int8 >( (sal_Int8*)aString.getStr(), aString.getLength() * sizeof( sal_Unicode ) ); + rData = Sequence< sal_Int8 >( reinterpret_cast<sal_Int8 const *>(aString.getStr()), aString.getLength() * sizeof( sal_Unicode ) ); bSuccess = true; } else if( aValue.getValueType() == getCppuType( (Sequence< sal_Int8 >*)0 ) ) @@ -657,7 +657,7 @@ bool SelectionManager::convertData( OUString aString; aValue >>= aString; OString aByteString( bCompoundText ? convertToCompound( aString ) : OUStringToOString( aString, aEncoding ) ); - rData = Sequence< sal_Int8 >( (sal_Int8*)aByteString.getStr(), aByteString.getLength() * sizeof( sal_Char ) ); + rData = Sequence< sal_Int8 >( reinterpret_cast<sal_Int8 const *>(aByteString.getStr()), aByteString.getLength() * sizeof( sal_Char ) ); bSuccess = true; } } @@ -1031,8 +1031,8 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ aData ) ) { - OUString aRet( (const sal_Char*)aData.getConstArray(), aData.getLength(), RTL_TEXTENCODING_UTF8 ); - rData = Sequence< sal_Int8 >( (sal_Int8*)aRet.getStr(), (aRet.getLength()+1)*sizeof( sal_Unicode ) ); + OUString aRet( reinterpret_cast<const char*>(aData.getConstArray()), aData.getLength(), RTL_TEXTENCODING_UTF8 ); + rData = Sequence< sal_Int8 >( reinterpret_cast<sal_Int8 const *>(aRet.getStr()), (aRet.getLength()+1)*sizeof( sal_Unicode ) ); bSuccess = true; } else if( it->second->m_bHaveCompound && @@ -1041,8 +1041,8 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ aData ) ) { - OUString aRet( convertFromCompound( (const char*)aData.getConstArray(), aData.getLength() ) ); - rData = Sequence< sal_Int8 >( (sal_Int8*)aRet.getStr(), (aRet.getLength()+1)*sizeof( sal_Unicode ) ); + OUString aRet( convertFromCompound( reinterpret_cast<const char*>(aData.getConstArray()), aData.getLength() ) ); + rData = Sequence< sal_Int8 >( reinterpret_cast<sal_Int8 const *>(aRet.getStr()), (aRet.getLength()+1)*sizeof( sal_Unicode ) ); bSuccess = true; } else @@ -1063,9 +1063,9 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ OUStringToOString( rType, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); #endif - OString aConvert( (sal_Char*)aData.getConstArray(), aData.getLength() ); + OString aConvert( reinterpret_cast<char const *>(aData.getConstArray()), aData.getLength() ); OUString aUTF( OStringToOUString( aConvert, aEncoding ) ); - rData = Sequence< sal_Int8 >( (sal_Int8*)aUTF.getStr(), (aUTF.getLength()+1)*sizeof( sal_Unicode ) ); + rData = Sequence< sal_Int8 >( reinterpret_cast<sal_Int8 const *>(aUTF.getStr()), (aUTF.getLength()+1)*sizeof( sal_Unicode ) ); bSuccess = true; break; } @@ -1100,14 +1100,14 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ XA_ATOM, 32, PropModeReplace, - (unsigned char*)pTypes, + reinterpret_cast<unsigned char*>(pTypes), 4 ); } // try MULTIPLE request if( getPasteData( selection, m_nMULTIPLEAtom, aData ) ) { - Atom* pReturnedTypes = (Atom*)aData.getArray(); + Atom* pReturnedTypes = reinterpret_cast<Atom*>(aData.getArray()); if( pReturnedTypes[0] == XA_PIXMAP && pReturnedTypes[1] == XA_PIXMAP ) { osl::MutexGuard aGuard(m_aMutex); @@ -1121,7 +1121,7 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ if( pReturn ) { if( type == XA_PIXMAP ) - aPixmap = *(Pixmap*)pReturn; + aPixmap = *reinterpret_cast<Pixmap*>(pReturn); XFree( pReturn ); pReturn = NULL; if( pReturnedTypes[2] == XA_COLORMAP && pReturnedTypes[3] == XA_COLORMAP ) @@ -1130,7 +1130,7 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ if( pReturn ) { if( type == XA_COLORMAP ) - aColormap = *(Colormap*)pReturn; + aColormap = *reinterpret_cast<Colormap*>(pReturn); XFree( pReturn ); } } @@ -1149,9 +1149,9 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ // perhaps two normal requests will work if( getPasteData( selection, XA_PIXMAP, aData ) ) { - aPixmap = *(Pixmap*)aData.getArray(); + aPixmap = *reinterpret_cast<Pixmap*>(aData.getArray()); if( aColormap == None && getPasteData( selection, XA_COLORMAP, aData ) ) - aColormap = *(Colormap*)aData.getArray(); + aColormap = *reinterpret_cast<Colormap*>(aData.getArray()); } } @@ -1288,7 +1288,7 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor > aAtoms.realloc( sizeof(Atom)*n ); for( i = 0, n = 0; i < 3; i++ ) if( m_aDropEnterEvent.data.l[2+i] ) - ((Atom*)aAtoms.getArray())[n++] = m_aDropEnterEvent.data.l[2+i]; + reinterpret_cast<Atom*>(aAtoms.getArray())[n++] = m_aDropEnterEvent.data.l[2+i]; } } } @@ -1300,7 +1300,7 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor > if( aAtoms.getLength() ) { sal_Int32 nAtoms = aAtoms.getLength() / sizeof(Atom); - Atom* pAtoms = (Atom*)aAtoms.getArray(); + Atom* pAtoms = reinterpret_cast<Atom*>(aAtoms.getArray()); rTypes.realloc( nAtoms ); aNativeTypes.resize( nAtoms ); DataFlavor* pFlavors = rTypes.getArray(); @@ -1459,7 +1459,7 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor, // the pixmap in another thread pPixmap = getPixmapHolder( selection ); // conversion succeeded, so aData contains image/bmp now - if( pPixmap->needsConversion( (const sal_uInt8*)aData.getConstArray() ) ) + if( pPixmap->needsConversion( reinterpret_cast<const sal_uInt8*>(aData.getConstArray()) ) ) { SAL_INFO( "vcl", "trying bitmap conversion" ); int depth = pPixmap->getDepth(); @@ -1470,7 +1470,7 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor, // get pixmap again since clearing the guard could have invalidated // the pixmap in another thread pPixmap = getPixmapHolder( selection ); - nValue = (XID)pPixmap->setBitmapData( (const sal_uInt8*)aData.getConstArray() ); + nValue = (XID)pPixmap->setBitmapData( reinterpret_cast<const sal_uInt8*>(aData.getConstArray()) ); } if( nValue == None ) return false; @@ -1485,7 +1485,7 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor, target, 32, PropModeReplace, - (const unsigned char*)&nValue, + reinterpret_cast<const unsigned char*>(&nValue), 1); return true; } @@ -1540,7 +1540,7 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor, long nMinSize = m_nIncrementalThreshold; XSelectInput( m_pDisplay, requestor, PropertyChangeMask ); XChangeProperty( m_pDisplay, requestor, property, - m_nINCRAtom, 32, PropModeReplace, (unsigned char*)&nMinSize, 1 ); + m_nINCRAtom, 32, PropModeReplace, reinterpret_cast<unsigned char*>(&nMinSize), 1 ); XFlush( m_pDisplay ); } else @@ -1552,7 +1552,7 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor, target, nFormat, PropModeReplace, - (const unsigned char*)aData.getConstArray(), + reinterpret_cast<const unsigned char*>(aData.getConstArray()), aData.getLength()/nUnitSize ); } } @@ -1609,7 +1609,7 @@ bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest for( i = 0, it = aConversions.begin(); i < nTypes; i++, ++it ) pTypes[i] = *it; XChangeProperty( m_pDisplay, rRequest.requestor, rRequest.property, - XA_ATOM, 32, PropModeReplace, (const unsigned char*)pTypes, nTypes ); + XA_ATOM, 32, PropModeReplace, reinterpret_cast<unsigned char*>(pTypes), nTypes ); aNotify.xselection.property = rRequest.property; #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "sending type list:\n" ); @@ -1622,7 +1622,7 @@ bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest { long nTimeStamp = (long)m_aSelections[rRequest.selection]->m_nOrigTimestamp; XChangeProperty( m_pDisplay, rRequest.requestor, rRequest.property, - XA_INTEGER, 32, PropModeReplace, (const unsigned char*)&nTimeStamp, 1 ); + XA_INTEGER, 32, PropModeReplace, reinterpret_cast<unsigned char*>(&nTimeStamp), 1 ); aNotify.xselection.property = rRequest.property; #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "sending timestamp: %d\n", (int)nTimeStamp ); @@ -1672,7 +1672,7 @@ bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest #endif bEventSuccess = true; bool bResetAtoms = false; - Atom* pAtoms = (Atom*)pData; + Atom* pAtoms = reinterpret_cast<Atom*>(pData); aGuard.clear(); for( unsigned int i = 0; i < nItems; i += 2 ) { @@ -1856,7 +1856,7 @@ bool SelectionManager::handleReceivePropertyNotify( XPropertyEvent& rNotify ) it->second->m_eState == Selection::WaitingForResponse ) { // copy data - it->second->m_aData = Sequence< sal_Int8 >( (sal_Int8*)pData, nItems*nUnitSize ); + it->second->m_aData = Sequence< sal_Int8 >( reinterpret_cast<sal_Int8*>(pData), nItems*nUnitSize ); it->second->m_eState = Selection::Inactive; it->second->m_aDataArrived.set(); } @@ -1960,7 +1960,7 @@ bool SelectionManager::handleSendPropertyNotify( XPropertyEvent& rNotify ) rInc.m_aTarget, rInc.m_nFormat, PropModeReplace, - (const unsigned char*)rInc.m_aData.getConstArray()+rInc.m_nBufferPos, + reinterpret_cast<const unsigned char*>(rInc.m_aData.getConstArray())+rInc.m_nBufferPos, nBytes/nUnitSize ); rInc.m_nBufferPos += nBytes; rInc.m_nTransferStartTime = nCurrentTime; @@ -2051,7 +2051,7 @@ bool SelectionManager::handleSelectionNotify( XSelectionEvent& rNotify ) } it->second->m_eState = Selection::Inactive; sal_Size nUnitSize = GetTrueFormatSize(nFormat); - it->second->m_aData = Sequence< sal_Int8 >((sal_Int8*)pData, nItems * nUnitSize); + it->second->m_aData = Sequence< sal_Int8 >(reinterpret_cast<sal_Int8*>(pData), nItems * nUnitSize); it->second->m_aDataArrived.set(); if( pData ) XFree( pData ); @@ -2917,7 +2917,7 @@ int SelectionManager::getXdndVersion( ::Window aWindow, ::Window& rProxy ) if( pBytes ) { if( nType == XA_WINDOW ) - rProxy = *(::Window*)pBytes; + rProxy = *reinterpret_cast< ::Window* >(pBytes); XFree( pBytes ); pBytes = NULL; if( rProxy != None ) @@ -2927,7 +2927,7 @@ int SelectionManager::getXdndVersion( ::Window aWindow, ::Window& rProxy ) &nType, &nFormat, &nItems, &nBytes, &pBytes ); if( pBytes ) { - if( nType == XA_WINDOW && *(::Window*)pBytes != rProxy ) + if( nType == XA_WINDOW && *reinterpret_cast< ::Window* >(pBytes) != rProxy ) rProxy = None; XFree( pBytes ); pBytes = NULL; @@ -2949,7 +2949,7 @@ int SelectionManager::getXdndVersion( ::Window aWindow, ::Window& rProxy ) if( pBytes ) { if( nType == XA_ATOM ) - nVersion = *(Atom*)pBytes; + nVersion = *reinterpret_cast<Atom*>(pBytes); XFree( pBytes ); } @@ -3296,7 +3296,7 @@ void SelectionManager::startDrag( for( int n = 0; n < nTypes; n++, ++type_it ) pTypes[n] = *type_it; - XChangeProperty( m_pDisplay, m_aWindow, m_nXdndTypeList, XA_ATOM, 32, PropModeReplace, (unsigned char*)pTypes, nTypes ); + XChangeProperty( m_pDisplay, m_aWindow, m_nXdndTypeList, XA_ATOM, 32, PropModeReplace, reinterpret_cast<unsigned char*>(pTypes), nTypes ); m_nSourceActions = sourceActions | DNDConstants::ACTION_DEFAULT; m_nUserDragAction = DNDConstants::ACTION_MOVE & m_nSourceActions; @@ -3491,7 +3491,7 @@ void SelectionManager::transferablesFlavorsChanged() Atom* pTypes = (Atom*)alloca( sizeof(Atom)*aConversions.size() ); for( i = 0, type_it = aConversions.begin(); type_it != aConversions.end(); ++type_it, i++ ) pTypes[i] = *type_it; - XChangeProperty( m_pDisplay, m_aWindow, m_nXdndTypeList, XA_ATOM, 32, PropModeReplace, (unsigned char*)pTypes, nTypes ); + XChangeProperty( m_pDisplay, m_aWindow, m_nXdndTypeList, XA_ATOM, 32, PropModeReplace, reinterpret_cast<unsigned char*>(pTypes), nTypes ); if( m_aCurrentDropWindow != None && m_nCurrentProtocolVersion >= 0 ) { @@ -3779,7 +3779,7 @@ sal_Bool SelectionManager::handleEvent(const Any& event) Sequence< sal_Int8 > aSeq; if( (event >>= aSeq) ) { - XEvent* pEvent = (XEvent*)aSeq.getArray(); + XEvent* pEvent = reinterpret_cast<XEvent*>(aSeq.getArray()); Time nTimestamp = CurrentTime; if( pEvent->type == ButtonPress || pEvent->type == ButtonRelease ) nTimestamp = pEvent->xbutton.time; @@ -3890,7 +3890,7 @@ void SelectionManager::registerDropTarget( ::Window aWindow, DropTarget* pTarget if( ! bWasError ) { // set XdndAware - XChangeProperty( m_pDisplay, aWindow, m_nXdndAware, XA_ATOM, 32, PropModeReplace, (unsigned char*)&nXdndProtocolRevision, 1 ); + XChangeProperty( m_pDisplay, aWindow, m_nXdndAware, XA_ATOM, 32, PropModeReplace, reinterpret_cast<unsigned char const *>(&nXdndProtocolRevision), 1 ); if( ! bWasError ) { // get root window of window (in 99.999% of all cases this will be diff --git a/vcl/unx/generic/dtrans/X11_transferable.cxx b/vcl/unx/generic/dtrans/X11_transferable.cxx index dd64fb7c13d9..ccc6fb51284b 100644 --- a/vcl/unx/generic/dtrans/X11_transferable.cxx +++ b/vcl/unx/generic/dtrans/X11_transferable.cxx @@ -63,9 +63,9 @@ Any SAL_CALL X11Transferable::getTransferData( const DataFlavor& rFlavor ) if( rFlavor.MimeType.equalsIgnoreAsciiCase( "text/plain;charset=utf-16" ) ) { int nLen = aData.getLength()/2; - if( ((sal_Unicode*)aData.getConstArray())[nLen-1] == 0 ) + if( reinterpret_cast<sal_Unicode const *>(aData.getConstArray())[nLen-1] == 0 ) nLen--; - OUString aString( (sal_Unicode*)aData.getConstArray(), nLen ); + OUString aString( reinterpret_cast<sal_Unicode const *>(aData.getConstArray()), nLen ); #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "X11Transferable::getTransferData( \"%s\" )\n -> \"%s\"\n", OUStringToOString( rFlavor.MimeType, RTL_TEXTENCODING_ISO_8859_1 ).getStr(), diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx index 5e084ceafb36..7eddf05f920c 100644 --- a/vcl/unx/generic/gdi/gdiimpl.cxx +++ b/vcl/unx/generic/gdi/gdiimpl.cxx @@ -887,7 +887,7 @@ bool X11SalGraphicsImpl::drawAlphaBitmap( const SalTwoRect& rTR, // an XImage needs its data top_down // TODO: avoid wrongly oriented images in upper layers! const int nImageSize = pAlphaBuffer->mnHeight * pAlphaBuffer->mnScanlineSize; - const char* pSrcBits = (char*)pAlphaBuffer->mpBits; + const char* pSrcBits = reinterpret_cast<char*>(pAlphaBuffer->mpBits); char* pAlphaBits = new char[ nImageSize ]; if( BMP_SCANLINE_ADJUSTMENT( pAlphaBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) memcpy( pAlphaBits, pSrcBits, nImageSize ); @@ -901,11 +901,11 @@ bool X11SalGraphicsImpl::drawAlphaBitmap( const SalTwoRect& rTR, // the alpha values need to be inverted for XRender // TODO: make upper layers use standard alpha - long* pLDst = (long*)pAlphaBits; + long* pLDst = reinterpret_cast<long*>(pAlphaBits); for( int i = nImageSize/sizeof(long); --i >= 0; ++pLDst ) *pLDst = ~*pLDst; - char* pCDst = (char*)pLDst; + char* pCDst = reinterpret_cast<char*>(pLDst); for( int i = nImageSize & (sizeof(long)-1); --i >= 0; ++pCDst ) *pCDst = ~*pCDst; @@ -924,7 +924,7 @@ bool X11SalGraphicsImpl::drawAlphaBitmap( const SalTwoRect& rTR, rTR.mnSrcX, rTR.mnSrcY, 0, 0, rTR.mnDestWidth, rTR.mnDestHeight ); XFreeGC( pXDisplay, aAlphaGC ); XFree( pAlphaImg ); - if( pAlphaBits != (char*)pAlphaBuffer->mpBits ) + if( pAlphaBits != reinterpret_cast<char*>(pAlphaBuffer->mpBits) ) delete[] pAlphaBits; const_cast<SalBitmap&>(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, BITMAP_READ_ACCESS ); diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index f6ac7369eeb7..8a38b1bfba6c 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -242,7 +242,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( aSrcBuf.mnHeight = nHeight; aSrcBuf.mnBitCount = pImage->bits_per_pixel; aSrcBuf.mnScanlineSize = pImage->bytes_per_line; - aSrcBuf.mpBits = (sal_uInt8*) pImage->data; + aSrcBuf.mpBits = reinterpret_cast<sal_uInt8*>(pImage->data); pImage->red_mask = pSalDisp->GetVisual( nScreen ).red_mask; pImage->green_mask = pSalDisp->GetVisual( nScreen ).green_mask; @@ -534,7 +534,7 @@ XImage* X11SalBitmap::ImplCreateXImage( blankExtraSpace(pDstBuf); #endif // set data in buffer as data member in pImage - pImage->data = (char*) pDstBuf->mpBits; + pImage->data = reinterpret_cast<char*>(pDstBuf->mpBits); // destroy buffer; don't destroy allocated data in buffer delete pDstBuf; diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx index 80b5acf44722..0b7be994be41 100644 --- a/vcl/unx/generic/plugadapt/salplug.cxx +++ b/vcl/unx/generic/plugadapt/salplug.cxx @@ -86,7 +86,7 @@ static SalInstance* tryInstance( const OUString& rModuleBase, bool bForce = fals SAL_LOADMODULE_DEFAULT ); if( aMod ) { - salFactoryProc aProc = (salFactoryProc)osl_getAsciiFunctionSymbol( aMod, "create_SalInstance" ); + salFactoryProc aProc = reinterpret_cast<salFactoryProc>(osl_getAsciiFunctionSymbol( aMod, "create_SalInstance" )); if( aProc ) { pInst = aProc(); @@ -148,8 +148,8 @@ static DesktopType get_desktop_environment() DesktopType ret = DESKTOP_UNKNOWN; if( aMod ) { - DesktopType (*pSym)() = (DesktopType(*)()) - osl_getAsciiFunctionSymbol( aMod, "get_desktop_environment" ); + DesktopType (*pSym)() = reinterpret_cast<DesktopType(*)()>( + osl_getAsciiFunctionSymbol( aMod, "get_desktop_environment" )); if( pSym ) ret = pSym(); } diff --git a/vcl/unx/generic/window/FWS.cxx b/vcl/unx/generic/window/FWS.cxx index 97a089d0c4cf..5d4ffd5282f4 100644 --- a/vcl/unx/generic/window/FWS.cxx +++ b/vcl/unx/generic/window/FWS.cxx @@ -102,7 +102,7 @@ WMSupportsFWS (Display *display, int screen) return False; } - fwsCommWindow = *(::Window *) propData; + fwsCommWindow = *reinterpret_cast< ::Window * >(propData); #if OSL_DEBUG_LEVEL > 1 fprintf (stderr, "Using fwsCommWindow = 0x%lx.\n", fwsCommWindow); #endif @@ -129,7 +129,7 @@ WMSupportsFWS (Display *display, int screen) for (i = 0; i < propItems; ++i) { - protocol = ((Atom *) propData)[i]; + protocol = reinterpret_cast<Atom *>(propData)[i]; if (protocol == FWS_STACK_UNDER) { fwsStackUnder = True; @@ -208,7 +208,7 @@ RegisterFwsWindow (Display *display, Window window) oldHandler = XSetErrorHandler (newHandler); XSendEvent (display, fwsCommWindow, False, NoEventMask, - (XEvent *) &msg); + reinterpret_cast<XEvent *>(&msg)); XSync (display, False); XSetErrorHandler (oldHandler); @@ -235,7 +235,7 @@ AddFwsProtocols (Display *display, Window window) fwsProtocols[ nProtos++ ] = FWS_PASS_ALL_INPUT; XChangeProperty (display, window, WM_PROTOCOLS, XA_ATOM, 32, PropModeAppend, - (unsigned char *) fwsProtocols, nProtos); + reinterpret_cast<unsigned char *>(fwsProtocols), nProtos); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 52e10567b298..a018b5bde8d9 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -676,7 +676,7 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, SalX11Screen nXScreen, SystemP XA_WINDOW, 32, PropModeReplace, - (unsigned char*)&aClientLeader, + reinterpret_cast<unsigned char*>(&aClientLeader), 1 ); } @@ -739,7 +739,7 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, SalX11Screen nXScreen, SystemP if( !netwm_icon.empty() && GetDisplay()->getWMAdaptor()->getAtom( WMAdaptor::NET_WM_ICON )) XChangeProperty( GetXDisplay(), mhWindow, GetDisplay()->getWMAdaptor()->getAtom( WMAdaptor::NET_WM_ICON ), - XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&netwm_icon.front(), netwm_icon.size()); + XA_CARDINAL, 32, PropModeReplace, reinterpret_cast<unsigned char*>(&netwm_icon.front()), netwm_icon.size()); } m_nWorkArea = GetDisplay()->getWMAdaptor()->getCurrentWorkArea(); @@ -1094,7 +1094,7 @@ void X11SalFrame::SetIcon( sal_uInt16 nIcon ) if( !netwm_icon.empty() && GetDisplay()->getWMAdaptor()->getAtom( WMAdaptor::NET_WM_ICON )) XChangeProperty( GetXDisplay(), mhWindow, GetDisplay()->getWMAdaptor()->getAtom( WMAdaptor::NET_WM_ICON ), - XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&netwm_icon.front(), netwm_icon.size()); + XA_CARDINAL, 32, PropModeReplace, reinterpret_cast<unsigned char*>(&netwm_icon.front()), netwm_icon.size()); } } } @@ -1501,8 +1501,8 @@ void X11SalFrame::Center( ) pFrame->GetShellWindow(), &aRoot, &nScreenX, &nScreenY, - (unsigned int*)&nScreenWidth, - (unsigned int*)&nScreenHeight, + reinterpret_cast<unsigned int*>(&nScreenWidth), + reinterpret_cast<unsigned int*>(&nScreenHeight), &bw, &depth ); } else @@ -2231,7 +2231,7 @@ IsRunningXAutoLock( Display *p_display, ::Window a_window ) // get pid of running xautolock XGetWindowProperty (p_display, a_window, a_pidatom, 0L, 2L, False, AnyPropertyType, &a_type, &n_format, &n_items, &n_bytes_after, - (unsigned char**) &p_pid ); + reinterpret_cast<unsigned char**>(&p_pid) ); n_pid = *p_pid; XFree( p_pid ); @@ -2270,7 +2270,7 @@ MessageToXAutoLock( Display *p_display, int n_message ) a_messageatom = XInternAtom( p_display, p_atomname, False ); XChangeProperty (p_display, a_rootwindow, a_messageatom, XA_INTEGER, - 8, PropModeReplace, (unsigned char*)&n_message, sizeof(n_message) ); + 8, PropModeReplace, reinterpret_cast<unsigned char*>(&n_message), sizeof(n_message) ); return True; } @@ -3306,7 +3306,7 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) // convert to single byte text stream nSize = rtl_convertTextToUnicode( aConverter, aContext, - (char*)pPrintable, nLen, + reinterpret_cast<char*>(pPrintable), nLen, pBuffer, nBufferSize, RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE | RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE, @@ -3320,7 +3320,7 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) } else if (nLen > 0 /* nEncoding == RTL_TEXTENCODING_UNICODE */) { - pString = (sal_Unicode*)pPrintable; + pString = reinterpret_cast<sal_Unicode*>(pPrintable); nSize = nLen; } else @@ -3894,9 +3894,9 @@ long X11SalFrame::HandleStateEvent( XPropertyEvent *pEvent ) && 2 == nitems && 0 == bytes_after, "HandleStateEvent" ); - if( *(unsigned long*)prop == NormalState ) + if( *reinterpret_cast<unsigned long*>(prop) == NormalState ) nShowState_ = SHOWSTATE_NORMAL; - else if( *(unsigned long*)prop == IconicState ) + else if( *reinterpret_cast<unsigned long*>(prop) == IconicState ) nShowState_ = SHOWSTATE_MINIMIZED; XFree( prop ); @@ -3974,7 +3974,7 @@ Bool call_checkKeyReleaseForRepeat( Display* pDisplay, XEvent* pCheck, XPointer Bool X11SalFrame::checkKeyReleaseForRepeat( Display*, XEvent* pCheck, XPointer pX11SalFrame ) { - X11SalFrame* pThis = (X11SalFrame*)pX11SalFrame; + X11SalFrame* pThis = reinterpret_cast<X11SalFrame*>(pX11SalFrame); return pCheck->type == KeyPress && pCheck->xkey.state == pThis->nKeyState_ && @@ -4010,7 +4010,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) { nReleaseTime_ = pEvent->xkey.time; XEvent aEvent; - if( XCheckIfEvent( pEvent->xkey.display, &aEvent, call_checkKeyReleaseForRepeat, (XPointer)this ) ) + if( XCheckIfEvent( pEvent->xkey.display, &aEvent, call_checkKeyReleaseForRepeat, reinterpret_cast<XPointer>(this) ) ) XPutBackEvent( pEvent->xkey.display, &aEvent ); else nRet = HandleKeyEvent( &pEvent->xkey ); diff --git a/vcl/unx/gtk/a11y/atkfactory.cxx b/vcl/unx/gtk/a11y/atkfactory.cxx index 54e0ac3e0b18..f960b4e65632 100644 --- a/vcl/unx/gtk/a11y/atkfactory.cxx +++ b/vcl/unx/gtk/a11y/atkfactory.cxx @@ -60,7 +60,7 @@ atk_noop_object_wrapper_get_type(void) sizeof (AtkNoOpObjectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, - (GClassInitFunc) atk_noop_object_wrapper_class_init, + reinterpret_cast<GClassInitFunc>(atk_noop_object_wrapper_class_init), (GClassFinalizeFunc) NULL, NULL, sizeof (AtkObjectWrapper), @@ -156,7 +156,7 @@ wrapper_factory_get_type (void) static const GTypeInfo tinfo = { sizeof (AtkObjectFactoryClass), - NULL, NULL, (GClassInitFunc) wrapper_factory_class_init, + NULL, NULL, reinterpret_cast<GClassInitFunc>(wrapper_factory_class_init), NULL, NULL, sizeof (AtkObjectFactory), 0, NULL, NULL }; diff --git a/vcl/unx/gtk/a11y/atkhypertext.cxx b/vcl/unx/gtk/a11y/atkhypertext.cxx index c4c5a5383bed..1074dad8ad8a 100644 --- a/vcl/unx/gtk/a11y/atkhypertext.cxx +++ b/vcl/unx/gtk/a11y/atkhypertext.cxx @@ -36,7 +36,7 @@ typedef struct { static uno::Reference< accessibility::XAccessibleHyperlink > getHyperlink( AtkHyperlink *pHyperlink ) { - HyperLink *pLink = (HyperLink *) pHyperlink; + HyperLink *pLink = reinterpret_cast<HyperLink *>(pHyperlink); return pLink->xLink; } @@ -47,7 +47,7 @@ extern "C" { static void hyper_link_finalize (GObject *obj) { - HyperLink *hl = (HyperLink *) obj; + HyperLink *hl = reinterpret_cast<HyperLink *>(obj); hl->xLink.clear(); hyper_parent_class->finalize (obj); } @@ -164,7 +164,7 @@ hyper_link_get_type (void) sizeof (AtkHyperlinkClass), NULL, /* base init */ NULL, /* base finalize */ - (GClassInitFunc) hyper_link_class_init, + reinterpret_cast<GClassInitFunc>(hyper_link_class_init), NULL, /* class finalize */ NULL, /* class data */ sizeof (HyperLink), /* instance size */ @@ -174,7 +174,7 @@ hyper_link_get_type (void) }; static const GInterfaceInfo atk_action_info = { - (GInterfaceInitFunc) actionIfaceInit, + reinterpret_cast<GInterfaceInitFunc>(actionIfaceInit), (GInterfaceFinalizeFunc) NULL, NULL }; diff --git a/vcl/unx/gtk/a11y/atklistener.cxx b/vcl/unx/gtk/a11y/atklistener.cxx index 45c06022f990..dcf7ffd479f0 100644 --- a/vcl/unx/gtk/a11y/atklistener.cxx +++ b/vcl/unx/gtk/a11y/atklistener.cxx @@ -97,7 +97,7 @@ void AtkListener::disposing( const lang::EventObject& ) throw (uno::RuntimeExcep // global mutex atk_object_wrapper_dispose( mpWrapper ); - g_idle_add( (GSourceFunc) idle_defunc_state_change, + g_idle_add( reinterpret_cast<GSourceFunc>(idle_defunc_state_change), g_object_ref( G_OBJECT( atk_obj ) ) ); // Release the wrapper object so that it can vanish .. diff --git a/vcl/unx/gtk/a11y/atktextattributes.cxx b/vcl/unx/gtk/a11y/atktextattributes.cxx index fe2f0d5e2f52..a7487c0f6e98 100644 --- a/vcl/unx/gtk/a11y/atktextattributes.cxx +++ b/vcl/unx/gtk/a11y/atktextattributes.cxx @@ -1320,7 +1320,7 @@ attribute_set_map_to_property_values( sal_Int32 nIndex = 0; for( GSList * item = attribute_set; item != NULL; item = g_slist_next( item ) ) { - AtkAttribute* attribute = (AtkAttribute *) item; + AtkAttribute* attribute = reinterpret_cast<AtkAttribute *>(item); AtkTextAttribute text_attr = atk_text_attribute_for_name( attribute->name ); if( text_attr < g_TextAttrMapSize ) diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index fb0d25897111..c108bb4272f9 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -597,8 +597,9 @@ static void handle_menu_highlighted(::VclMenuEvent const * pEvent) /*****************************************************************************/ -long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent) +sal_IntPtr WindowEventHandler(void *, void * p) { + VclSimpleEvent * pEvent = reinterpret_cast<VclSimpleEvent *>(p); try { switch (pEvent->GetId()) @@ -675,7 +676,7 @@ long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent) return 0; } -static Link g_aEventListenerLink( NULL, (PSTUB) WindowEventHandler ); +static Link g_aEventListenerLink( NULL, WindowEventHandler ); /*****************************************************************************/ @@ -743,7 +744,7 @@ ooo_atk_util_get_type (void) static_cast<guint16>(type_query.class_size), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, - (GClassInitFunc) ooo_atk_util_class_init, + reinterpret_cast<GClassInitFunc>(ooo_atk_util_class_init), (GClassFinalizeFunc) NULL, NULL, static_cast<guint16>(type_query.instance_size), diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx index 0f39c0169f23..cd9bf9e49c74 100644 --- a/vcl/unx/gtk/a11y/atkwindow.cxx +++ b/vcl/unx/gtk/a11y/atkwindow.cxx @@ -295,7 +295,7 @@ ooo_window_wrapper_get_type (void) static_cast<guint16>(type_query.class_size), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, - (GClassInitFunc) ooo_window_wrapper_class_init, + reinterpret_cast<GClassInitFunc>(ooo_window_wrapper_class_init), (GClassFinalizeFunc) NULL, NULL, static_cast<guint16>(type_query.instance_size), diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx index 552c8e390cb1..4f34e0e84144 100644 --- a/vcl/unx/gtk/a11y/atkwrapper.cxx +++ b/vcl/unx/gtk/a11y/atkwrapper.cxx @@ -636,12 +636,12 @@ atk_object_wrapper_get_type (void) sizeof (AtkObjectWrapperClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, - (GClassInitFunc) atk_object_wrapper_class_init, + reinterpret_cast<GClassInitFunc>(atk_object_wrapper_class_init), (GClassFinalizeFunc) NULL, NULL, sizeof (AtkObjectWrapper), 0, - (GInstanceInitFunc) atk_object_wrapper_init, + reinterpret_cast<GInstanceInitFunc>(atk_object_wrapper_init), NULL } ; type = g_type_register_static (ATK_TYPE_OBJECT, @@ -678,47 +678,47 @@ const struct { } aTypeTable[] = { // re-location heaven: { - "Comp", (GInterfaceInitFunc) componentIfaceInit, + "Comp", reinterpret_cast<GInterfaceInitFunc>(componentIfaceInit), atk_component_get_type, cppu::UnoType<accessibility::XAccessibleComponent>::get }, { - "Act", (GInterfaceInitFunc) actionIfaceInit, + "Act", reinterpret_cast<GInterfaceInitFunc>(actionIfaceInit), atk_action_get_type, cppu::UnoType<accessibility::XAccessibleAction>::get }, { - "Txt", (GInterfaceInitFunc) textIfaceInit, + "Txt", reinterpret_cast<GInterfaceInitFunc>(textIfaceInit), atk_text_get_type, cppu::UnoType<accessibility::XAccessibleText>::get }, { - "Val", (GInterfaceInitFunc) valueIfaceInit, + "Val", reinterpret_cast<GInterfaceInitFunc>(valueIfaceInit), atk_value_get_type, cppu::UnoType<accessibility::XAccessibleValue>::get }, { - "Tab", (GInterfaceInitFunc) tableIfaceInit, + "Tab", reinterpret_cast<GInterfaceInitFunc>(tableIfaceInit), atk_table_get_type, cppu::UnoType<accessibility::XAccessibleTable>::get }, { - "Edt", (GInterfaceInitFunc) editableTextIfaceInit, + "Edt", reinterpret_cast<GInterfaceInitFunc>(editableTextIfaceInit), atk_editable_text_get_type, cppu::UnoType<accessibility::XAccessibleEditableText>::get }, { - "Img", (GInterfaceInitFunc) imageIfaceInit, + "Img", reinterpret_cast<GInterfaceInitFunc>(imageIfaceInit), atk_image_get_type, cppu::UnoType<accessibility::XAccessibleImage>::get }, { - "Hyp", (GInterfaceInitFunc) hypertextIfaceInit, + "Hyp", reinterpret_cast<GInterfaceInitFunc>(hypertextIfaceInit), atk_hypertext_get_type, cppu::UnoType<accessibility::XAccessibleHypertext>::get }, { - "Sel", (GInterfaceInitFunc) selectionIfaceInit, + "Sel", reinterpret_cast<GInterfaceInitFunc>(selectionIfaceInit), atk_selection_get_type, cppu::UnoType<accessibility::XAccessibleSelection>::get } diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 487d5e87c824..8e20f62c14ee 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -795,7 +795,7 @@ extern "C" { static gboolean sal_gtk_timeout_prepare( GSource *pSource, gint *nTimeoutMS ) { - SalGtkTimeoutSource *pTSource = (SalGtkTimeoutSource *)pSource; + SalGtkTimeoutSource *pTSource = reinterpret_cast<SalGtkTimeoutSource *>(pSource); GTimeVal aTimeNow; g_get_current_time( &aTimeNow ); @@ -805,7 +805,7 @@ extern "C" { static gboolean sal_gtk_timeout_check( GSource *pSource ) { - SalGtkTimeoutSource *pTSource = (SalGtkTimeoutSource *)pSource; + SalGtkTimeoutSource *pTSource = reinterpret_cast<SalGtkTimeoutSource *>(pSource); GTimeVal aTimeNow; g_get_current_time( &aTimeNow ); @@ -817,7 +817,7 @@ extern "C" { static gboolean sal_gtk_timeout_dispatch( GSource *pSource, GSourceFunc, gpointer ) { - SalGtkTimeoutSource *pTSource = (SalGtkTimeoutSource *)pSource; + SalGtkTimeoutSource *pTSource = reinterpret_cast<SalGtkTimeoutSource *>(pSource); if( !pTSource->pInstance ) return FALSE; @@ -848,7 +848,7 @@ static SalGtkTimeoutSource * create_sal_gtk_timeout( GtkSalTimer *pTimer ) { GSource *pSource = g_source_new( &sal_gtk_timeout_funcs, sizeof( SalGtkTimeoutSource ) ); - SalGtkTimeoutSource *pTSource = (SalGtkTimeoutSource *)pSource; + SalGtkTimeoutSource *pTSource = reinterpret_cast<SalGtkTimeoutSource *>(pSource); pTSource->pInstance = pTimer; // #i36226# timers should be executed with lower priority @@ -900,8 +900,8 @@ void GtkSalTimer::Stop() { if( m_pTimeout ) { - g_source_destroy( (GSource *)m_pTimeout ); - g_source_unref( (GSource *)m_pTimeout ); + g_source_destroy( &m_pTimeout->aParent ); + g_source_unref( &m_pTimeout->aParent ); m_pTimeout = NULL; } } diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx index 90114bcb9512..bda7c4a605d9 100644 --- a/vcl/unx/gtk/app/gtksys.cxx +++ b/vcl/unx/gtk/app/gtksys.cxx @@ -214,8 +214,8 @@ static int _get_primary_monitor (GdkScreen *pScreen) // Perhaps we have a newer gtk+ with this symbol: if (!get_fn) { - get_fn = (int(*)(GdkScreen*))osl_getAsciiFunctionSymbol(NULL, - "gdk_screen_get_primary_monitor"); + get_fn = reinterpret_cast<int(*)(GdkScreen*)>(osl_getAsciiFunctionSymbol(NULL, + "gdk_screen_get_primary_monitor")); } #if GTK_CHECK_VERSION(2,14,0) if (!get_fn) diff --git a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx index f2e70b3e8ab1..ebadb962888c 100644 --- a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx @@ -134,7 +134,7 @@ void SAL_CALL RunDialog::windowOpened( const ::com::sun::star::lang::EventObject { SolarMutexGuard g; - g_timeout_add_full(G_PRIORITY_HIGH_IDLE, 0, (GSourceFunc)canceldialog, this, NULL); + g_timeout_add_full(G_PRIORITY_HIGH_IDLE, 0, reinterpret_cast<GSourceFunc>(canceldialog), this, NULL); } void SAL_CALL RunDialog::queryTermination( const ::com::sun::star::lang::EventObject& ) @@ -147,7 +147,7 @@ void SAL_CALL RunDialog::notifyTermination( const ::com::sun::star::lang::EventO { SolarMutexGuard g; - g_timeout_add_full(G_PRIORITY_HIGH_IDLE, 0, (GSourceFunc)canceldialog, this, NULL); + g_timeout_add_full(G_PRIORITY_HIGH_IDLE, 0, reinterpret_cast<GSourceFunc>(canceldialog), this, NULL); } void RunDialog::cancel() diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 5d257633171a..700308b385f3 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -4107,7 +4107,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) sal_Int32 nDispDPIY = GetDisplay()->GetResolution().B(); int nPointHeight = 0; static gboolean(*pAbso)(const PangoFontDescription*) = - (gboolean(*)(const PangoFontDescription*))osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "pango_font_description_get_size_is_absolute" ); + reinterpret_cast<gboolean(*)(const PangoFontDescription*)>(osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "pango_font_description_get_size_is_absolute" )); if( pAbso && pAbso( pStyle->font_desc ) ) nPointHeight = (nPangoHeight * 72 + nDispDPIY*PANGO_SCALE/2) / (nDispDPIY * PANGO_SCALE); diff --git a/vcl/unx/gtk/window/glomenu.cxx b/vcl/unx/gtk/window/glomenu.cxx index 780b6bfdab34..871692045590 100644 --- a/vcl/unx/gtk/window/glomenu.cxx +++ b/vcl/unx/gtk/window/glomenu.cxx @@ -43,7 +43,7 @@ struct item static void g_lo_menu_struct_item_init (struct item *menu_item) { - menu_item->attributes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref); + menu_item->attributes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, reinterpret_cast<GDestroyNotify>(g_variant_unref)); menu_item->links = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); } @@ -629,7 +629,7 @@ g_lo_menu_finalize (GObject *object) gint i; n_items = menu->items->len; - items = (struct item *) g_array_free (menu->items, FALSE); + items = reinterpret_cast<struct item *>(g_array_free (menu->items, FALSE)); for (i = 0; i < n_items; i++) g_lo_menu_clear_item (&items[i]); g_free (items); diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index 313386741e99..82c70e7cdd19 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -538,7 +538,7 @@ gdk_x11_window_set_utf8_property (GdkWindow *window, GDK_WINDOW_XID (window), gdk_x11_get_xatom_by_name_for_display (display, name), gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8, - PropModeReplace, (guchar *)value, strlen (value)); + PropModeReplace, reinterpret_cast<guchar const *>(value), strlen (value)); } else { @@ -1139,7 +1139,7 @@ static void lcl_set_accept_focus( GtkWindow* pWindow, gboolean bAccept, bool bBe if( bGetAcceptFocusFn ) { bGetAcceptFocusFn = false; - p_gtk_window_set_accept_focus = (setAcceptFn)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_window_set_accept_focus" ); + p_gtk_window_set_accept_focus = reinterpret_cast<setAcceptFn>(osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_window_set_accept_focus" )); } if( p_gtk_window_set_accept_focus && bBeforeRealize ) p_gtk_window_set_accept_focus( pWindow, bAccept ); @@ -1206,7 +1206,7 @@ static void lcl_set_user_time( GtkWindow* i_pWindow, guint32 i_nTime ) if( bGetSetUserTimeFn ) { bGetSetUserTimeFn = false; - p_gdk_x11_window_set_user_time = (setUserTimeFn)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_x11_window_set_user_time" ); + p_gdk_x11_window_set_user_time = reinterpret_cast<setUserTimeFn>(osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_x11_window_set_user_time" )); } bool bSet = false; if( p_gdk_x11_window_set_user_time ) @@ -1226,7 +1226,7 @@ static void lcl_set_user_time( GtkWindow* i_pWindow, guint32 i_nTime ) { XChangeProperty( pDisplay, widget_get_xid(GTK_WIDGET(i_pWindow)), nUserTime, XA_CARDINAL, 32, - PropModeReplace, (unsigned char*)&i_nTime, 1 ); + PropModeReplace, reinterpret_cast<unsigned char*>(&i_nTime), 1 ); } } #else @@ -1604,7 +1604,7 @@ bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha ) GDK_COLORSPACE_RGB, true, 8, aSize.Width(), aSize.Height(), aSize.Width() * 4, - (GdkPixbufDestroyNotify) g_free, + reinterpret_cast<GdkPixbufDestroyNotify>(g_free), NULL ); } @@ -1679,7 +1679,7 @@ void GtkSalFrame::SetIcon( sal_uInt16 nIcon ) gtk_window_set_icon_list( GTK_WINDOW(m_pWindow), pIcons ); - g_list_foreach( pIcons, (GFunc) g_object_unref, NULL ); + g_list_foreach( pIcons, reinterpret_cast<GFunc>(g_object_unref), NULL ); g_list_free( pIcons ); } @@ -2453,7 +2453,7 @@ void GtkSalFrame::setAutoLock( bool bLock ) GDK_WINDOW_XID( pRootWin ), nAtom, XA_INTEGER, 8, PropModeReplace, - (unsigned char*)&nMessage, + reinterpret_cast<unsigned char*>(&nMessage), sizeof( nMessage ) ); } @@ -3245,7 +3245,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame ) { GtkSalFrame* pThis = (GtkSalFrame*)frame; - GdkEventScroll* pSEvent = (GdkEventScroll*)pEvent; + GdkEventScroll* pSEvent = reinterpret_cast<GdkEventScroll*>(pEvent); static sal_uLong nLines = 0; if( ! nLines ) diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx index 67545b9f80fc..6a3a7b005e43 100644 --- a/vcl/unx/gtk/window/gtksalmenu.cxx +++ b/vcl/unx/gtk/window/gtksalmenu.cxx @@ -228,7 +228,7 @@ void RemoveUnusedCommands( GLOActionGroup* pActionGroup, GList* pOldCommandList, gpointer aCommand = g_list_nth_data( pNewCommand, 0 ); - GList* pOldCommand = g_list_find_custom( pOldCommandList, aCommand, (GCompareFunc) CompareStr ); + GList* pOldCommand = g_list_find_custom( pOldCommandList, aCommand, reinterpret_cast<GCompareFunc>(CompareStr) ); if ( pOldCommand != NULL ) { diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index 53bc1a310453..79e17d85107a 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -1424,7 +1424,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) const cairo_font_options_t* pNewOptions = NULL; static cairo_font_options_t* (*gdk_screen_get_font_options)(GdkScreen*) = - (cairo_font_options_t*(*)(GdkScreen*))osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_font_options" ); + reinterpret_cast<cairo_font_options_t*(*)(GdkScreen*)>(osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_font_options" )); if( gdk_screen_get_font_options != NULL ) pNewOptions = gdk_screen_get_font_options( pScreen ); aStyleSet.SetCairoFontOptions( pNewOptions ); |