[Libreoffice-commits] core.git: vcl/osx vcl/quartz

Stephan Bergmann sbergman at redhat.com
Thu Apr 2 10:44:03 PDT 2015


 vcl/osx/DataFlavorMapping.cxx |    2 +-
 vcl/osx/salinst.cxx           |    2 +-
 vcl/osx/salprn.cxx            |    6 +++---
 vcl/quartz/salgdiutils.cxx    |    4 ++--
 vcl/quartz/salvd.cxx          |    2 +-
 vcl/quartz/utils.cxx          |    2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 4c449bc71224aa4055b9122275885951a39605db
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 2 19:43:15 2015 +0200

    loplugin:redundantcast
    
    Change-Id: I6095d1209f2339387e8562074daa32779089a018

diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx
index 60804fe..cf7d527 100644
--- a/vcl/osx/DataFlavorMapping.cxx
+++ b/vcl/osx/DataFlavorMapping.cxx
@@ -216,7 +216,7 @@ Any UniDataProvider::getOOoData()
 
   if (mSystemData)
     {
-      oOOData = makeAny(OUString(reinterpret_cast<const sal_Char*>([mSystemData bytes]),
+      oOOData = makeAny(OUString(static_cast<const sal_Char*>([mSystemData bytes]),
                                  [mSystemData length],
                                  RTL_TEXTENCODING_UTF8));
     }
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index fc8e9e4..2f061cb 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -1057,7 +1057,7 @@ NSImage* CreateNSImage( const Image& rImage )
     {
         [pImage lockFocusFlipped:YES];
         NSGraphicsContext* pContext = [NSGraphicsContext currentContext];
-        CGContextRef rCGContext = reinterpret_cast<CGContextRef>([pContext graphicsPort]);
+        CGContextRef rCGContext = static_cast<CGContextRef>([pContext graphicsPort]);
 
         const CGRect aDstRect = { {0, 0}, { static_cast<CGFloat>(aSize.Width()), static_cast<CGFloat>(aSize.Height()) } };
         CGContextDrawImage( rCGContext, aDstRect, xImage );
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index db138ef..0becb85 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -78,7 +78,7 @@ AquaSalInfoPrinter::AquaSalInfoPrinter( const SalPrinterQueueInfo& i_rQueue ) :
     mpGraphics = new AquaSalGraphics();
 
     const int nWidth = 100, nHeight = 100;
-    maContextMemory.reset( reinterpret_cast<sal_uInt8*>( rtl_allocateMemory( nWidth * 4 * nHeight ) ),
+    maContextMemory.reset( static_cast<sal_uInt8*>( rtl_allocateMemory( nWidth * 4 * nHeight ) ),
                            boost::bind( rtl_freeMemory, _1 ) );
 
     if( maContextMemory )
@@ -193,7 +193,7 @@ bool AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData )
         io_pSetupData->meOrientation = mePageOrientation;
 
         io_pSetupData->mnPaperBin = 0;
-        io_pSetupData->mpDriverData = reinterpret_cast<sal_uInt8*>(rtl_allocateMemory( 4 ));
+        io_pSetupData->mpDriverData = static_cast<sal_uInt8*>(rtl_allocateMemory( 4 ));
         io_pSetupData->mnDriverDataLen = 4;
     }
     else
@@ -550,7 +550,7 @@ SalGraphics* AquaSalInfoPrinter::StartPage( ImplJobSetup* i_pSetupData, bool i_b
     if( i_bNewJobData && i_pSetupData )
         SetPrinterData( i_pSetupData );
 
-    CGContextRef rContext = reinterpret_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]);
+    CGContextRef rContext = static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]);
 
     SetupPrinterGraphics( rContext );
 
diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx
index 403651b..87bc282 100644
--- a/vcl/quartz/salgdiutils.cxx
+++ b/vcl/quartz/salgdiutils.cxx
@@ -116,7 +116,7 @@ bool AquaSalGraphics::CheckContext()
         {
             const CGSize aLayerSize = { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) };
             NSGraphicsContext* pNSGContext = [NSGraphicsContext graphicsContextWithWindow: mpFrame->getNSWindow()];
-            CGContextRef xCGContext = reinterpret_cast<CGContextRef>([pNSGContext graphicsPort]);
+            CGContextRef xCGContext = static_cast<CGContextRef>([pNSGContext graphicsPort]);
             mxLayer = CGLayerCreateWithContext( xCGContext, aLayerSize, NULL );
             CG_TRACE( "CGLayerCreateWithContext(" << xCGContext << "," << aLayerSize << ",NULL) = " << mxLayer );
             if( mxLayer )
@@ -180,7 +180,7 @@ void AquaSalGraphics::UpdateWindow( NSRect& )
     NSGraphicsContext* pContext = [NSGraphicsContext currentContext];
     if( (mxLayer != NULL) && (pContext != NULL) )
     {
-        CGContextRef rCGContext = reinterpret_cast<CGContextRef>([pContext graphicsPort]);
+        CGContextRef rCGContext = static_cast<CGContextRef>([pContext graphicsPort]);
         CG_TRACE( "[[NSGraphicsContext currentContext] graphicsPort] = " << rCGContext );
 
         CGMutablePathRef rClip = mpFrame->getClipPath();
diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx
index 6a6426c..ae25748 100644
--- a/vcl/quartz/salvd.cxx
+++ b/vcl/quartz/salvd.cxx
@@ -236,7 +236,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
             {
                 NSGraphicsContext* pNSContext = [NSGraphicsContext graphicsContextWithWindow: pNSWindow];
                 if( pNSContext )
-                    xCGContext = reinterpret_cast<CGContextRef>([pNSContext graphicsPort]);
+                    xCGContext = static_cast<CGContextRef>([pNSContext graphicsPort]);
             }
             else
             {
diff --git a/vcl/quartz/utils.cxx b/vcl/quartz/utils.cxx
index 1ed6a51..3098590 100644
--- a/vcl/quartz/utils.cxx
+++ b/vcl/quartz/utils.cxx
@@ -35,7 +35,7 @@ OUString GetOUString( CFStringRef rStr )
     const UniChar* pConstStr = CFStringGetCharactersPtr( rStr );
     if( pConstStr )
         return OUString( pConstStr, nLength );
-    UniChar* pStr = reinterpret_cast<UniChar*>( rtl_allocateMemory( sizeof(UniChar)*nLength ) );
+    UniChar* pStr = static_cast<UniChar*>( rtl_allocateMemory( sizeof(UniChar)*nLength ) );
     CFRange aRange = { 0, nLength };
     CFStringGetCharacters( rStr, aRange, pStr );
     OUString aRet( pStr, nLength );


More information about the Libreoffice-commits mailing list