vcl/unx/generic/gdi/cairo_xlib_cairo.cxx |   28 ++++++++++++++--------------
 vcl/unx/generic/gdi/cairo_xlib_cairo.hxx |    8 ++++----
 2 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit b22fe22139a42d51c0bbe542a6f7a782e771feb5
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Nov 7 13:28:55 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Nov 7 19:31:15 2023 +0100

    loplugin:fieldcast in vcl
    
    Change-Id: I699783305355c49854307cc83ec1e2e9a94cc326
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159076
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx 
b/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx
index 3e563d206619..87758f24d98e 100644
--- a/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx
+++ b/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx
@@ -61,23 +61,23 @@ namespace cairo
     {}
 
     X11SysData::X11SysData( const SystemGraphicsData& pSysDat ) :
-        pDisplay(pSysDat.pDisplay),
+        pDisplay(static_cast<_XDisplay*>(pSysDat.pDisplay)),
         hDrawable(pSysDat.hDrawable),
-        pVisual(pSysDat.pVisual),
+        pVisual(static_cast<Visual*>(pSysDat.pVisual)),
         nScreen(pSysDat.nScreen)
     {}
 
     X11SysData::X11SysData( const SystemEnvData& pSysDat, const SalFrame* 
pReference ) :
-        pDisplay(pSysDat.pDisplay),
+        pDisplay(static_cast<_XDisplay*>(pSysDat.pDisplay)),
         hDrawable(pSysDat.GetWindowHandle(pReference)),
-        pVisual(pSysDat.pVisual),
+        pVisual(static_cast<Visual*>(pSysDat.pVisual)),
         nScreen(pSysDat.nScreen)
     {}
 
     X11Pixmap::~X11Pixmap()
     {
         if( mpDisplay && mhDrawable )
-            XFreePixmap( static_cast<Display*>(mpDisplay), mhDrawable );
+            XFreePixmap( mpDisplay, mhDrawable );
     }
 
     /**
@@ -132,9 +132,9 @@ namespace cairo
     X11Surface::X11Surface( const X11SysData& rSysData, int x, int y, int 
width, int height ) :
         maSysData(rSysData),
         mpSurface(
-            cairo_xlib_surface_create( 
static_cast<Display*>(rSysData.pDisplay),
+            cairo_xlib_surface_create( rSysData.pDisplay,
                                        rSysData.hDrawable,
-                                       static_cast<Visual*>(rSysData.pVisual),
+                                       rSysData.pVisual,
                                        width + x, height + y ),
             &cairo_surface_destroy)
     {
@@ -156,9 +156,9 @@ namespace cairo
                             const BitmapSystemData& rData ) :
         maSysData( rSysData ),
         mpSurface(
-            cairo_xlib_surface_create( 
static_cast<Display*>(rSysData.pDisplay),
+            cairo_xlib_surface_create( rSysData.pDisplay,
                                        
reinterpret_cast<Drawable>(rData.aPixmap),
-                                       static_cast<Visual*>(rSysData.pVisual),
+                                       rSysData.pVisual,
                                        rData.mnWidth, rData.mnHeight ),
             &cairo_surface_destroy)
     {
@@ -209,8 +209,8 @@ namespace cairo
                     break;
             }
 
-            pFormat = XRenderFindStandardFormat( 
static_cast<Display*>(maSysData.pDisplay), nFormat );
-            Pixmap hPixmap = limitXCreatePixmap( 
static_cast<Display*>(maSysData.pDisplay), maSysData.hDrawable,
+            pFormat = XRenderFindStandardFormat( maSysData.pDisplay, nFormat );
+            Pixmap hPixmap = limitXCreatePixmap( maSysData.pDisplay, 
maSysData.hDrawable,
                                      width > 0 ? width : 1, height > 0 ? 
height : 1,
                                      pFormat->depth );
 
@@ -219,9 +219,9 @@ namespace cairo
                                 std::make_shared<X11Pixmap>(hPixmap, 
maSysData.pDisplay),
                                 CairoSurfaceSharedPtr(
                                     
cairo_xlib_surface_create_with_xrender_format(
-                                        
static_cast<Display*>(maSysData.pDisplay),
+                                        maSysData.pDisplay,
                                         hPixmap,
-                                        ScreenOfDisplay(static_cast<Display 
*>(maSysData.pDisplay), maSysData.nScreen),
+                                        ScreenOfDisplay(maSysData.pDisplay, 
maSysData.nScreen),
                                         pFormat, width, height ),
                                     &cairo_surface_destroy) ));
         }
@@ -270,7 +270,7 @@ namespace cairo
 
     void X11Surface::flush() const
     {
-        XSync( static_cast<Display*>(maSysData.pDisplay), false );
+        XSync( maSysData.pDisplay, false );
     }
 }
 
diff --git a/vcl/unx/generic/gdi/cairo_xlib_cairo.hxx 
b/vcl/unx/generic/gdi/cairo_xlib_cairo.hxx
index 229a0f7671dd..f0b47a3744a2 100644
--- a/vcl/unx/generic/gdi/cairo_xlib_cairo.hxx
+++ b/vcl/unx/generic/gdi/cairo_xlib_cairo.hxx
@@ -37,19 +37,19 @@ namespace cairo {
         explicit X11SysData( const SystemGraphicsData& );
         explicit X11SysData( const SystemEnvData&, const SalFrame* pReference 
);
 
-        void*   pDisplay;       // the relevant display connection
+        _XDisplay* pDisplay;       // the relevant display connection
         Drawable hDrawable;     // a drawable
-        void*   pVisual;        // the visual in use
+        Visual*  pVisual;        // the visual in use
         int nScreen;        // the current screen of the drawable
     };
 
     /// RAII wrapper for a pixmap
     struct X11Pixmap
     {
-        void* mpDisplay;  // the relevant display connection
+        _XDisplay* mpDisplay;  // the relevant display connection
         Pixmap  mhDrawable; // a drawable
 
-        X11Pixmap( Pixmap hDrawable, void* pDisplay ) :
+        X11Pixmap( Pixmap hDrawable, _XDisplay* pDisplay ) :
             mpDisplay(pDisplay),
             mhDrawable(hDrawable)
         {}

Reply via email to