vcl/unx/generic/window/salframe.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 10831c8b7b39f058452e640ba804f5a928441ed9
Author:     Rene Engelhard <r...@rene-engelhard.de>
AuthorDate: Sun Mar 17 17:42:43 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Mar 21 09:04:08 2024 +0100

    fix 32bit build with clang
    
    seen in a build-with-clang experiment:
    
    
/home/rene/LibreOffice/git/master/vcl/unx/generic/window/salframe.cxx:575:39: 
error: non-constant-expression cannot be narrowed from type 'unsigned int' to 
'tools::Long' (aka 'long') in initializer list [-Wc++11-narrowing]
        maGeometry.setPosSize({ x, y }, { w, h });
                                          ^
    
/home/rene/LibreOffice/git/master/vcl/unx/generic/window/salframe.cxx:575:39: 
note: insert an explicit cast to silence this issue
        maGeometry.setPosSize({ x, y }, { w, h });
                                          ^
                                          static_cast<Long>( )
    
/home/rene/LibreOffice/git/master/vcl/unx/generic/window/salframe.cxx:575:42: 
error: non-constant-expression cannot be narrowed from type 'unsigned int' to 
'tools::Long' (aka 'long') in initializer list [-Wc++11-narrowing]
        maGeometry.setPosSize({ x, y }, { w, h });
                                             ^
    
/home/rene/LibreOffice/git/master/vcl/unx/generic/window/salframe.cxx:575:42: 
note: insert an explicit cast to silence this issue
        maGeometry.setPosSize({ x, y }, { w, h });
                                             ^
                                             static_cast<Long>( )
    
/home/rene/LibreOffice/git/master/vcl/unx/generic/window/salframe.cxx:1473:34: 
error: non-constant-expression cannot be narrowed from type 'unsigned int' to 
'tools::Long' (aka 'long') in initializer list [-Wc++11-narrowing]
                maGeometry.setSize({ pState->GetMaximizedWidth(), 
pState->GetMaximizedHeight() });
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    
/home/rene/LibreOffice/git/master/vcl/unx/generic/window/salframe.cxx:1473:34: 
note: insert an explicit cast to silence this issue
                maGeometry.setSize({ pState->GetMaximizedWidth(), 
pState->GetMaximizedHeight() });
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                     static_cast<Long>(         )
    
/home/rene/LibreOffice/git/master/vcl/unx/generic/window/salframe.cxx:1473:63: 
error: non-constant-expression cannot be narrowed from type 'unsigned int' to 
'tools::Long' (aka 'long') in initializer list [-Wc++11-narrowing]
                maGeometry.setSize({ pState->GetMaximizedWidth(), 
pState->GetMaximizedHeight() });
                                                                  
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
/home/rene/LibreOffice/git/master/vcl/unx/generic/window/salframe.cxx:1473:63: 
note: insert an explicit cast to silence this issue
                maGeometry.setSize({ pState->GetMaximizedWidth(), 
pState->GetMaximizedHeight() });
                                                                  
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                  
static_cast<Long>(          )
    
/home/rene/LibreOffice/git/master/vcl/unx/generic/window/salframe.cxx:3481:60: 
error: non-constant-expression cannot be narrowed from type 'unsigned int' to 
'tools::Long' (aka 'long') in initializer list [-Wc++11-narrowing]
            maGeometry.setPosSize({ xp + nLeft, yp + nTop }, { w, h });
                                                               ^
    
/home/rene/LibreOffice/git/master/vcl/unx/generic/window/salframe.cxx:3481:60: 
note: insert an explicit cast to silence this issue
            maGeometry.setPosSize({ xp + nLeft, yp + nTop }, { w, h });
                                                               ^
                                                               
static_cast<Long>( )
    
/home/rene/LibreOffice/git/master/vcl/unx/generic/window/salframe.cxx:3481:63: 
error: non-constant-expression cannot be narrowed from type 'unsigned int' to 
'tools::Long' (aka 'long') in initializer list [-Wc++11-narrowing]
            maGeometry.setPosSize({ xp + nLeft, yp + nTop }, { w, h });
                                                                  ^
    
/home/rene/LibreOffice/git/master/vcl/unx/generic/window/salframe.cxx:3481:63: 
note: insert an explicit cast to silence this issue
            maGeometry.setPosSize({ xp + nLeft, yp + nTop }, { w, h });
                                                                  ^
                                                                  
static_cast<Long>( )
    6 errors generated.
    make[2]: *** 
[/home/rene/LibreOffice/git/master/solenv/gbuild/LinkTarget.mk:340: 
/home/rene/LibreOffice/git/master/workdir/CxxObject/vcl/unx/generic/window/salframe.o]
 Error 1
    
    Fails with clang 16, builds with gcc 12
    
    Change-Id: I668e3178aaaf528947c96db090f7b458e7f76754
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165039
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/unx/generic/window/salframe.cxx 
b/vcl/unx/generic/window/salframe.cxx
index e3300de34357..f845b691cdcd 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -572,7 +572,7 @@ void X11SalFrame::Init( SalFrameStyleFlags nSalFrameStyle, 
SalX11Screen nXScreen
             Hints.window_group = GetShellWindow();
     }
 
-    maGeometry.setPosSize({ x, y }, { w, h });
+    maGeometry.setPosSize({ x, y }, { static_cast<tools::Long>(w), 
static_cast<tools::Long>(h) });
     updateScreenNumber();
 
     XSync( GetXDisplay(), False );
@@ -1470,7 +1470,7 @@ void X11SalFrame::SetWindowState( const vcl::WindowData 
*pState )
                               pState->width(), pState->height());
             // guess maximized geometry from last time
             maGeometry.setPos({ pState->GetMaximizedX(), 
pState->GetMaximizedY() });
-            maGeometry.setSize({ pState->GetMaximizedWidth(), 
pState->GetMaximizedHeight() });
+            maGeometry.setSize({ 
static_cast<tools::Long>(pState->GetMaximizedWidth()), 
static_cast<tools::Long>(pState->GetMaximizedHeight()) });
             cairo_xlib_surface_set_size(mpSurface,  
pState->GetMaximizedWidth(), pState->GetMaximizedHeight());
             updateScreenNumber();
         }
@@ -3478,7 +3478,7 @@ bool X11SalFrame::HandleReparentEvent( XReparentEvent 
*pEvent )
          *  note: this works because hWM_Parent is direct child of root,
          *  not necessarily parent of GetShellWindow()
          */
-        maGeometry.setPosSize({ xp + nLeft, yp + nTop }, { w, h });
+        maGeometry.setPosSize({ xp + nLeft, yp + nTop }, { 
static_cast<tools::Long>(w), static_cast<tools::Long>(h) });
     }
 
     // limit width and height if we are too large: #47757

Reply via email to