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/gtk | |
parent | f6cfe99d22041061b8042cdab05e57180c0ab70a (diff) |
Some more loplugin:cstylecast: vcl
Change-Id: I74d35630b9fcdaa97af0b1f1e6d1e5c72488964d
Diffstat (limited to 'vcl/unx/gtk')
-rw-r--r-- | vcl/unx/gtk/a11y/atkfactory.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/gtk/a11y/atkhypertext.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/gtk/a11y/atklistener.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/a11y/atktextattributes.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/a11y/atkutil.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/gtk/a11y/atkwindow.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/a11y/atkwrapper.cxx | 22 | ||||
-rw-r--r-- | vcl/unx/gtk/app/gtkdata.cxx | 12 | ||||
-rw-r--r-- | vcl/unx/gtk/app/gtksys.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/gtk/fpicker/SalGtkPicker.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/window/glomenu.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtksalframe.cxx | 16 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtksalmenu.cxx | 2 |
14 files changed, 46 insertions, 45 deletions
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 ) { |