From c43d6d6a3ac1a8a93b3e2ba2f549a7135848487f Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 28 Jan 2020 13:10:14 +0100 Subject: loplugin:unsignedcompare (macOS) Change-Id: Idaba1b3731ee551ca747b6b8eb6bf49e33fae415 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87604 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- vcl/osx/salframe.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'vcl/osx') diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index ce5ada142911..dc012aa1d07b 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -576,17 +577,17 @@ SalEvent AquaSalFrame::PreparePosSize(long nX, long nY, long nWidth, long nHeigh if (nFlags & SAL_FRAME_POSSIZE_WIDTH) { maGeometry.nWidth = nWidth; - if (mnMaxWidth > 0 && maGeometry.nWidth > static_cast(mnMaxWidth)) + if (mnMaxWidth > 0 && maGeometry.nWidth > o3tl::make_unsigned(mnMaxWidth)) maGeometry.nWidth = mnMaxWidth; - if (mnMinWidth > 0 && maGeometry.nWidth < static_cast(mnMinWidth)) + if (mnMinWidth > 0 && maGeometry.nWidth < o3tl::make_unsigned(mnMinWidth)) maGeometry.nWidth = mnMinWidth; } if (nFlags & SAL_FRAME_POSSIZE_HEIGHT) { maGeometry.nHeight = nHeight; - if (mnMaxHeight > 0 && maGeometry.nHeight > static_cast(mnMaxHeight)) + if (mnMaxHeight > 0 && maGeometry.nHeight > o3tl::make_unsigned(mnMaxHeight)) maGeometry.nHeight = mnMaxHeight; - if (mnMinHeight > 0 && maGeometry.nHeight < static_cast(mnMinHeight)) + if (mnMinHeight > 0 && maGeometry.nHeight < o3tl::make_unsigned(mnMinHeight)) maGeometry.nHeight = mnMinHeight; } if (nEvent != SalEvent::NONE) @@ -783,7 +784,7 @@ void AquaSalFrame::doShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) NSArray* pScreens = [NSScreen screens]; if( pScreens ) { - if( nDisplay >= 0 && static_cast(nDisplay) < [pScreens count] ) + if( nDisplay >= 0 && o3tl::make_unsigned(nDisplay) < [pScreens count] ) pScreen = [pScreens objectAtIndex: nDisplay]; else { -- cgit