Kaydet (Commit) c3c88d6b authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:redundantcast

"static_cast from 'CGContextRef' (aka 'CGContext *') prvalue to 'CGContextRef'
(aka 'CGContext *') prvalue is redundant" with
--with-macosx-version-min-required=10.14 at least.  (Not exactly sure why this
warning only starts to appear now.  Presumably something changed in the system
headers.  Lets see whether older baseline builds are happy with the dropped
casts, too.)

Change-Id: Id52d1891e5e33f7c37d095440339980b4000ca4e
Reviewed-on: https://gerrit.libreoffice.org/61353
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 1346d0c1
...@@ -953,7 +953,7 @@ NSImage* CreateNSImage( const Image& rImage ) ...@@ -953,7 +953,7 @@ NSImage* CreateNSImage( const Image& rImage )
{ {
[pImage lockFocusFlipped:YES]; [pImage lockFocusFlipped:YES];
NSGraphicsContext* pContext = [NSGraphicsContext currentContext]; NSGraphicsContext* pContext = [NSGraphicsContext currentContext];
CGContextRef rCGContext = static_cast<CGContextRef>([pContext graphicsPort]); CGContextRef rCGContext = [pContext CGContext];
const CGRect aDstRect = { {0, 0}, { static_cast<CGFloat>(aSize.Width()), static_cast<CGFloat>(aSize.Height()) } }; const CGRect aDstRect = { {0, 0}, { static_cast<CGFloat>(aSize.Width()), static_cast<CGFloat>(aSize.Height()) } };
CGContextDrawImage( rCGContext, aDstRect, xImage ); CGContextDrawImage( rCGContext, aDstRect, xImage );
......
...@@ -547,7 +547,7 @@ SalGraphics* AquaSalInfoPrinter::StartPage( ImplJobSetup* i_pSetupData, bool i_b ...@@ -547,7 +547,7 @@ SalGraphics* AquaSalInfoPrinter::StartPage( ImplJobSetup* i_pSetupData, bool i_b
if( i_bNewJobData && i_pSetupData ) if( i_bNewJobData && i_pSetupData )
SetPrinterData( i_pSetupData ); SetPrinterData( i_pSetupData );
CGContextRef rContext = static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]); CGContextRef rContext = [[NSGraphicsContext currentContext] CGContext];
SetupPrinterGraphics( rContext ); SetupPrinterGraphics( rContext );
......
...@@ -118,7 +118,7 @@ bool AquaSalGraphics::CheckContext() ...@@ -118,7 +118,7 @@ bool AquaSalGraphics::CheckContext()
{ {
const CGSize aLayerSize = { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) }; const CGSize aLayerSize = { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) };
NSGraphicsContext* pNSGContext = [NSGraphicsContext graphicsContextWithWindow: mpFrame->getNSWindow()]; NSGraphicsContext* pNSGContext = [NSGraphicsContext graphicsContextWithWindow: mpFrame->getNSWindow()];
CGContextRef xCGContext = static_cast<CGContextRef>([pNSGContext graphicsPort]); CGContextRef xCGContext = [pNSGContext CGContext];
mxLayer = CGLayerCreateWithContext( xCGContext, aLayerSize, nullptr ); mxLayer = CGLayerCreateWithContext( xCGContext, aLayerSize, nullptr );
SAL_INFO( "vcl.cg", "CGLayerCreateWithContext(" << xCGContext << "," << aLayerSize << ",NULL) = " << mxLayer ); SAL_INFO( "vcl.cg", "CGLayerCreateWithContext(" << xCGContext << "," << aLayerSize << ",NULL) = " << mxLayer );
if( mxLayer ) if( mxLayer )
...@@ -192,7 +192,7 @@ void AquaSalGraphics::UpdateWindow( NSRect& ) ...@@ -192,7 +192,7 @@ void AquaSalGraphics::UpdateWindow( NSRect& )
NSGraphicsContext* pContext = [NSGraphicsContext currentContext]; NSGraphicsContext* pContext = [NSGraphicsContext currentContext];
if( (mxLayer != nullptr) && (pContext != nullptr) ) if( (mxLayer != nullptr) && (pContext != nullptr) )
{ {
CGContextRef rCGContext = static_cast<CGContextRef>([pContext graphicsPort]); CGContextRef rCGContext = [pContext CGContext];
SAL_INFO( "vcl.cg", "[[NSGraphicsContext currentContext] graphicsPort] = " << rCGContext ); SAL_INFO( "vcl.cg", "[[NSGraphicsContext currentContext] graphicsPort] = " << rCGContext );
CGMutablePathRef rClip = mpFrame->getClipPath(); CGMutablePathRef rClip = mpFrame->getClipPath();
......
...@@ -270,7 +270,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY ) ...@@ -270,7 +270,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
NSGraphicsContext* pNSContext = [NSGraphicsContext graphicsContextWithWindow: pNSWindow]; NSGraphicsContext* pNSContext = [NSGraphicsContext graphicsContextWithWindow: pNSWindow];
if( pNSContext ) if( pNSContext )
{ {
xCGContext = static_cast<CGContextRef>([pNSContext graphicsPort]); xCGContext = [pNSContext CGContext];
} }
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment