Andrew Talbot : dplayx: Cast-qual warnings fix.

Alexandre Julliard julliard at wine.codeweavers.com
Sun Sep 10 03:28:24 CDT 2006


Module: wine
Branch: master
Commit: ded7d0bcd5ecca9a9a587d01d01ef5fa963e27ba
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=ded7d0bcd5ecca9a9a587d01d01ef5fa963e27ba

Author: Andrew Talbot <Andrew.Talbot at talbotville.com>
Date:   Sun Sep 10 00:14:23 2006 +0100

dplayx: Cast-qual warnings fix.

---

 dlls/dplayx/dplay.c       |    4 ++--
 dlls/dplayx/name_server.c |   19 +++++++++----------
 dlls/dplayx/name_server.h |    2 +-
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c
index c60d2a9..baafb8d 100644
--- a/dlls/dplayx/dplay.c
+++ b/dlls/dplayx/dplay.c
@@ -691,7 +691,7 @@ HRESULT DP_HandleMessage( IDirectPlay2Im
       /* No reply expected */
       NS_AddRemoteComputerAsNameServer( lpcMessageHeader,
                                         This->dp2->spData.dwSPHeaderSize,
-                                        (LPDPMSG_ENUMSESSIONSREPLY)lpcMessageBody,
+                                        lpcMessageBody,
                                         This->dp2->lpNameServerData );
       break;
     }
@@ -742,7 +742,7 @@ #endif
 #if 1
     case DPMSGCMD_JUSTENVELOPE:
     {
-      TRACE( "GOT THE SELF MESSAGE: %p -> 0x%08lx\n", lpcMessageHeader, ((LPDWORD)lpcMessageHeader)[1] );
+      TRACE( "GOT THE SELF MESSAGE: %p -> 0x%08lx\n", lpcMessageHeader, ((const DWORD *)lpcMessageHeader)[1] );
       NS_SetLocalAddr( This->dp2->lpNameServerData, lpcMessageHeader, 20 );
       DP_MSG_ReplyReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize );
     }
diff --git a/dlls/dplayx/name_server.c b/dlls/dplayx/name_server.c
index e108695..86d333e 100644
--- a/dlls/dplayx/name_server.c
+++ b/dlls/dplayx/name_server.c
@@ -96,21 +96,20 @@ static DPQ_DECL_COMPARECB( cbUglyPig, GU
 }
 
 /* Store the given NS remote address for future reference */
-/* FIXME: LPDPMSG_ENUMSESSIONSREPLY should be const */
-void NS_AddRemoteComputerAsNameServer( LPCVOID                   lpcNSAddrHdr,
-                                       DWORD                     dwHdrSize,
-                                       LPDPMSG_ENUMSESSIONSREPLY lpMsg,
-                                       LPVOID                    lpNSInfo )
+void NS_AddRemoteComputerAsNameServer( LPCVOID                      lpcNSAddrHdr,
+                                       DWORD                        dwHdrSize,
+                                       LPCDPMSG_ENUMSESSIONSREPLY   lpcMsg,
+                                       LPVOID                       lpNSInfo )
 {
   DWORD len;
   lpNSCache     lpCache = (lpNSCache)lpNSInfo;
   lpNSCacheData lpCacheNode;
 
-  TRACE( "%p, %p, %p\n", lpcNSAddrHdr, lpMsg, lpNSInfo );
+  TRACE( "%p, %p, %p\n", lpcNSAddrHdr, lpcMsg, lpNSInfo );
 
   /* See if we can find this session. If we can, remove it as it's a dup */
   DPQ_REMOVE_ENTRY_CB( lpCache->first, next, data->guidInstance, cbUglyPig,
-                       lpMsg->sd.guidInstance, lpCacheNode );
+                       lpcMsg->sd.guidInstance, lpCacheNode );
 
   if( lpCacheNode != NULL )
   {
@@ -140,11 +139,11 @@ void NS_AddRemoteComputerAsNameServer( L
     return;
   }
 
-  CopyMemory( lpCacheNode->data, &lpMsg->sd, sizeof( *lpCacheNode->data ) );
-  len = WideCharToMultiByte( CP_ACP, 0, (LPWSTR)(lpMsg+1), -1, NULL, 0, NULL, NULL );
+  CopyMemory( lpCacheNode->data, &lpcMsg->sd, sizeof( *lpCacheNode->data ) );
+  len = WideCharToMultiByte( CP_ACP, 0, (LPCWSTR)(lpcMsg+1), -1, NULL, 0, NULL, NULL );
   if ((lpCacheNode->data->u1.lpszSessionNameA = HeapAlloc( GetProcessHeap(), 0, len )))
   {
-      WideCharToMultiByte( CP_ACP, 0, (LPWSTR)(lpMsg+1), -1,
+      WideCharToMultiByte( CP_ACP, 0, (LPCWSTR)(lpcMsg+1), -1,
                            lpCacheNode->data->u1.lpszSessionNameA, len, NULL, NULL );
   }
 
diff --git a/dlls/dplayx/name_server.h b/dlls/dplayx/name_server.h
index 4b48c2b..ec2c298 100644
--- a/dlls/dplayx/name_server.h
+++ b/dlls/dplayx/name_server.h
@@ -32,7 +32,7 @@ void NS_SetLocalComputerAsNameServer( LP
 void NS_SetRemoteComputerAsNameServer( LPCDPSESSIONDESC2 lpsd, LPVOID lpNSInfo );
 void NS_AddRemoteComputerAsNameServer( LPCVOID lpNSAddrHdr,
                                        DWORD dwHdrSize,
-                                       LPDPMSG_ENUMSESSIONSREPLY lpMsg,
+                                       LPCDPMSG_ENUMSESSIONSREPLY lpcMsg,
                                        LPVOID lpNSInfo );
 LPVOID NS_GetNSAddr( LPVOID lpNSInfo );
 DWORD NS_GetNsMagic( LPVOID lpNSInfo );




More information about the wine-cvs mailing list