shithub: libdvdcss

Download patch

ref: dc2155d210c80aee6a197af0dbb50a7f00adf3b3
parent: b8e9f3093f4c5e3567b3e034807b197f42ab8688
author: Jean-Baptiste Kempf <jb@videolan.org>
date: Tue Mar 12 09:27:36 EDT 2013

Win32: kill warnings about strict-aliasing rules in ioctl.c

warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -927,7 +927,8 @@
         key->KeyType    = DvdAsf;
         key->KeyFlags   = 0;
 
-        ((PDVD_ASF)key->KeyData)->SuccessFlag = *pi_asf;
+        PDVD_ASF keyData = (PDVD_ASF)key->KeyData;
+        keyData->SuccessFlag = *pi_asf;
 
         i_ret = DeviceIoControl( (HANDLE) i_fd, IOCTL_DVD_READ_KEY, key,
                 key->KeyLength, key, key->KeyLength, &tmp, NULL ) ? 0 : -1;
@@ -937,7 +938,8 @@
             return i_ret;
         }
 
-        *pi_asf = ((PDVD_ASF)key->KeyData)->SuccessFlag;
+        keyData = (PDVD_ASF)key->KeyData;
+        *pi_asf = keyData->SuccessFlag;
     }
     else
     {
@@ -1580,9 +1582,10 @@
             return i_ret;
         }
 
-        *p_type = ((PDVD_RPC_KEY)key->KeyData)->TypeCode;
-        *p_mask = ((PDVD_RPC_KEY)key->KeyData)->RegionMask;
-        *p_scheme = ((PDVD_RPC_KEY)key->KeyData)->RpcScheme;
+        PDVD_RPC_KEY keyData = (PDVD_RPC_KEY)key->KeyData;
+        *p_type = keyData->TypeCode;
+        *p_mask = keyData->RegionMask;
+        *p_scheme = keyData->RpcScheme;
     }
     else
     {