[Libreoffice-commits] core.git: 2 commits - sd/source

Stephan Bergmann sbergman at redhat.com
Sat Mar 28 13:03:21 PDT 2015


 sd/source/ui/remotecontrol/BluetoothServer.cxx      |    8 ++++----
 sd/source/ui/remotecontrol/BufferedStreamSocket.cxx |    9 ++++++++-
 2 files changed, 12 insertions(+), 5 deletions(-)

New commits:
commit c79ea206b8b2a78488aa20e8b440806078c37537
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Sat Mar 28 21:02:32 2015 +0100

    loplugin:cstylecast
    
    Change-Id: Iffcc1b4fff1293c34f8f8d4eb11465ecb0a873d7

diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx
index 7a2120b..de02dbd 100644
--- a/sd/source/ui/remotecontrol/BluetoothServer.cxx
+++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx
@@ -512,7 +512,7 @@ sal_Int32 OSXBluetoothWrapper::write( const void* pBuffer, sal_uInt32 n )
 {
     SAL_INFO( "sdremote.bluetooth", "OSXBluetoothWrapper::write(" << pBuffer << ", " << n << ") mpChannel=" << mpChannel );
 
-    char* ptr = (char*)pBuffer;
+    char const * ptr = static_cast<char const *>(pBuffer);
     sal_uInt32 nBytesWritten = 0;
 
     if (mpChannel == nil)
@@ -522,7 +522,7 @@ sal_Int32 OSXBluetoothWrapper::write( const void* pBuffer, sal_uInt32 n )
     {
         int toWrite = n - nBytesWritten;
         toWrite = toWrite <= mnMTU ? toWrite : mnMTU;
-        if ( [mpChannel writeSync:ptr length:toWrite] != kIOReturnSuccess )
+        if ( [mpChannel writeSync:const_cast<char *>(ptr) length:toWrite] != kIOReturnSuccess )
         {
             SAL_INFO( "sdremote.bluetooth", "  [mpChannel writeSync:" << (void *) ptr << " length:" << toWrite << "] returned error, total written " << nBytesWritten );
             return nBytesWritten;
@@ -544,7 +544,7 @@ void OSXBluetoothWrapper::appendData(void* pBuffer, size_t len)
         ::osl::MutexGuard aQueueGuard( mMutex );
         SAL_INFO( "sdremote.bluetooth", "OSXBluetoothWrapper::appendData: entered mutex" );
         mBuffer.insert(mBuffer.begin()+mBuffer.size(),
-                       (char*)pBuffer, (char *)pBuffer+len);
+                       static_cast<char*>(pBuffer), static_cast<char *>(pBuffer)+len);
         SAL_INFO( "sdremote.bluetooth", "  setting mHaveBytes" );
         mHaveBytes.set();
         SAL_INFO( "sdremote.bluetooth", "  leaving mutex" );
@@ -566,7 +566,7 @@ void incomingCallback( void *userRefCon,
 
     SAL_INFO( "sdremote.bluetooth", "incomingCallback()" );
 
-    BluetoothServer* pServer = (BluetoothServer*)userRefCon;
+    BluetoothServer* pServer = static_cast<BluetoothServer*>(userRefCon);
 
     IOBluetoothRFCOMMChannel* channel = [IOBluetoothRFCOMMChannel withRFCOMMChannelRef:(IOBluetoothRFCOMMChannelRef)objectRef];
 
commit b2ba39927b64f56831d4d7cca85b831911930809
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Sat Mar 28 21:02:14 2015 +0100

    Blind fix for non-standard send(2) signature on Windows
    
    Change-Id: I0cff8d60aea0d9d0f41209ea04380259142ed607

diff --git a/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx b/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
index 9b756fe..8f36ea5 100644
--- a/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
+++ b/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
@@ -56,7 +56,14 @@ sal_Int32 BufferedStreamSocket::write( const void* pBuffer, sal_uInt32 n )
     if ( !usingCSocket )
         return StreamSocket::write( pBuffer, n );
     else
-        return ::send( mSocket, pBuffer, (size_t) n, 0 );
+        return ::send(
+            mSocket,
+#if defined WNT
+            static_cast<char *>(pBuffer),
+#else
+            pBuffer,
+#endif
+            (size_t) n, 0 );
 }
 
 void BufferedStreamSocket::close()


More information about the Libreoffice-commits mailing list